centOS7 开启端口

centOS开放端口

1、运行命令:
firewall-cmd --get-active-zones
运行完成之后,可以看到zone名称,

运行结果:

public

      interfaces:erns33

2、执行如下命令:

firewall-cmd --zone=public --add-port=3306/tcp --permanent

运行结果: success

3、重启防火墙,运行命令:
firewall-cmd --reload
运行结果: success

4、查看端口号是否开启,运行命令:
firewall-cmd --query-port=3306/tcp

运行结果:yes

猜你喜欢

转载自blog.csdn.net/liyongbing1122/article/details/81781608