By default iptables firewall stores its configuration at /etc/sysconfig/iptables file. Type the following command to see its
# cat /etc/sysconfig/iptables
Or
# iptables -L
Temporarily delete all the firewall rules
At first, create flush.iptables script with following command
# vi flush.iptables
Add the following content
#!/bin/sh iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT
Finally, run flush.iptables script with the following command
# sh flush.iptables
After running flush.iptables script, if you restart the iptables, you’ll see all the default rules again. So, flush is only temporary.
Permanently remove all the default firewall rules
Step 1. Flush all these rules temporarily, as we discussed above.
Step 2. Saving firewall rules to /etc/sysconfig/iptables. Type the following command
# /etc/init.d/iptables save
Or
# iptables-save > /etc/sysconfig/iptables
Related Posts:
- How To Enable/Disable Firewall On Centos / RedHat / Fedora
- How To Install Lighttpd And PHP (PHP-FPM) On CentOS 6
- How To Setup A LAMP Server On Centos 6.0
- Setting Up Password Aging In Linux
- How to install IPTables on RedHat / Centos Linux
- chkconfig Command
- Repel port flood by CSF and IPT_Recent
- How Do I Block An IP Address On Linux Server ?
- How To Configure Static IP Address On CentOS
- How To Restart Networking Service In Linux