Configuration and Basic command explanation of firewall firewalld in Linux
Firewall Introduction:
The firewall in CentOS 7 is a powerful feature that has been upgraded in the Iptables firewall in CentOS 6.5.
I. Installation of FIREWALLD
# yum Install Firewalld Firewall-config
Centos7 default Installation Firewalld
Second, Firewalld service on, off, restart, status View
Start: # systemctl start Firewalld
View Status: # Systemctl status Firewalld or Firewall-cmd–state
Stop: # systemctl Disable FIREWALLD
Disabled: # Systemctl Stop Firewalld
Restart: #systemctl Restart Firewalld
third, open port
Permanently open ports required
sudo firewall-cmd--zone=public--add-port=80/tcp--permanent
sudo firewall-cmd--reload//Overload entry port settings just
Parameter introduction:
1, Firwall-cmd: Linux is provided by the operation of a firewall tool;
2 、--Permanent: The expression is set to persistent;
3 、--Add-port: Identify the added port;
Then check the new rules.
Firewall-cmd--list-all//View firewall rules, you can find the current open port information
firewalld Common commands:
1 2 3 4 5 6 7 8 9 10 11 12-13 |
Frequently used commands introduce Firewall-cmd--state # #查看防火墙状态, is running Firewall-cmd--reload # #重新载入配置, such as adding a rule, you need to execute this command firewall-cmd-- Get-zones # #列出支持的zone Firewall-cmd--get-services # #列出支持的服务, the service in the list is released Firewall-cmd--query-service FTP # #查看ftp服务是否支持 , return yes or no firewall-cmd--add-service=ftp # #临时开放ftp服务 firewall-cmd--add-service=ftp--permanent # #永久开放ftp服务 Firewall-cmd--remove-service=ftp--permanent # #永久移除ftp服务 firewall-cmd--add-port= 80/tcp--permanent # #永久添加80端口 Iptables-l-N # #查看规则, this command is the same man firewall-cmd as Iptables #查看帮助 |