I've setup my raring-ringtail machine and decided to use iptables after removing ufw to have more control over my network security. However, I'm stuck at one point. First, I've set default policy to deny all traffic by default:
iptables -P INPUT DROP iptables -P OUTPUT DROP iptables -P FORWARD DROP
After that, I've added ACCEPT rules for my local network interfaces, which work fine. However, in order for some of my local services (such as web-server local browsing) to work, I need to allow traffic originating to/from my local interface (lo). For this, I've found two versions on the net:
iptables -A INPUT -i lo -j ACCEPT # Allow local addresses iptables -A OUTPUT -o lo -j ACCEPT # Allow local addresses
iptables -A INPUT -s 127.0.0.1 -j ACCEPT # Allow Allow local addresses iptables -A OUTPUT -d 127.0.0.1 -j ACCEPT # Allow Allow local addresses
I want to know whats the difference between the two? Is allowing traffic to/from the "lo" interface same as originating/destined-to 127.0.0.1? Which one should I use and why?