赞
踩
# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor >
Active: inactive (dead)
Docs: man:firewalld(1)
# service firewalld start
Redirecting to /bin/systemctl start firewalld.service
# systemctl enable firewalld
systemctl status firewalld # 查看firewalld服务状态
systemctl enable firewalld # 设置firewalld服务开机启动
systemctl disable firewalld # 禁止firewalld服务开机启动
service firewalld start # 开启
service firewalld restart # 重启
service firewalld stop # 关闭
# firewall-cmd --state
running
# 查看防火墙规则 注意:ssh的22端口默认开启,且不在该列表中
firewall-cmd --list-all
# 开放某个端口 如80
firewall-cmd --permanent --add-port=80/tcp
# 开放某个范围内的端口 如10000-11000
firewall-cmd --permanent --add-port=10000-11000/tcp
# 移除某个端口 如80
firewall-cmd --permanent --remove-port=80/tcp
# 移除某个范围内的端口 如10000-11000
firewall-cmd --permanent --remove-port=10000-11000/tcp
# 添加或移除端口 需重新加载才能生效
firewall-cmd --reload
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。