linux防火墙怎么关闭?

关闭防火墙,就可以外部访问了。不受端口限制。生产环境,最好开启防火墙,开启部分端口。

1.永久关闭防火墙

开启: chkconfig iptables on
关闭: chkconfig iptables off

2.暂时关闭防火墙,即刻生效

开启: service iptables start
关闭: service iptables stop

3.开启部分端口

vim /etc/sysconfig/iptables

添加想要开启的相关端口

-A INPUT -m state --state NEW -m tcp -p tcp --dport 6379 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8081 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8082 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
service iptables restart

更多web开发知识,请查阅 HTML中文网 !!

以上就是linux防火墙怎么关闭?的详细内容,更多请关注0133技术站其它相关文章!

赞(0) 打赏
未经允许不得转载:0133技术站首页 » 其他答疑