Linux系统开启和关闭防火墙命令

  • 2022-05-25 02:20:57 1875

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

Image
Image
我们的承诺 · 先测试 后付费

业务跑通再付费,测试不满意分文不收

提供真机测试环境;效果不符合预期/业务不满足不收取任何费用。

免费申请试用 真机交付 · 无需订金 · 秒计响应
Image
Image

© 2005-2026 zrzv.com. All Rights Reserved. 网站地图