2013-03-23 01:39:03 UTC
For example
iptables -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT
the above rules accept incoming SSL from the Internet and the return response from your network.
That part I understand, but using the example I cannot see how the firewall knows that the Internet is incoming and the LAN is outgoing. I have seen a lot of IPtables examples and I don't recall see anything that explains how the a system with one network card knows what is incoming and what is outgoing.
Hope that somebody knows.
Thanks