firewalld use (collection)

1, the basic use of firewalld
start: systemctl start firewalld
view status: systemctl status firewalld
stop: systemctl disable firewalld
disabled: systemctl STOP firewalld
2.systemctl is CentOS7 service management tool in the main tool before it combines the functions of service and chkconfig one.
Start a service: systemctl start firewalld.service
shut down 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 boot: systemctl enable firewalld.service
at boot disable a service: systemctl disable firewalld.service
see if the service startup: systemctl is-enabled firewalld.service
view your active list of services: systemctl list-unit-files | grep enabled
to view list of services failed to start: systemctl - -failed
3. configure firewalld-cmd
View Version: firewall-cmd --version
View help: firewall-cmd --help
display status: firewall-cmd --state
view all open ports: firewall-cmd --zone = public --list -ports
to update the firewall rules: firewall-cmd --reload
viewing area information: firewall-cmd --get-active- zones
Specifies an interface belongs: firewall-cmd --get-zone- of-interface = eth0
to reject all packets: firewall-cmd --panic -on
Unblock status: firewall-cmd --panic-off
to see if refused: firewall-cmd --query-panic

adding
firewall-cmd --zone = public --add- port = 80 / tcp --permanent (- permanent permanent, this argument does not fail after the restart)
reload
firewall-cmd --reload
view
firewall-cmd --zone = public --query- port = 80 / tcp
delete
firewall-cmd --zone = public --remove -port = 80 / tcp --permanent

发布了90 篇原创文章 · 获赞 7 · 访问量 2万+

Guess you like

Origin blog.csdn.net/qq_20282955/article/details/104281743