Pages

Sunday, June 17, 2012

IPTables Check and Modify [RHEL]



iptables -l
iptables --flush

INPUT   Holds rules for traffic directed at this server.
FORWARD Holds rules for traffic that will be forwarding on to an IP behind this server (i.e. If this box serves as a firewall for other servers).
OUTPUT  Holds rules for traffic that is coming from this server out to the internet.

ACCEPT Traffic is accepted for delivery.
REJECT Traffic is rejected, sending a packet back to the sending host.
DROP   The traffic is dropped. Nothing is sent back to the sending host.

To save your active rules execute the following:

# /etc/init.d/iptables save
This will save your rules to '/etc/sysconfig/iptables'.


When you start iptables, the rules are read from '/etc/sysconfig/iptables':

# /etc/init.d/iptables start
Starting iptables [OK]

And when you stop iptables, all rules are flushed:

# /etc/init.d/iptables stop
Stopping iptables [OK]

-Reference: http://www.howtoforge.com/linux_iptables_sarge

No comments:

Post a Comment