Home > Article > Operation and Maintenance > How to check if the port is open in centos7
In centos7, you can use the "firewall-cmd --zone=public --list-ports" command to check whether the port is open. This command can display all open ports; firewall is used to manage the firewall, and the port Opening and closing viewing are controlled by a firewall.
The operating environment of this article: centos 7 system, Dell G3 computer.
You can use the firewall-cmd --zone=public --list-ports command to view all open ports
CentOS7 port The opening and closing of the view are controlled by the firewall. The specific commands are as follows:
View the firewall status: (active (running) is the open state)
Expand knowledge;
1. Open ports
firewall-cmd --zone=public --add-port=5672/tcp --permanent # 开放5672端口 firewall-cmd --zone=public --remove-port=5672/tcp --permanent #关闭5672端口 firewall-cmd --reload # 配置立即生效
2. View all open ports on the firewall
firewall-cmd --zone=public --list-ports
Recommended tutorial: "centos Tutorial》
The above is the detailed content of How to check if the port is open in centos7. For more information, please follow other related articles on the PHP Chinese website!