I configured my iptables like this:
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT udp -- anywhere anywhere udp dpt:ssh
ACCEPT all -- anywhere anywhere //(this is loopback)
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
From my understanding, the browser should work fine, because the browser begins browsing through the OUTPUT, which is ACCEPTing everything, but it's not working. Where have I made a mistake?
And my second question is, when I added the loopback rule (iptables -A INPUT -i lo -j ACCEPT
), it visually looks like a general rule that accepts traffic from anywhere and not just the loopback, which is pretty confusing, is there some way to tell it's a loopback rule if I don't know it is?
Thank you.
Complete `iptables1 rules will be
Delete curent rules and chains in
iptables
allow loopback
allow established connections
allow
SSH
or some differentTCP
portallow
UDP
on port22
default policies
Save
This is it. I think :)