Analysis of linux Viewing Firewall Status and Open Port Status

  • 2021-07-22 12:00:23
  • OfStack

1. View firewall status

View firewall status systemctl status firewalld

Open firewall systemctl start firewalld

Close firewall systemctl stop firewalld

Turn on firewall service firewalld start

If it cannot be opened,

First use: systemctl unmask firewalld. service

Then: systemctl start firewalld. service

2. View the status of open ports

Query the open port netstat-ntulp grep port number: You can view one specific port number

Query whether the specified port is open firewall-cmd-query-port=666/tcp

Prompt yes, indicating opening; no indicates that it is not turned on.

3. External port development

Check to see if the desired port is open: firewall-cmd-query-port=6379/tcp

Add the specified port that needs to be opened: firewall-cmd-add-port=123/tcp-permanent

Reload the added port: firewall-cmd-reload

Query whether the specified port was successfully opened: firewall-cmd-query-port=123/tcp

Removes the specified port: firewall-cmd-permanent-remove-port=123/tcp

Summarize

Above is the site introduced to you linux view firewall status and open port status, I hope to help you!


Related articles: