当前位置:首页 » 操作系统 » linux下关闭防火墙

linux下关闭防火墙

发布时间: 2023-08-22 13:36:53

‘壹’ 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

更多详细Linux知识可参考《Linux就该这么学》。

‘贰’ linux关闭防火墙命令

关闭防火墙的linux命令是【service iptables stop】,打开方法:首先登录linux账号,点击【log in】;然后右键于Linux系统空白处,选择 【Open in Terminal】;最后输入代码即可。

red hat/CentOs7关闭防火墙的命令!

1:查看防火状态

systemctl status firewalld

service iptablesstatus

2:暂时关闭防火墙

systemctl stop firewalld

service iptablesstop

3:永久关闭防火墙

systemctl disable firewalld

chkconfig iptables off

4:重启防火墙

systemctl enable firewalld

service iptables restart

5:永久关闭后重启

//暂时还没有试过

chkconfig iptableson

热点内容
java返回this 发布:2025-10-20 08:28:16 浏览:646
制作脚本网站 发布:2025-10-20 08:17:34 浏览:937
python中的init方法 发布:2025-10-20 08:17:33 浏览:633
图案密码什么意思 发布:2025-10-20 08:16:56 浏览:822
怎么清理微信视频缓存 发布:2025-10-20 08:12:37 浏览:732
c语言编译器怎么看执行过程 发布:2025-10-20 08:00:32 浏览:1067
邮箱如何填写发信服务器 发布:2025-10-20 07:45:27 浏览:300
shell脚本入门案例 发布:2025-10-20 07:44:45 浏览:161
怎么上传照片浏览上传 发布:2025-10-20 07:44:03 浏览:853
python股票数据获取 发布:2025-10-20 07:39:44 浏览:764