firewalld Add / Remove Services service, port port

7, the firewall rule set to start CentOS / RHEL default by the firewalld service process management. 
Called firewall-cmd command-line client support and daemon communication to permanently modify firewall rules.
# Firewall-cmd --list-all- zones # View all zone information 

# firewall-cmd --get-default- zone # view the default zone which is a 

# firewall-cmd --zone = internal --change -zone = zone p3p1 # temporarily modify the interface p3p1 belongs Internal 

# Firewall-cmd --add-Service = HTTP # temporarily open HTTP 

# Firewall-cmd --permanent --add-Service = HTTP # permanently open HTTP 

# Firewall-cmd - zone = public --add-port = 80 / tcp --permanent # permanently open port 80 in the public 

# firewall-cmd --permanent --zone = public --remove-service = ssh # remove the service from the public Zone 

# firewall-cmd --reload # reload the configuration 
systemctl restart firewalld # restart firewalld service, enable the configuration / to be investigated

 

Example 2

 # Firewall-cmd --zone = public --add -port = 80 / tcp --permanent # 80 open port 

Command Meaning: 
--zone # scope 
--add-port = 80 / tcp # Add port, the format is: port / protocol 
--permanent # permanent, this argument does not restart after failure

 

Example 3

 1, View firewall status:   
$ firewall-cmd --state    
    # EG: running 

2 to view the firewall version:  
$ firewall-cmd --version  
    #eg: 0.4.3.2

Guess you like

Origin www.cnblogs.com/guarderming/p/11199701.html