1、开放端口
firewall-cmd –zone=public –add-port=12345/tcp –permanent # 开放12345端口
firewall-cmd –zone=public –remove-port=12345/tcp –permanent #关闭12345端口
firewall-cmd –reload # 配置立即生效

2、查看防火墙所有开放的端口
firewall-cmd –zone=public –list-ports

3、关闭防火墙
systemctl stop firewalld.service

4、查看防火墙状态
firewall-cmd –state

5、查看监听的端口
yum install -y net-tools
netstat -lnpt

6、检查端口被哪个进程占用
netstat -lnpt |grep 12345

Comments are closed.

Post Navigation