Save Iptables rules
Rules created with the iptables command are stored in memory. If the system is restarted before saving the iptables rule set, all rules are lost. To save netfilter rules, type the following command as root:
# /etc/init.d/iptables save
If you are using IPv6, enter:
# /etc/init.d/ip6tables save
The above commands will write the current iptables configuration to /etc/sysconfig/iptables. The next time the system boots, the iptables init script reapplies the rules saved in /etc/sysconfig/iptables. You can also save the iptables rules to a separate file for distribution, backup or other purposes. Type the following command as root
# iptables-save > /root/iptables.rules
If you are using IPv6, enter:
# ip6tables-save > /root/iptables.rules
Restore Iptables rules
To restore it use the command iptables-restore, type the following command as root:
# iptables-restore < /root/iptables.rules
If you are using IPv6, enter:
# ip6tables-restore < /root/iptables.rules
Related Posts:
- How Do I Block An IP Address On Linux Server ?
- What is the role of this variables in php.ini file (expose_php – allow_url_fopen – register_globals) ?
- Linux Shutdown Command
- How To Disable Ctrl + Alt + Del On Ubuntu 11
- How To Disable Ctrl + Alt + Del On Centos / RedHat
- How To Install Subversion (SVN) Extension Working With PHP 5.3
- How To Setup Iptables Firewall For A Web Server On CentOS
- How Do I Fix “Host is blocked because of many connection error” In MySQL
- How To Start / Shutdown / Reboot Guest Operating Systems With virsh Command On KVM
- Repel port flood by CSF and IPT_Recent