I know that in RedHat, in the IP tables I can block incoming connections to a local port. I can also block connections from a specific IP.
But is it possible to block a connection from a specific IP address and the connection attempt is made from a service running at a specific port on the external IP?
So if I had something like,
iptables -A INPUT -s 202.54.20.22 -j DROP
iptables -A OUTPUT -d 202.54.20.22 -j DROP
Can I specify more specificity for that particular IP address and select a specific port to block? Let's say the service is running on port 5000 at 202.54.20.22, can I be that specific? Note that this service may not attempt to connect to port 5000 on the server, so just blocking that port on the server isn't what I am after.