[root@pluto bin]# vim /etc/sysconfig/iptables
?
A INPUT -m state --state NEW -m tcp -p tcp --dport 80 ?-j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
?
#情况1
[root@pluto 桌面]# service iptables restart
iptables:将链设置为政策 ACCEPT:filter ???????????????????[确定]
iptables:清除防火墙规则: ????????????????????????????????[确定]
iptables:正在卸载模块: ??????????????????????????????????[确定]
iptables:应用防火墙规则: ????????????????????????????????[确定]
[root@pluto 桌面]# service iptables status
?
#情况2
[root@pluto bin]# service iptables restart
iptables:将链设置为政策 ACCEPT:filter ???????????????????[确定]
iptables:清除防火墙规则: ????????????????????????????????[确定]
iptables:正在卸载模块: ??????????????????????????????????[确定]
iptables:应用防火墙规则:iptables-restore v1.4.7: Bad state "-m"
Error occurred at line: 10
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
???????????????????????????????????????????????????????????[失败]
#出现以上错误运行下列代码
[root@pluto bin]# /etc/rc.d/init.d/iptables save
iptables:将防火墙规则保存到 /etc/sysconfig/iptables: ????[确定]
[root@pluto bin]# /etc/init.d/iptables restart
iptables:将链设置为政策 ACCEPT:filter ???????????????????[确定]
iptables:清除防火墙规则: ????????????????????????????????[确定]
iptables:正在卸载模块: ??????????????????????????????????[确定]
iptables:应用防火墙规则: ????????????????????????????????[确定]
?
|