1. 程式人生 > >【linux】 --- centos7的防火牆firewalld

【linux】 --- centos7的防火牆firewalld

一、firewalld介紹

CentOS 7中防火牆是一個非常的強大的功能,在CentOS 6.5中在iptables防火牆中進行了升級了。

二、firewalld配置

1、系統配置目錄

/usr/lib/firewalld/services

2.使用者配置目錄

/etc/firewalld/

3.命令的方式新增埠

引數介紹

firewall-cmd --zone=public --permanent --add-port=8080/tcp

1、firewall-cmd:是Linux提供的操作firewall的一個工具;
2、--permanent:表示設定為持久;
3、--add-port:標識新增的埠;
4、--zone=public:指定的zone為public;

 

三、firewall常用命令

1、重啟、關閉、開啟、檢視狀態

service firewalld restart 重啟
service firewalld start 開啟
service firewalld stop 關閉
service firewalld status 檢視服務狀態
systemctl status firewall 

2.檢視firewalld狀態

firewalld -cmd --status

3.檢視防火牆規則

參考:  https://blog.csdn.net/xlgen157387/article/details/52672988