centos7 and centos6 firewall services

    Use the tool is not the same. Centos6 using iptables, Centos7 using filewall

    iptables for filtering data packets, belonging to the network layer firewalls.

    firewall can allow what services are available, those ports can be used ... belong to a higher level of firewall.

Since centos7 has come out, then use centos7

1, see the firewall service status

systemctl status firewalld

2, see the firewall status

firewall-cmd --state

 

3, turn on, restart, shut down, firewalld.service service

# Enable 
Service firewalld Start 
# Restart 
Service firewalld restart 
# close the 
service firewalld stop

4, see the firewall rules

firewall-cmd --list-all 

5, query, open and closed ports

Copy the code
# Query whether the port open 
Firewall-cmd --query-Port = 8080 / tcp
# 80 open ports
Firewall-cmd = --permanent --add-Port 80 / tcp
# remove port
firewall-cmd --permanent --remove- port = 8080 / tcp

# Restart firewall (Firewall modified configured to restart) 
firewall-cmd --reload
# of parameters 1, firwall-cmd: the operation is a tool provided for Linux firewall; 2, - Permanent: provided persistent represented; 3, - -add-port: the port identifier is added;

 

Guess you like

Origin www.cnblogs.com/fpcbk/p/12466596.html