How to find the iptables file in centos?
#1Write an iptables command to configure a firewall rule. Such as: iptables -P OUTPUT ACCEPT.
[root@iZ23gx7o02aZ /]# cd /etc/sysconfig/ [root@iZ23gx7o02aZ sysconfig]# iptables -P OUTPUT ACCEPT
2. service iptables save to save.
[root@iZ23gx7o02aZ sysconfig]# service iptables save iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ] [root@iZ23gx7o02aZ sysconfig]# ls atd firstboot iptables-config networking readonly-root sshd auditd grub irqbalance network-scripts rhn sysstat authconfig htcacheclean kdump ntpd rngd sysstat.ioconf cbq httpd kernel ntpdate rsyslog system-config-firewall clock i18n keyboard prelink sandbox system-config-firewall.old console init modules quota_nld saslauthd udev cpuspeed ip6tables-config netconsole raid-check selinux crond iptables network readahead smartmontools [root@iZ23gx7o02aZ sysconfig]#
3. Service iptables restart command to restart:
[root@iZ23gx7o02aZ sysconfig]# service iptables restart iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK ] iptables: Applying firewall rules: [ OK ] [root@iZ23gx7o02aZ sysconfig]#
Related reference: centOS tutorial
The above is the detailed content of How to find iptables file in centos. For more information, please follow other related articles on the PHP Chinese website!