linux firewall status to view port status and opening up

1. Check the firewall status
         to view the status of the firewall systemctl status firewalld
         open the firewall systemctl start firewalld  
         turn off the firewall systemctl stop firewalld
         open the firewall service firewalld start 
         If they are unable to open the
         first use: systemctl unmask firewalld.service 
         then: systemctl start firewalld.service

2. Review of opening up port status
         inquiry has been open ports netstat -ntulp | grep port number: You can view a specific port number a
         query whether the specified port has opened firewall-cmd --query-port = 666 / tcp
           prompt yes, express open; no means is not turned on.

3. Development of external ports

       See if want to open the ports are open: firewall-cmd --query-port = 6379 / tcp
       add the specified ports need to be open: firewall-cmd --add-port = 123 / tcp --permanent
       port reloaded added: firewall-cmd --reload
       query whether the port open success: firewall-cmd --query-port = 123 / tcp
       Removes the specified port: firewall-cmd --permanent --remove-port = 123 / tcp

Guess you like

Origin www.cnblogs.com/qingchengshiguang/p/12101990.html