1

I've found the following iptables chart: Iptables chart How does the packet traverse iptables tables when the packet is sent from one local process to another local process?

Regards.

1 Answer 1

3

The packet will traverse the left side of the diagram. Packets are only processed by the FORWARD chain when they come from an external source and are not destined for an address on the local machine (and, of course, you have ip_forward enabled).

Something I found interesting when writing rules to affect local processes is that even if you send a TCP connect to the IP address of an Ethernet interface (say, eth0) it will be sent in and out of the loopback device. So the following rule would not stop local processes from connecting to port 4000 on the address bound to eth0.

iptables -A INPUT -i eth0 -p tcp --dport 4000 -j REJECT

Just as the following rule would only stop local processes from connecting to port 4000 on the address bound to eth0, but not from other hosts:

iptables -A INPUT -i lo -p tcp --dport 4000 -j REJECT

Granted this is all moot if the process listens on 0.0.0.0 as you can just connect to 127.0.0.1 :-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .