没有合适的资源?快使用搜索试试~ 我知道了~
firewalld防火墙实操
需积分: 29 12 下载量 139 浏览量
2018-09-19
11:46:56
上传
评论 1
收藏 1KB TXT 举报
温馨提示
试读
2页
firewalld防火墙实际操作,介绍一些常用的firewalld设置规则。
资源推荐
资源详情
资源评论
开通配置:
#允许所有IP访问80-88端口:
firewall-cmd --zone=public --add-port=20400/tcp --permanent #开通80-88的端口
#允许10.2.211.0网段访问20400端口:
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.2.211.0/24" port protocol="tcp" port="20400" accept"
#允许192.168.10.0网段访问所有端口:
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.10.0/24" accept"
#允许221.174.127.122访问20082端口:
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="221.174.127.122" port protocol="tcp" port="20082" accept"
删除配置:
#关闭2000-3000端口的访问:
firewall-cmd --zone=public --remove-port=20400/tcp --permanent
#删除一条规则
firewall-cmd --remove-rich-rule="rule family="ipv4" source address="61.236.64.106" drop"
禁止配置:
#禁止192.168.1.24 IP防问:
firewall-cmd --permanent --zone=public --add-rich-rule="rule family=ipv4 source address='192.168.1.24' drop"
其它特殊配置:
#把bond0网卡加入到pubilc区域:
firewall-cmd --zone=pubilc --add-interface=bond0
#keepalived心跳同步要开vrrp协议:
firewall-cmd --direct --permanent --add-rule ipv4 filter INPUT 0 --in-interface bond1 --destination 224.0.0.18 --protocol vrrp -j ACCEPT
#允许所有IP访问80-88端口:
firewall-cmd --zone=public --add-port=20400/tcp --permanent #开通80-88的端口
#允许10.2.211.0网段访问20400端口:
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.2.211.0/24" port protocol="tcp" port="20400" accept"
#允许192.168.10.0网段访问所有端口:
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.10.0/24" accept"
#允许221.174.127.122访问20082端口:
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="221.174.127.122" port protocol="tcp" port="20082" accept"
删除配置:
#关闭2000-3000端口的访问:
firewall-cmd --zone=public --remove-port=20400/tcp --permanent
#删除一条规则
firewall-cmd --remove-rich-rule="rule family="ipv4" source address="61.236.64.106" drop"
禁止配置:
#禁止192.168.1.24 IP防问:
firewall-cmd --permanent --zone=public --add-rich-rule="rule family=ipv4 source address='192.168.1.24' drop"
其它特殊配置:
#把bond0网卡加入到pubilc区域:
firewall-cmd --zone=pubilc --add-interface=bond0
#keepalived心跳同步要开vrrp协议:
firewall-cmd --direct --permanent --add-rule ipv4 filter INPUT 0 --in-interface bond1 --destination 224.0.0.18 --protocol vrrp -j ACCEPT
资源评论
狼之传说
- 粉丝: 4
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功