当前位置:首页 » 操作系统 » 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-02-28 09:33:47 浏览:858
境外服务器和虚拟ip 发布:2025-02-28 09:31:33 浏览:655
液晶电视存储器 发布:2025-02-28 09:23:50 浏览:920
学习linux先学什么 发布:2025-02-28 09:22:16 浏览:347
在cmd输什么可以查电脑配置 发布:2025-02-28 09:08:25 浏览:309
搭建共享文件存储空间 发布:2025-02-28 09:03:48 浏览:825
android线程handler 发布:2025-02-28 09:03:44 浏览:408
短链接生成源码 发布:2025-02-28 08:56:43 浏览:775
百度音乐上传 发布:2025-02-28 08:48:39 浏览:287
b站漫画存储 发布:2025-02-28 08:42:02 浏览:966