Centos7 open port

( 1) opening port status View

Queries have open ports netstat - ANP 
check whether the specified port has been opened Firewall -cmd --query-Port = 666 / tcp 
prompt yes, indicate on; no means is not turned on.

 

 


(2) View firewall status

Check firewall status 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

 


 

( 3) External port development

Adds 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

 

 

 

 


 

 

( 3) Removes the specified port

firewall-cmd --permanent --remove-port=123/tcp

 


Installation iptables -services:

iptables- install yum Services 
into the following directory to be modified:
 / etc / sysconfig / iptables

 

Guess you like

Origin www.cnblogs.com/snail90/p/11444438.html