防火墙相关命令

启动

shell> systemctl start firewalld

停止

shell> systemctl stop firewalld

重启

shell> systemctl restart firewalld

允许开机自启

shell> systemctl enable firewalld

不允许自启

shell> systemctl disable firewalld

查看状态

firewall-cmd --state

查看开放端口

shell> firewall-cmd --list-ports

添加端口

shell> firewall-cmd --add-port=8080/tcp --permanent  

删除端口

shell> firewall-cmd --remove-port=8080/tcp --permanent  

重新加载

shell> firewall-cmd --reload    
posted @ 2023-01-18 13:55  xiaoovo  阅读(37)  评论(0)    收藏  举报