有的

如图,交换机的int vlan 10和防火墙的RAGG1.10处于同一网段,交换机的int vlan20、路由器的GE0/0以及防火墙的RAGG1.20处于同一网段。
现在客户需要实现如下需求:防火墙工作正常的时候,终端前往边界路由器的流量需要经过防火墙,但是当防火墙异常的时候,流量直接从交换机转发给防火墙。
在交换机和路由器上通过配置静态路由结合track NQA,使防火墙正常的时候路由指向防火墙,当防火墙出问题后,路由不再指向防火墙,直接在交换机转发。
防火墙配置:
interface Route-Aggregation1.10
ip address 192.168.10.1 255.255.255.0
vlan-type dot1q vid 10
#
interface Route-Aggregation1.20
ip address 192.168.20.1 255.255.255.0
vlan-type dot1q vid 20
#
interface GigabitEthernet1/0/0
port link-mode route
port link-aggregation group 1
#
interface GigabitEthernet1/0/1
port link-mode route
port link-aggregation group 1
#
security-zone name Trust
import interface Route-Aggregation1.10
#
security-zone name Untrust
import interface Route-Aggregation1.20
#
ip route-static 0.0.0.0 0 192.168.20.3
ip route-static 192.168.100.0 24 192.168.10.2
#
security-policy ip
rule 0 name permit-all
action pass
source-zone untrust
source-zone trust
source-zone local
destination-zone untrust
destination-zone trust
destination-zone local
交换机配置
track 1 nqa entry fw 1 reaction 1 //track nqa状态
#
nqa entry fw 1 //配置nqa,探测10.1是否可达,频率1秒(100厘秒),探测三次
type icmp-echo
destination ip 192.168.10.1
frequency 100
reaction 1 checked-element probe-fail threshold-type consecutive 3 action-type trigger-only
#
nqa schedule fw 1 start-time now lifetime forever //开启nqa探测
#
interface Bridge-Aggregation1
port link-type trunk
port trunk permit vlan 1 10 20
#
interface Vlan-interface10
ip address 192.168.10.2 255.255.255.0
#
interface Vlan-interface20
ip address 192.168.20.2 255.255.255.0
#
interface Vlan-interface100
ip address 192.168.100.1 255.255.255.0
#
interface GigabitEthernet1/0/1
port link-mode bridge
port link-type trunk
port trunk permit vlan 1 10 20
port link-aggregation group 1
#
interface GigabitEthernet1/0/2
port link-mode bridge
port link-type trunk
port trunk permit vlan 1 10 20
port link-aggregation group 1
#
ip route-static 0.0.0.0 0 192.168.10.1 track 1 //配置静态路由指向防火墙并调用track,当nqa探测失败的时候自动失效
ip route-static 0.0.0.0 0 192.168.20.3 preference 70 //配置浮动路由指向路由器,当上面的静态路由失效的时候生效
路由器配置
track 1 nqa entry fw 1 reaction 1 //track nqa状态
#
nqa entry fw 1 //配置nqa,探测20.1是否可达,频率1秒(100厘秒),探测三次
type icmp-echo
destination ip 192.168.20.1
frequency 100
reaction 1 checked-element probe-fail threshold-type consecutive 3 action-type trigger-only
#
nqa schedule fw 1 start-time now lifetime forever //开启nqa探测
#
interface LoopBack0 //模拟的外网地址
ip address 100.100.100.100 255.255.255.255
#
interface GigabitEthernet0/0
port link-mode route
ip address 192.168.20.3 255.255.255.0
#
ip route-static 192.168.100.0 24 192.168.20.1 track 1 //配置静态路由指向防火墙并调用track,当nqa探测失败的时候自动失效
ip route-static 192.168.100.0 24 192.168.20.2 preference 70 //配置浮动路由指向交换机,当上面的静态路由失效的时候生效
暂无评论
暂无评论
1acl advanced 3000
2 rule 10 permit ip source 192.168.10.0 0.0.0.255 destination any # 假设192.168.10.0是接入层网段1policy-based-route PBR_TO_FW permit node 10
2 if-match acl 3000
3 apply next-hop 10.1.1.2 # 假设10.1.1.2是防火墙与核心互联的接口IP1interface Vlan-interface 10 # 接入交换机的网关VLAN
2 ip policy-based-route PBR_TO_FW1# 假设 10.1.1.1 是核心交换机与防火墙互联的接口IP
2ip route-static 0.0.0.0 0 10.1.1.1 # 默认路由指向核心(去往互联网或其他区域)
3ip route-static 192.168.10.0 255.255.255.0 10.1.1.1 # 回程路由,指向核心1acl advanced 3000
2 rule 5 deny ip destination 10.2.0.0 0.0.255.255 # 拒绝去往核心直连的其他网段,防止环路
3 rule 10 permit ip source 192.168.10.0 0.0.0.255 destination anyundo ip fast-forwarding load-sharingG1/0/1.100)来区分引流和回流的流量。暂无评论
先把结论说清楚:
接入→核心→防火墙(旁挂)→核心 这种回流架构,H3C 标准做法是:核心上做 PBR(策略路由)把内网 VLAN 流量引到防火墙;防火墙回流量再查路由表回核心。下面给你一套可直接复制的完整配置(按 H3C V7 平台)。
一、组网(先对一下)
接入:所有 VLAN 网关在核心(三层)
核心 ↔ 防火墙:三层直连,同一段互联地址
需求:所有内网互访 + 上网流量都过防火墙过滤
二、规划示例(你替换成自己网段)
核心互联口:G1/0/3,IP 10.99.99.1/24
防火墙互联口:G1/0/1,IP 10.99.99.2/24
内网业务网段:192.168.1.0/24、192.168.2.0/24
核心所有业务 VLAN 接口下 调用 PBR
三、核心交换机配置(关键:PBR 引流)
1. 互联接口
bash
运行
interface GigabitEthernet 1/0/3
port link-mode route
ip address 10.99.99.1 255.255.255.0
2. ACL 匹配所有内网流量
bash
运行
acl advanced 3000
# 内网互访
rule permit ip source 192.168.1.0 0.0.0.255 destination 192.168.0.0 0.0.255.255
rule permit ip source 192.168.2.0 0.0.0.255 destination 192.168.0.0 0.0.255.255
# 内网去外网
rule permit ip source 192.168.1.0 0.0.0.255
rule permit ip source 192.168.2.0 0.0.0.255
quit
3. 策略路由(PBR),下一跳指向防火墙
bash
运行
policy-based-route FW_PBR permit node 10
if-match acl 3000
apply next-hop 10.99.99.2 # 防火墙互联口IP
quit
4. 所有业务 VLAN 接口下应用 PBR
bash
运行
interface Vlan-interface 10
ip address 192.168.1.254 255.255.255.0
policy-based-route FW_PBR
interface Vlan-interface 20
ip address 192.168.2.254 255.255.255.0
policy-based-route FW_PBR
5. 回程路由(防火墙回来的流量正常转发)
不需要特殊配置,正常路由表即可。
四、防火墙配置(放行 + 回路由)
1. 互联接口
bash
运行
interface GigabitEthernet 1/0/1
ip address 10.99.99.2 255.255.255.0
2. 安全域(Trust 放内网,Untrust 放外网 / 核心)
bash
运行
firewall zone trust
add interface GigabitEthernet 1/0/1
firewall zone untrust
add interface GigabitEthernet 1/0/2 # 接外网/核心上行
3. 放行策略(示例全放,生产按需收紧)
bash
运行
security-policy
rule name permit_all
source-zone trust
destination-zone untrust
action permit
rule name permit_internal
source-zone trust
destination-zone trust
action permit
4. 回程默认路由(回核心)
bash
运行
ip route-static 0.0.0.0 0.0.0.0 10.99.99.1
五、必须注意的坑(很关键)
不能在核心出接口(上行口)做 PBR,要在 VLAN 三层接口(入方向) 做,否则环路。
防火墙必须回程路由指向核心,否则流量有去无回。
所有 VLAN 接口都要应用 PBR,漏一个网段就绕过去了。
先测一个 VLAN,没问题再批量应用,避免全网断流。
建议加 Track + 静态路由 做故障回退:防火墙挂了,流量自动不引,直接走核心。
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论