Centos7.5 firewalld firewall configuration

CentOS 7.0 is the default firewall as a firewall

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

Linux # view which programs are using the Internet

firewall-cmd --permanent --list-services ssh dhcpv6-client

# Enable
Service firewalld Start
# restart
service firewalld restart


# Disable
Service firewalld STOP
4, View firewall rule

firewall-cmd --list-all

 

Stop firewall

systemctl stop firewalld.service

Prohibit firewall boot

systemctl disable firewalld.service


5, query, open and closed ports

# Query port is open
firewall-cmd --query-port = 8080 / tcp


# Open port 80
Firewall --permanent --add-Port-cmd = 80 / TCP
Firewall-cmd --permanent --add-Port = 8080-8085 / TCP


# Removal port
firewall-cmd --permanent --remove-port = 8080 / tcp
view of open firewall ports
firewall-cmd --permanent --list-ports

# Restart the firewall (firewall to restart after configuration changes)
Firewall-cmd --reload


# Of parameters
1, firwall-cmd: the operation is a tool provided for Linux firewall;
2, - Permanent: provided persistent represented;
. 3, - the Add-Port: port identification added;

 

Guess you like

Origin www.cnblogs.com/hiit/p/11463447.html