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

linux防火墙端口关闭

发布时间: 2025-01-02 09:18:29

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

重起iptalbes服务:service iptables restart

❷ 如何关闭linux防火墙的443端口

1、首先需要在Linux终端输入指令:iptables -I INPUT -p tcp --dport 443 -j ACCEPT。

❸ 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就该这么学》。

热点内容
苹果传输安卓机视频怎么不压缩 发布:2025-09-18 14:53:43 浏览:681
sql页面 发布:2025-09-18 14:51:08 浏览:951
无法访问移动硬盘参数错误 发布:2025-09-18 14:50:15 浏览:547
exist数据库 发布:2025-09-18 14:42:36 浏览:660
白百何访问 发布:2025-09-18 14:20:14 浏览:460
人人贷源码 发布:2025-09-18 14:11:02 浏览:998
pythonlist删除list 发布:2025-09-18 14:03:29 浏览:250
我的世界服务器手机版新手 发布:2025-09-18 13:51:33 浏览:841
php从入门到精通下载 发布:2025-09-18 13:36:44 浏览:167
抖音使用脚本 发布:2025-09-18 13:29:36 浏览:816