Centos 查看并操作控制防火墙状态
{ 1. 查看防火墙iptables当前运行状态 }
service iptables status
//未启动
iptables: Firewall is not running.
//已启动
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
...
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
...
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
...
{ 2. 操作/控制防火墙 }
//启动
service iptables start
//关闭
service iptables stop
//重启
service iptables restart
{ 3.查看当前防火墙配置信息 }
iptables -L -n
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
...
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
...
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
...
留言