centos7 Firewalls are frequently used settings

1. Check the firewall status

systemctl list-unit-files|grep firewalld.service 或 systemctl status firewalld.service

2. Open

systemctl start firewalld.service

3. Stop

systemctl stop firewalld.service

4. Restart

systemctl restart firewalld.service

5. boot

systemctl enable firewalld.service

6. Never start the boot

systemctl disable firewalld.service

7. Check whether the boot from Kai

systemctl is-enabled firewalld.service;echo $?

8. enumerate all the boot from Kai Services

systemctl list-unit-files|grep enabled

9. Review the port has been opened

firewall-cmd --list-ports

10. Add the open port (firewall restart to take effect)

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

--zone Scope

--add - port add a port number

--permanent permanent, then restart the machine without fail


11. Restart the firewall

firewall-cmd --reload

12. Firewall running state

firewall-cmd --state

Guess you like

Origin www.cnblogs.com/xiaoyaojinzhazhadehangcheng/p/12156659.html