安装
yum install firewalld
使用
- 启动
systemctl start firewalld
- 关闭
systemctl stop firewalld
- 查看状态
systemctl status firewalld
- 开机启用
systemctl enable firewalld
- 开机禁用
systemctl disable firewalld
- 查看开方的端口
firewall-cmd --list-ports
- 添加端口
firewall-cmd --add-port=8080/tcp --permanent
firewall-cmd --reload
- 移除指定端口
firewall-cmd --permanent --remove-port=123/tcp
- 查询指定端口开放状态
firewall-cmd --query-port=666/tcp