centos防火墙操作
Centos防火墙(centos7及以上)
查看已经开放的端口:
firewall-cmd --list-ports
开放8080端口:
firewall-cmd --zone=public --add-port=8080/tcp --permanent
关闭8080端口:
firewall-cmd --zone=public --remove-port=8080/tcp --permanent
开启防火墙:
systemctl start firewalld
关闭防火墙:
firewall-cmd --reload #重启
firewall systemctl stop firewalld.service #停止
firewall systemctl disable firewalld.service #禁止开机启动