Centos7,配置防火墙,开启端口
1.查看已开放的端口(默认不开放任何端口)
firewall-cmd –list-ports
2.开启80端口
firewall-cmd –zone=public(作用域) –add-port=80/tcp(端口和访问类型) –permanent(永久生效)
3.重启防火墙
firewall-cmd –reload
4.停止防火墙
systemctl stop firewalld.service
5.禁止防火墙开机启动
systemctl disable firewalld.service
6.删除
firewall-cmd –zone= public –remove-port=80/tcp –permanent
lsof -i 查看端口占用
查看防火墙状态:systemctl status firewalld running即已开启
开始防火墙:systemctl start firewalld 没有任何提示即开启成功
关闭防火墙: systemctl stop firewalld
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/1553.html