IPTables Firewall Script


IPTables Firewall Script
Save this file as /etc/sysconfig/iptables & then source it and run iptables-save to create /etc/sysconfig/iptables, which is an input file consumed by the script /etc/rc.d/init.d/iptables. which in turn makes use of the script /sbin/iptables-restore.

LF_default_network

To configure the set of iptables rules
/etc/rc.d/init.d/iptables stop

To save the current set of iptables rules for use at next reboot
iptables-save > /etc/sysconfig/iptables

To dynamically restart iptables after modifying /etc/sysconfig/iptables:
/etc/rc.d/init.d/iptables restart

To examine the current set of rules in effect
/etc/rc.d/init.d/iptables status

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s