Linux防火墙关闭开启
2014-12-17 10:24
519 查看
今日在Linux测试环境上装了一个tomcat,在windows本机上访问http://192.168.10.97:8080,无果;在Linux(192.168.10.97)机器上,执行wget ‘http://192.168.10.97:8080'能够正常获取数据。于是断定是防火墙开启了。于是查询Linux防火墙关闭的方法:
)查看防火墙状态
chkconfig iptables --list
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
)查看防火墙状态
chkconfig iptables --list
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
相关文章推荐
- Linux下开启/关闭防火墙命令(转载)
- linux 防火墙的开启和关闭
- 关闭或开启Linux上的防火墙
- 通过Linux系统下iptables防火墙开启/关闭指定端口方法
- Linux下关闭和开启防火墙命令
- Linux防火墙的关闭和开启
- linux 防火墙的开启与关闭
- 开启关闭Linux防火墙
- 开启关闭Linux防火墙
- Linux下开启/关闭防火墙命令
- linux下开启和关闭防火墙命令
- Linux下开启/关闭防火墙命令
- 如何开启关闭Linux的防火墙 #S#
- 如何开启和关闭LINUX 防火墙
- Linux下关闭和开启防火墙命令
- [Linux]CentOS 5.5 防火墙开启、关闭以及开放指定端口
- Linux防火墙的开启和关闭
- Linux防火墙的关闭和开启
- linux防火墙开启关闭
- linux--开启关闭防火墙