firewall常用操作

2021-07-30 14:36:45 字數 959 閱讀 5191

1. 檢視firewall 狀態

systemctl status firewallsystemctl stop firewallsystemctl start firewallsystemctl restart firewall

2. 修改firewall增刪查埠資訊

## 新增埠3306firewall-cmd 

--zone

=public

--add

-port

=3306

/tcp

--permanent

## 重新裝置配置資訊,使新配置生效

firewall

-cmd

--reload

## 檢視埠3306是否被加到firewall名單中

firewall

-cmd

--zone

=public

--query

-port

=3306

/tcp

## 刪除埠3306

firewall

-cmd

--zone

=public

--remove

-port

=3306

/tcp

--permanent

歡迎關注

firewall 常用命令

關閉防火牆 systemctl stop firewalld.service 停止firewall systemctl disable firewalld.service 禁止firewall開機啟動 開啟埠 firewall cmd zone public add port 80 tcp perm...

firewall 常用命令 update

允許指定ip到指定埠 firewall cmd permanent add rich rule rule family ipv4 source address 192.168.x.x port protocol tcp port 8080 accept firewall cmd permanent ...

CentOS7 Firewall防火牆常用命令

開啟防火牆systemctl start firewalld.service關閉防火牆systemctl stop firewalld.service檢視防火牆狀態systemctl status firewalld.service開啟開機啟動防火牆systemctl enable firewall...