Home >Operation and Maintenance >CentOS >How to check if the port is open in centos7

How to check if the port is open in centos7

WBOY
WBOYOriginal
2022-04-01 16:44:1825831browse

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.

How to check if the port is open in centos7

The operating environment of this article: centos 7 system, Dell G3 computer.

How to check whether the port is open in centos7

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)

How to check if the port is open in centos7Expand 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn