Linux

Linux下查看防火墙状态

作者:admin110 来源:web交流网 2019-04-11 17:24 浏览:0 我要评论(0)

使用service方式:1 管理员权限下使用service iptables status查看当前防火墙状态:[root@localhost wys] service iptables statusi

使用service方式:

1.管理员权限下使用service iptables status查看当前防火墙状态:
[root@localhost wys]# service iptables status
iptables: Firewall is not running.           //说明没有开启
 
2.service iptables start开启防火墙
iptables: Applying firewall rules:                         [  OK  ]
 
然后在查看一下状态
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     
 
3.service iptables stop关闭防火墙:
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]
 
系统重启后不开启防火墙:chkconfig iptables off 
重启开启:chkconfig iptables on
 

转载请注明出处。

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源;3.作者投稿可能会经我们编辑修改或补充。

网友点评
评论(已有0条评论)
还没有评论,快来抢沙发吧!
新闻
  • 新闻
  • 软件
精彩导读