当前位置: 技术问答>linux和unix
关于iptables服务的问题,防火墙设置
来源: 互联网 发布时间:2017-05-08
本文导语: 看以下命令,先停掉iptables服务,查状态is stopped, 然后-L查看了一下, 再status看状态变了,我在程序里判断的是grep "is stopped"来捕获防火墙开闭状态, 怎么-L命令一执行,status就变这个了呢,导致程序没法正确处理...
看以下命令,先停掉iptables服务,查状态is stopped, 然后-L查看了一下,
再status看状态变了,我在程序里判断的是grep "is stopped"来捕获防火墙开闭状态,
怎么-L命令一执行,status就变这个了呢,导致程序没法正确处理,高手来指导一下
[root@ovs159 ~]# service iptables stop
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
[root@ovs159 ~]# service iptables status
Firewall is stopped.
[root@ovs159 ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@ovs159 ~]# service iptables status
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
再status看状态变了,我在程序里判断的是grep "is stopped"来捕获防火墙开闭状态,
怎么-L命令一执行,status就变这个了呢,导致程序没法正确处理,高手来指导一下
[root@ovs159 ~]# service iptables stop
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
[root@ovs159 ~]# service iptables status
Firewall is stopped.
[root@ovs159 ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@ovs159 ~]# service iptables status
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
|
是的