Home  >  Article  >  Operation and Maintenance  >  How to check which ports are open in centos7

How to check which ports are open in centos7

WBOY
WBOYOriginal
2022-04-02 16:46:2912945browse

In centos7, you can use "firewalld-cmd" to view the open ports. "firewalld-cmd" can display firewall-related configuration information. The syntax is "firewall-cmd --zone=public -- list-ports".

How to check which ports are open in centos7

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

How to check which ports are opened by centos7

You can use the firewall-cmd --zone=public --list-ports command to view all open ports

The centos7 version is very useful for the firewall To strengthen, no longer use the original iptables, enable firewalld

The example is as follows:

  • Configure firewalld-cmd

  • View Version: firewall-cmd --version

  • View help: firewall-cmd --help

  • Display status: firewall-cmd --state

  • View all open ports: firewall-cmd --zone=public --list-ports

  • Update firewall rules: firewall-cmd --reload

  • View zone information: firewall-cmd --get-active-zones

  • View the zone to which the specified interface belongs: firewall-cmd --get-zone-of-interface=eth0

  • Reject all packages: firewall-cmd --panic-on

  • Cancel the rejection status : firewall-cmd --panic-off

  • Check whether it is rejected: firewall-cmd --query-panic

You can use any A firewalld configuration tool to configure zones and firewall policies.

Expand knowledge:

How to check which ports are open in centos7

Recommended tutorial: "centos tutorial"

The above is the detailed content of How to check which ports are 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