一、背景说明
在当前数据中心网络架构中:
机房内部所有 node 节点位于统一的内部网络,通过默认 VRF 访问公网。而由于 AWS 上存在多个租户,租户之间的地址可能重叠,因此防火墙使用了 VRF 隔离 BGP 连接。为了简化 node 节点的配置,并避免将它们划入多个 VRF,防火墙通过 route-replicate
功能将全局路由表中的静态路由导入到指定租户的 VRF 中,实现租户对机房 node 节点的访问,而无需更改 node 本身的网关配置。
二、网络拓扑图
HCL模拟器图示:
三、配置目标
为每个 AWS 租户配置一个独立 VRF,通过 BGP 与 AWS 建立邻居关系。
启用
route-replicate
,将全局路由表中需要分配给各租户的node节点路由复制到各个VRF中。内网节点统一默认网关,无需复杂配置即可让 AWS 多租户和内网节点互访。
四、配置步骤
步骤1:创建 VRF 实例
#
ip vpn-instance vlan103
route-distinguisher 103:103
vpn-target 103:103 import-extcommunity
vpn-target 103:103 export-extcommunity
#
address-family ipv4
route-replicate from public protocol static route-policy Replicate_10.10.100.2
可根据实际添加多个租户 VRF 实例。
步骤2:配置对外接口绑定 VRF
#
interface Vlan-interface103
ip binding vpn-instance vlan103
ip address 100.1.103.2 255.255.255.252
步骤3:配置 BGP 多实例及策略
#
bgp 65000
#
ip vpn-instance vlan103
peer 100.1.103.1 as-number 65103
peer 100.1.103.1 password cipher $c$3$gyWCVMorqYfc7rv27atfXdPJ+olP4APTKu9HQokmxQ==
#
address-family ipv4 unicast
network 10.10.100.2 255.255.255.255
peer 100.1.103.1 enable
#
route-policy Replicate_10.10.100.2 permit node 10
if-match ip address prefix-list IP_10.10.100.2
#
ip prefix-list IP_10.10.100.2 index 10 permit 10.10.100.2 32
#
步骤4:配置路由复制
将租户 VRF 中的路由复制到全局路由表
route-replicate from public protocol static route-policy Replicate_10.10.100.2
public
表示复制到默认的全局路由表。
步骤5:验证路由复制效果
<FW>display ip routing-table
Destinations : 22 Routes : 22
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/0 Static 60 0 100.1.101.1 Vlan101
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
10.10.100.0/24 Static 60 0 10.10.255.2 GE1/0/2
10.10.100.2/32 Static 60 0 10.10.255.2 GE1/0/2
10.10.255.0/30 Direct 0 0 10.10.255.1 GE1/0/2
10.10.255.1/32 Direct 0 0 127.0.0.1 InLoop0
10.10.255.3/32 Direct 0 0 10.10.255.1 GE1/0/2
100.1.101.0/30 Direct 0 0 100.1.101.2 Vlan101
100.1.101.2/32 Direct 0 0 127.0.0.1 InLoop0
100.1.101.3/32 Direct 0 0 100.1.101.2 Vlan101
100.1.102.0/30 Direct 0 0 100.1.102.2 Vlan102
100.1.102.2/32 Direct 0 0 127.0.0.1 InLoop0
100.1.102.3/32 Direct 0 0 100.1.102.2 Vlan102
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
192.168.56.0/24 Direct 0 0 192.168.56.101 GE1/0/1
192.168.56.101/32 Direct 0 0 127.0.0.1 InLoop0
192.168.56.255/32 Direct 0 0 192.168.56.101 GE1/0/1
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
<FW>dis
<FW>display vp
<FW>display ip routing-table vp
<FW>display ip routing-table vpn-instance v
<FW>display ip routing-table vpn-instance vlan103
Destinations : 12 Routes : 12
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
10.10.100.2/32 Static 60 0 10.10.255.2 GE1/0/2
100.1.103.0/30 Direct 0 0 100.1.103.2 Vlan103
100.1.103.2/32 Direct 0 0 127.0.0.1 InLoop0
100.1.103.3/32 Direct 0 0 100.1.103.2 Vlan103
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
172.29.2.0/24 BGP 255 0 100.1.103.1 Vlan103
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
<FW>dis
<FW>display bgp
<FW>display bgp rou
<FW>display bgp routing-table vp
<FW>display bgp routing-table iv
<FW>display bgp routing-table ip
<FW>display bgp routing-table ipv4 vp
<FW>display bgp routing-table ipv4 vpn-instance v
<FW>display bgp routing-table ipv4 vpn-instance vlan103
Total number of routes: 2
BGP local router ID is 192.168.56.101
Status codes: * - valid, > - best, d - dampened, h - history,
s - suppressed, S - stale, i - internal, e - external
Origin: i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
* > 10.10.100.2/32 10.10.255.2 0 32768 i
* >e 172.29.2.0/24 100.1.103.1 0 0 65103i
确认路由从全局已复制到 VRF 中。
五、 配置完成后的效果
功能 | 是否达成 | 说明 |
默认 VRF 公网出口不变 | ✅ | 无需绑定 VRF 到公网接口 |
租户 VRF vlan103 可访问公网 | ✅ | 通过路由复制学习公网静态路由 |
多租户隔离保持 | ✅ | 各 VRF 独立路由表 |
BGP 可继续分发路由 | ✅ | 可用于 VPN 对接、ECMP |
六、总结
该方案通过 H3C 防火墙的 VRF + BGP + route-replicate
机制,实现:
多租户 AWS 网络互联;
VRF 隔离避免租户 IP 冲突;
内网节点统一配置,简化大规模部署和运维。