CentOS firewall operation commands
1. Check the firewall service status
|
Or check the status of the firewall:
1 |
|
2. Turn on and restart the firewall
Start firewall:
1 |
|
Set auto-start or disable at boot:
1 |
|
Restart the firewall:
1 |
|
3. Check the firewall settings to see if the auto-start is successful:
1 |
|
4. Turn off the firewall
Turn off running firewall
1 |
|
Permanently disable the firewall service and it will not be enabled next time you reboot.
1 |
|
5. Open a specific port
Take port 80 as an example
1 2 3 4 5 6 7 8 9 10 11 12 |
|
6. View all open ports
1 |
|
7. View firewall rules
1 |
|
8. Restrict access to only specified IPs (it can also be done without restrictions within the internal network, but cannot be accessed from the external network)
1 |
|
9. Remove this strategy
1 |
|
10. Reload
firewall-cmd --reload
reference:
Set to allow the specified port to pass through the firewall centos7_qq_40084534's blog-CSDN blog
https://www.cnblogs.com/xxoome/p/7115614.html
http://www.linuxcache.com/archives/3896
http://www.woniu.me/2017/12/08/CentOS7%E4%B9%8B%E9%98%B2%E7%81%AB%E5%A2%99(firewall)%E9%85%8D%E7%BD%AE.html