linux port open, the firewall View

1, there is a query which ports are open.

firewall-cmd --list-port

2, query whether to open a port number, such as port 80.

firewall-cmd --query-port=80/tcp

3, open ports, such as port 80.

firewall-cmd --permanent --zone=public --add-port=80/tcp

4, cancel the port is open, such as port 80.

firewall-cmd --permanent --zone=public --remove-port=80/tcp

5, allows a port (e.g., port 80) through the public area, effective immediately and permanent.

firewall-cmd --reload

6, the firewall related commands

Start: systemctl start firewalld

View status: systemctl status firewalld 

停止: systemctl disable firewalld

Disable: systemctl stop firewalld

 

 

Published 23 original articles · won praise 33 · views 30000 +

Guess you like

Origin blog.csdn.net/qq_33612228/article/details/104789906