systemctl start firewalld # 開啟防火牆
firewall-cmd --zone=public --add-port=8080/tcp --permanent # 放行指定單個埠
firewall-cmd --zone=public --add-port=3306/tcp --add-port=6379/tcp --permanent # 新增放行指定單個埠
firewall-cmd --reload # 生效新增的要放行的埠
firewall-cmd --list-ports # 檢視所有被放行的埠
firewall-cmd --zone=public --remove-port=8081/tcp --permanent # 取消指定一開放埠
# 開啟防火牆
systemctl start firewalld
# 這裡是多行注釋----------------
:----------------------------
# 重啟防火牆
firewall-cmd --reload
# 檢視埠號 檢視當前所有tcp埠
netstat -ntlp
# 檢視所有80埠使用情況
netstat -ntulp |grep 80
檢視埠號是否開啟,執行命令:
firewall-cmd --query-port=8080/tcp
# 關閉80埠
firewall-cmd --zone=public --remove-port=80/tcp --permanent
# 重啟防火牆
firewall-cmd --reload
centos7 firewall 防火牆 命令
出自 yum install firewalld 安裝firewalld 防火牆 systemctl start firewalld.service firewalld.service firewalld dynamic firewall daemon loaded loaded usr lib s...
CentOS7防火牆firewall命令
開啟防火牆 systemctl start firewalld關閉防火牆 systemctl stop firewall允許firewall開機啟動 systemctl enable firewalld禁止firewall開機啟動 systemctl disable firewalld檢視防火牆狀態...
Firewall防火牆開啟常見埠命令
安裝firewall命令 yum install firewalld firewalld config firewall開啟常見埠命令 firewall cmd zone public add port 80 tcp permanent firewall cmd zone public add po...