linux配置防火墙iptables失败,firewalld成功

Posted on 2020-04-24 10:32  写程序到老  阅读(583)  评论(0)    收藏  举报

在服务器上配置iptables,开启自己项目使用的接口,然后使用systemctl enable iptables,也配置成功,reboot后

systemctl status iptables,是dead...,cat /etc/sysconfig/iptables,自已开启的端口还在,只是重启服务器后iptables并未启动,

但firewalld的就可以配置成功,同样使用systemctl enable firewalld 就成功了,

firewall-cmd --zone=public --add-port=8080/tcp --permanent 添加端口 并permanent永久生效,重启成功。

reboot,8080端口成功,项目访问成功。

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3