smcgrath12
Occasional Visitor
Hi, I am trying to understand iptables and I did a dump of the current rules (with no holes through the firewall except for SSH & Router access through the WAN).
One of the lines that I see from my iptables -L command is:
"-A INPUT -d 192.168.1.1 -p tcp -m tcp --dport 80 -j ACCEPT".
I understand that this rule targets the FILTER table's INPUT chain. I assume that this rule allows default HTTP access over port 80 to my router's web interface (IP is 192.168.1.1). I did have couple of questions for this rule.
1. Why is it necessary to put the "-d" and "--dport" switches in this rule? From my reading, doesn't the INPUT chain gets invoked ONLY when the target is the local host (in this case, 192.168.1.1)? Wouldn't this rule/chain be invoked automatically because the rule targets the INPUT chain?
2. Shouldn't this rule be locked down with additional "-i br0" in the rule? Meaning, only accept port 80 connections if they are coming from the "protected network"?
Thank you for your time. I have been scouring the web for tutorials/papers on iptables and I have just enough knowledge to be dangerous....
One of the lines that I see from my iptables -L command is:
"-A INPUT -d 192.168.1.1 -p tcp -m tcp --dport 80 -j ACCEPT".
I understand that this rule targets the FILTER table's INPUT chain. I assume that this rule allows default HTTP access over port 80 to my router's web interface (IP is 192.168.1.1). I did have couple of questions for this rule.
1. Why is it necessary to put the "-d" and "--dport" switches in this rule? From my reading, doesn't the INPUT chain gets invoked ONLY when the target is the local host (in this case, 192.168.1.1)? Wouldn't this rule/chain be invoked automatically because the rule targets the INPUT chain?
2. Shouldn't this rule be locked down with additional "-i br0" in the rule? Meaning, only accept port 80 connections if they are coming from the "protected network"?
Thank you for your time. I have been scouring the web for tutorials/papers on iptables and I have just enough knowledge to be dangerous....