Firewall firewall command centos7 in the summary (easier to find)

1, the basic use of firewalld

Start: systemctl start firewalld

Close: systemctl stop firewalld

View status: systemctl status firewalld

Power disabled: systemctl disable firewalld

Power On: systemctl enable firewalld

2.systemctl is CentOS7 service management tool in the main tool before it blends service and chkconfig functions in one.

Start a service: systemctl start firewalld.service

Close a service: systemctl stop firewalld.service

Restart a service: systemctl restart firewalld.service

A status display services: systemctl status firewalld.service

Enable a service at boot: systemctl enable firewalld.service

At boot disable a service: systemctl disable firewalld.service

See if service startup: systemctl is-enabled firewalld.service large column  firewall firewall command under centos7 Summary (easier to find)

View your active list of services: systemctl list-unit-files | grep enabled

View a list of services failed to start: systemctl -failed

3. Configure firewalld-cmd

View Version: firewall-cmd -version

View help: firewall-cmd -help

Display state: firewall-cmd -state

View all open ports: firewall-cmd -zone = public -list-ports

Update firewall rules: firewall-cmd -reload

Viewing area information: firewall-cmd -get-active-zones

Specifies an interface belongs: firewall-cmd -get-zone-of-interface = eth0

Reject all packets: firewall-cmd -panic-on

Unblock status: firewall-cmd -panic-off

Check whether to reject: firewall-cmd -query-panic

Common Commands

Add Port

firewall-cmd -zone = public -add-port = 80 / tcp -permanent (-permanent permanent, this does not restart the failed parameter)

Reload

firewall-cmd –reload

View port

firewall-cmd –zone=public –query-port=80/tcp

Delete Port

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

View all open ports

firewall-cmd –zone=public –list-ports

Guess you like

Origin www.cnblogs.com/wangziqiang123/p/11711124.html