现在的位置: 首页 > 综合 > 正文

Linux如何关闭防火墙和查看防火墙的具体情况

2013年08月28日 ⁄ 综合 ⁄ 共 578字 ⁄ 字号 评论关闭

1.Linux下关闭和开启防火墙

1) 重启后生效

开启: chkconfig iptables on

关闭: chkconfig iptables off

2) 即时生效,重启后失效

开启: service iptables start

关闭: service iptables stop

需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。

在开启了防火墙时,做如下设置,开启相关端口,

修改/etc/sysconfig/iptables 文件,添加以下内容:

-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT

-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT 字串6

[root@101/udp socket_interface]# /sbin/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

2.查看防火墙:

iptables -L

抱歉!评论已关闭.