Centos7 对特定端口开通防火墙

1.查看防火墙是否启动

[root@localhost bin]# systemctl status firewalld.service 

2.如果防火墙没有启动,则需要启动防火墙

[root@localhost bin]# systemctl start firewalld.service 


3.开通防火墙(以redis的6379端口为例)

[root@localhost bin]# firewall-cmd --permanent --zone=public --add-port=6379/tcp 
 

猜你喜欢

转载自blog.csdn.net/lihongtai/article/details/82820618