Common commands for Linux firewall settings

Check firewall status: service firewalld status

 


 

Start the firewall: servicefirewalld start


 

Turn off the firewall: service firewalld stop


 

 

Restart the firewall:


 

 

Open port 80 :

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

 



 

Check port status: n etstat -tunlp


  

centos to check the port occupancy: netstat -anltup | grep 80

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325519871&siteId=291194637