栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Centos7 防火墙配置

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Centos7 防火墙配置

CentOS 7.0默认使用的是firewall作为防火墙, 使用systemctl来管理服务和程序,包括了service和chkconfig
Centos6 使用的是iptables,Centos7 使用的是filewall
iptables 用于过滤数据包,属于网络层防火墙。
firewall 能够允许哪些服务可用,那些端口可用…属于更高一层的防火墙

参考

Centos7 防火墙配置
Linux系统安全Centos 7的Firewalld防火墙基础
Centos7 firewall防火墙常用配置

命令 firewall服务状态

systemctl status firewalld

firewall的状态

firewall-cmd --state

防火墙规则

firewall-cmd --list-all

开启、重启、关闭
# 开启
service firewalld start
# 重启
service firewalld restart
# 关闭
service firewalld stop
查询、开放、关闭
# 查询端口是否开放
firewall-cmd --query-port=8080/tcp
# 开放80端口
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=8080-8085/tcp
# 移除端口
firewall-cmd --permanent --remove-port=8080/tcp
# 查看防火墙的开放的端口
firewall-cmd --permanent --list-ports
#重启防火墙(修改配置后要重启防火墙)
firewall-cmd --reload


其他
systemctl enable firewalld #设置开机自动启动firewalld
systemctl disable firewalld #设置开机不自动启动firewalld
firewall-cmd --get-zones #查看防火墙预定义的区域
firewall-cmd --get-service #查看防火墙支持的预定义服务类型
firewall-cmd --get-default-zone #查看系统的默认区域
firewall-cmd --reload     #重载防火墙
firewall-cmd --get-active-zones #查看激活的区域
firewall-cmd --get-icmptypes #显示预定义的ICMP类型

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/940137.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号