Time:2014-12-19 01:17
Source:Csdn
Author:Big Wisdom Report
Click:5,639 plays
Would like to do some firewall policy. The firewall policy is written in the/etc/sysconfig/iptables file. But I found that I did not have this file.
Cd/etc/sysconfig/[[email protected] sysconfig]# lsatd firstboot irqbalance network-scripts Portal sysstatauditd Grub kdump ntpd rngd sysstat.ioconfauthconfig Htcacheclean Kernel ntpdate rsyslog system-config-firewallcbq httpd keyboard prelink Sandbox system-config-firewall.oldclock i18n modules quota_nld saslauthd Udevconsole init netconsole raid-check selinuxcpuspeed ip6tables-config Network readahead smartmontoolscrond iptables-config networking readonly-root
Workaround:
1. Write a iptables command to configure a firewall rule. such as: Iptables-p OUTPUT ACCEPT.
Cd/etc/sysconfig/[[email protected] sysconfig]# iptables-p OUTPUT ACCEPT
2. The service iptables save.
[[email protected] sysconfig]# service iptables saveiptables:saving firewall rules to/etc/sysconfig/ iptables:[OK][[email protected] sysconfig]# lsatd firstboot iptables-config Networking
readonly-root sshdauditd grub irqbalance network-scripts Portal Sysstata Uthconfig htcacheclean kdump ntpd rngd SYSSTAT.IOCONFCBQ httpd Kernel ntpdate rsyslog system-config-firewallclock i18n keyboard Prel Ink sandbox system-config-firewall.oldconsole init modules quota_nld SASL AUTHD udevcpuspeed ip6tables-config netconsole raid-check selinuxcrond iptables networ K ReadAhead smartmontools[[email protected] sysconfig]#
3. Service iptables Restart command restart:
[Email protected] sysconfig]# service iptables restartiptables:setting chains to policy Accept:filter [ ok
]iptables:flushing firewall rules: [ OK ]iptables:unloading modules: [ OK ]iptables: Applying firewall rules: [ OK
Iptables file resolution not found under/etc/sysconfig/