1、開啟防火牆
firewall-cmd --state
systemctl start firewalld.service
systemctl enable firewalld.service
systemctl restart firewalld.service
firewall-cmd --state
systemctl is-enabled firewalld.service;echo $?
2、開啟埠開端口命令:firewall-cmd --zone=public --add-port=80/tcp --permanent
重啟防火牆:systemctl restart firewalld.service
檢視開啟的所有埠:firewall-cmd --list-ports
命令含義:
--zone #作用域
--add-port=80/tcp #新增埠,格式為:埠/通訊協議
--permanent #永久生效,沒有此引數重啟後失效
centos7開啟防火牆和開啟指定埠
1 開啟防火牆firewall cmd statesystemctl start firewalld.servicesystemctl enable firewalld.servicesystemctl restart firewalld.servicefirewall cmd statesyste...
centOs7開啟防火牆
1.檢視目前防火牆 firewall cmd list all2.開放3306埠。firewall cmd permanent add port 3306 tcp3.重啟防火牆 service firewalld restart4.檢視3306埠是否開放 firewall cmd query por...
CentOS7關閉 開啟防火牆
centos 7.0預設使用的是firewall作為防火牆,使用iptables必須重新設定一下 1 直接關閉防火牆 systemctl stop firewalld.service 停止firewall systemctl disable firewalld.service 禁止firewall開...