System configuration directory:/usr/lib/firewalld/ User Configuration directory:/etc/firewalld/ 1, Firewall firewalld basic commands: Firewall-cmd-- Version (view firewall firewall version) Firewall-cmd--state or systemctl status firewalld (view Firewall firewall status) systemctl start firewalld (boot) systemctl restart Firewalld (reboot) Systemctl Stop Firewalld (stop ) systemctl disable FIREWALLD (disabled)
2, firewall open specify port command The first step: you can first view the open port of this machine, command: Firewall-cmd--zone=public --list-ports, The following figure: Description A port is not open. Step two: You can view the rules of the firewall first, Command: Firewall-cmd--list-all , as shown below: Step three: Open the specified port through the command to open the port: Firewall-cmd--zone=public--add-port=80/tcp--permanent (add port 80 in firewall), as shown in the following figure: command meaning:--zone # Scope--add-port=80/tcp #添加端口, the format is: Port/Communication protocol--permanent #永久生效, without this parameter reboot after failure Add success Remember to reboot the firewall Oh, command: systemctl restart Firewalld.service at the second view added port situation, as shown in: above firewall configuration successful, firewall open specified port configuration successful ... 3, Port command Command 1:NETSTAT-ANTP | GREP:80 (see which service is occupied by port 80) or netstat-antpuel | grep ": 22" | Grep -v grep (Worry-grep itself) Command 2:NETSTAT-ANTP | grep: (View all port occupancy) &NBSp 4. Process command command 1:ps aux | grep nginx (view Nginx process run state) or PS aux | grep:80 | Grep-v grep (Worry-grep itself)