How to read IP tables
Hi ppl,
I run the below command Code:
cat /etc/sysconfig/iptables # Firewall configuration written by system-config-securitylevel # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :RH-Firewall-1-INPUT - [0:0] -A INPUT -j RH-Firewall-1-INPUT -A FORWARD -j RH-Firewall-1-INPUT -A RH-Firewall-1-INPUT -i lo -j ACCEPT -A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT -A RH-Firewall-1-INPUT -p 50 -j ACCEPT -A RH-Firewall-1-INPUT -p 51 -j ACCEPT -A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT -A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited COMMIT Can any one teach me how to read this? or point me to the man I can read? |
Quote:
Josh |
so for example
-A RH-Firewall-1-INPUT -i lo -j ACCEPT This means append to chain named "RH-Firewall-1-INPUT", the interface in qn is "lo" and jump to "ACCEPT"? and for, -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT this means append to chain named "RH-Firewall-1-INPUT",protocol in qn is tcp that match tcp from port 631 and jump to "ACCEPT"? am i right in saying that? |
It is not jumping, you are just telling it accept the packet data if the destination port is 631 (cups) and it is a tcp packet. Hope that helps you understand it better.
http://en.wikipedia.org/wiki/Iptables Wikipedia has an excellent description of operation. Cheers, Josh |
Quote:
|
An excellent (if a teensy bit long) document on iptables is available at:
http://iptables-tutorial.frozentux.net/ Available in several versions; I'd advise downloading a readable version, rather than just looking at the html, because you'll probably want to keep going back to various parts over a period of time. |
Quote:
|
All times are GMT -5. The time now is 04:53 PM. |