linux firewall firewall settings

background:

After the restart the computer room power failure shut down the machine, the original address to access can not access, use the terminal to access the server, after the service started up, with a curl + address can access, but not in an external browser to access the address;

First, think of a firewall port restrictions ----

Reference blog:  https://www.cnblogs.com/zxg-blog/p/9835263.html

 

1. Check whether to activate the firewall:

1 systemctl status firewalld

 

Figure:

active (running) to start the firewall state, inactive (dead) in a closed state

 

2. startup, shutdown and restart commands

1 service firewalld restart
2 service firewalld start
3 service firewalld stop

 

3. Remove the port (firewall needs to be performed in an open state)

. 1 Firewall-cmd = --permanent port number Port---add / TCP
 2 Firewall-cmd = --permanent port number Port---remove / tcp

 

4. Modify the restart to take effect

1 firewall-cmd --reload

Or 2 Restart

 

Access to change the address again, normal access page

 

Guess you like

Origin www.cnblogs.com/whycai/p/11490526.html