Analysis of linux to check the status of firewalls and ports open to the outside world
1. View firewall status
View firewall status systemctl status firewalld
Turn on firewall systemctl start firewalld
Turn off Firewall systemctl stop firewalld
Turn on firewall service firewalld start
If you can't open it.
First use: systemctl unmask firewalld.service
Then: systemctl start firewalld.service
two。 View the status of ports open to the outside world
Query the open port netstat-ntulp | grep port number: you can view a specific port number.
Query whether the specified port has firewall-cmd enabled-- query-port=666/tcp
The prompt yes indicates that it is enabled, and no indicates that it is not enabled.
3. External development port
Check whether the port you want to open is open: firewall-cmd-- query-port=6379/tcp
Add specified ports that need to be open: firewall-cmd-- add-port=123/tcp-- permanent
Reload the added port: firewall-cmd-- reload
Query whether the specified port is enabled successfully: firewall-cmd-- query-port=123/tcp
Remove designated port: firewall-cmd-- permanent-- remove-port=123/tcp
Summary
The above is the linux that the editor introduced to you to check the status of the firewall and the port status that is open to the outside world. I hope it will be helpful to everyone!