开放端口:
[root@WX32 ~]# iptables -I INPUT -p tcp --dport 80 -j ACCEPT
保存配置:
[root@WX32 ~]# service iptables save
Saving firewall rules to /etc/sysconfig/iptables: [ OK ]
重启防火墙:
[root@WX32 ~]# service iptables restart
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
Applying iptables firewall rules: [ OK ]
Loading additional iptables modules: ip_conntrack_netbios_n[ OK ]
查看配置:
[root@WX32 ~]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
...