centOS 防火墙 iptables

--- 查看防火墙状态
#service iptables status
如果防火墙未启用,则提示:“iptables: Firewall is not running.”
如果防火墙已启用,则给出如下格式信息:
Table: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
2    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0
3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
4    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
5    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination
1    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

 

--- 启动防火墙
#service iptables start
如果启动成功,则提示:
iptables: Applying firewall rules:                         [  OK  ]

 

--- 停止防火墙
#service iptables stop
如果停止成功,则提示:
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]

 

 

 

centOS7 默认使用的防火墙是firewall,不再是iptables。

扫描二维码关注公众号,回复: 365828 查看本文章

http://huangqiqing123.iteye.com/blog/2301462

猜你喜欢

转载自huangqiqing123.iteye.com/blog/2241342
今日推荐