1.查看状态
systemctl status firewalld.service
- 关闭
systemctl stop firewalld.service
- 开启
systemctl start firewalld.service
- 随系统启动
systemctl enable firewalld.service
- 开放80端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
systemctl stop firewalld.service
systemctl start firewalld.service
命令含义:
--zone #作用域
--add-port=80/tcp #添加端口,格式为:端口/通讯协议
--permanent #永久生效,没有此参数重启后失效
网友评论