Port conflict due to recent build environment , So summarize this article , I hope there is something wrong with it , Please point out , I'll correct it as soon as possible , Progress together .
View firewall status . The result is that running perhaps not running
stay running State , towards firewall Add ports that need to be opened :
such as ：
firewall-cmd --permanent --zone=public --add-port=80/tcp
So that external devices can access it 80 Port .
Reload configuration , Make a change ( Just added the port to be opened ) Effective .
firewall-cmd --reload // load configuration , Make the modification effective .
View open ports , appear 80/tcp This opens correctly ：
firewall-cmd --permanent --zone=public --list-ports
Common commands of firewall :
Command to turn on Firewall :
systemctl start firewalld.service
Command to close firewall :
systemctl stop firewalld.service
Start up automatically ：
systemctl enable firewalld.service
Turn off and start automatically :
systemctl disable firewalld.service
View firewall status :
systemctl status firewalld
Delete open ports :
After deleting the specified port , other ip You cannot access the port on this computer .
firewall-cmd --zone=public --remove-port=80/tcp --permanent firewall-cmd
--reload systemctl restart firewalld.service
Open assignment IP Access port ：
That is to say, the port can only be specified IP Visited :
firewall-cmd --permanent --add-rich-rule 'rule family=ipv4 source address=IP address
port port= port protocol=tcp accept' firewall-cmd --reload Loading takes effect