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
Release: 2022-04-01 16:44:18
Original
25870 people have browsed it

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   # 配置立即生效
Copy after login

2. View all open ports on the firewall

firewall-cmd --zone=public --list-ports
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template