Linux firewalld to open the firewall and port step tutorial, linuxfirewalld
1. Basic use of firewalld
Start: systemctl start firewalld
View status: systemctl status firewalld
Stop: systemctl disable firewalld
Disable: systemctl stop firewalld
2. systemctl is the main tool in CentOS7 service management tools. It integrates the functions of previous services and chkconfig.
Start a service: systemctl start firewalld. service
Disable a service: systemctl stop firewalld. service
Restart a service: systemctl restart firewalld. service
Displays the status of a service: systemctl status firewalld. service
Enable a service at startup: systemctl enable firewalld. service
Disable a service at startup: systemctl disable firewalld. service
Check whether the service is started: systemctl is-enabled firewalld. service
View the list of started services: systemctl list-unit-files | grep enabled
View the list of failed services: systemctl -- failed
3. Configure firewalld-cmd
View the version: firewall-cmd -- version
View help: firewall-cmd -- help
Display status: firewall-cmd -- state
View All opened ports: firewall-cmd -- zone = public -- list-ports
Update firewall rules: firewall-cmd -- reload
View region information: firewall-cmd -- get-active-zones
View the region of the specified interface: firewall-cmd -- get-zone-of-interface = eth0
Reject all packages: firewall-cmd -- panic-on
Cancel rejection status: firewall-cmd -- panic-off
Check whether the request is rejected: firewall-cmd -- query-panic
How can I enable a port?
Add
Firewall-cmd -- zone = public -- add-port = 80/tcp -- permanent (-- permanent takes effect permanently. If this parameter is not set, it becomes invalid after restart)
Reload
Firewall-cmd -- reload
View
Firewall-cmd -- zone = public -- query-port = 80/tcp
Delete
Firewall-cmd -- zone = public -- remove-port = 80/tcp -- permanent <