centos7 open port and view port

1, open ports

cmd = --zone public-Firewall-Port --add = 5672 / TCP --permanent    # open port 5672

cmd = --zone public-Firewall-Port --remove = 5672 / TCP --permanent   # 5672 closed port

cmd---reload Firewall    # configuration takes effect immediately

 

2, view all open firewall ports

firewall-cmd --zone=public --list-ports

 

3, turn off the firewall

If you want to open ports too much, too much trouble, you can turn off the firewall, security self-assessment

systemctl stop firewalld.service

 

4, see the firewall status

 firewall-cmd --state

 

5, view the listening port

netstat -lnpt

PS: centos7 no default netstat command, net-tools tools need to be installed, yum install -y net-tools

 

 

6, check the port is occupied by what process

netstat -lnpt |grep 5672

 

7 For more information, view the process of

ps 6832

 

8, abort the process

kill -9 6832

Guess you like

Origin www.cnblogs.com/xiguachaodan/p/11586278.html