Liunx系统centos版防火墙常用命令
1.查询防火墙状态
firewall-cmd state
systemctl status firewalld.service
2.查看所有开放的端口
firewall-cmd --zone=public --list-ports
3.启用防火墙
systemctl start firewalld
4.停用防火墙
systemctl disable firewalld
5.禁用防火墙
systemmctl stop firewalld
6.更改刷新防火墙规则
firewall-cmd reload
7.防火墙端口常用操作
(1)添加
firewall-cmd --zone=public --add-port=80/tcp --permanent
(--permanent永久生效,没有此参数重启后失效)
(2)重新载入
firewall-cmd --reload
(3)查看
firewall-cmd --zone= public --query-port=80/tcp
(4)删除
firewall-cmd --zone= public --remove-port=80/tcp --permanent
网友评论