firewall-cmd --zone=
public
--add-port=
3306
/tcp --permanent # 開放5672埠
firewall-cmd --zone=
public
--remove-port=
3306
/tcp --permanent #關閉5672埠
firewall-cmd --reload # 配置立即生效
firewall-cmd --zone=
public
--list-ports
# 如果要開放的埠太多,嫌麻煩,可以關閉防火牆,安全性自行評估
ps:centos7預設沒有 netstat 命令,需要安裝 net-tools 工具,yum install -y net-tools
netstat -lnpt |
grep 3306
ps 1350
kill -9 1350
Centos7開放及檢視埠
1 開放埠 firewall cmd zone public add port 5672 tcp permanent 開放5672埠 firewall cmd zone public remove port 5672 tcp permanent 關閉5672埠 firewall cmd reload...
Centos7開放及檢視埠
1 開放埠 firewall cmd zone public add port 5672 tcp permanent 開放5672埠 firewall cmd zone public remove port 5672 tcp permanent 關閉5672埠 firewall cmd reload...
Centos7開放及檢視埠
1 開放埠 開放5672埠 firewall cmd zone public add port 5672 tcp permanent 關閉5672埠 firewall cmd zone public remove port 5672 tcp permanent 配置立即生效 firewall cmd...