Linux firewall open/close designated port

Linux firewall open/close designated port

  1. View firewall status

    firewall-cmd --state
    
  2. If it is running, specify the port that needs to be opened, which --permanetmeans permanent effect, if you don’t want it, you can leave it alone

    firewall-cmd --permanent --zone=public --add-port=8080/tcp
    
  3. Restart firewall

    firewall-cmd --reload 
    
  4. View open ports

    firewall-cmd --permanent --zone=public --list-ports
    

Guess you like

Origin blog.csdn.net/weixin_44829930/article/details/109010550