vrf 穿越小实验,仿华为云 vpc boder-fw 流量实现

 如图: vm3 ,vm4 分别在不同的vpc,

  访问互联网流量到boder(分别在vrf1/2),默认路由指向fw(vrf1/2),fw vrf1/2 的默认路由指回boder public,boder public 默认路由指向pe,引导流量访问互联网。回城流量,在boder public 上使用静态路由指回fw vrf1/2,fw vrf1/2 使用明细静态指向boder vrf1/2,经boder回到vm。
(华为硬sdn+openstack云环境中,流量回到boder后 通过bgp evpn 路由到达span,然后到达和vm相连的server-leaf ,再经ovs,linux bridge 到达vm)

  ( fw 会在出口 vlan 300 public 处做nat ,本实验忽略)

 vpc 互访:fw vrf1/2 不同vrf的下一跳。

  总之,vpc间或访问互联网流量均到达本vpc的boder和fw 后,做vrf间的泄露

 (vpc 内部所有流量虽然在不同leaf/span/fw 等,但evpn把他们打通了,可以视为一张脱离物理架构独立的一张网)

 step 1:

   根据拓扑的地址和vlan vrf 配置基础环境,vm/boder---- vrf1/2,     boder vrf1/2/public----fw vrf1/2/public , boder public----pe 可以互通。

 

boder 地址:

interface GigabitEthernet0/0/0.10
 dot1q termination vid 10
 ip binding vpn-instance 1
 ip address 10.0.10.2 255.255.255.0 
 arp broadcast enable
#
interface GigabitEthernet0/0/0.20
 dot1q termination vid 20
 ip binding vpn-instance 2
 ip address 10.0.20.2 255.255.255.0 
 arp broadcast enable
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/1.100
 dot1q termination vid 100
 ip binding vpn-instance 1
 ip address 10.1.10.2 255.255.255.0 
 arp broadcast enable
#
interface GigabitEthernet0/0/1.200        
 dot1q termination vid 200
 ip binding vpn-instance 2
 ip address 10.1.20.2 255.255.255.0 
 arp broadcast enable
#
interface GigabitEthernet0/0/1.300
 dot1q termination vid 300
 ip address 100.1.10.2 255.255.255.0 
 arp broadcast enable
#
interface GigabitEthernet0/0/2
 ip address 100.0.10.2 255.255.255.0 
#

fw 地址:
#
interface GigabitEthernet0/0/0.100
 dot1q termination vid 100
 ip binding vpn-instance 1
 ip address 10.1.10.1 255.255.255.0 
 arp broadcast enable
#
interface GigabitEthernet0/0/0.200
 dot1q termination vid 200
 ip binding vpn-instance 2
 ip address 10.1.20.1 255.255.255.0 
 arp broadcast enable
#
interface GigabitEthernet0/0/0.300
 dot1q termination vid 300
 ip address 100.1.10.1 255.255.255.0 
 arp broadcast enable

vm 和pe 地址配置略

step 2: 通往 pe

  配置默认路由
  vm 默认路由指向boder vrf 1/2,pe 设置回城路由  。略

  boder vrf 1/2/public 设置静态默认路由

ip route-static 0.0.0.0 0.0.0.0 100.0.10.5
ip route-static vpn-instance 2 0.0.0.0 0.0.0.0 10.1.20.1
ip route-static vpn-instance 1 0.0.0.0 0.0.0.0 10.1.10.1

  fw 配置默认路由

ip route-static vpn-instance 1 0.0.0.0 0.0.0.0 GigabitEthernet0/0/0.300 100.1.10.2
ip route-static vpn-instance 2 0.0.0.0 0.0.0.0 GigabitEthernet0/0/0.300 100.1.10.2

  boder public 配置回城路由

ip route-static 10.0.10.0 255.255.255.0 vpn-instance 1 10.1.10.1
ip route-static 10.0.20.0 255.255.255.0 vpn-instance 2 10.1.20.1

  fw irf1/2 配置回城明细

[fw]ip route-s vpn-instance 1 10.0.10.0 24 10.1.10.2
[fw]ip route-s vpn-instance 2 10.0.20.0 24 10.1.20.2

测试:

[vm3]ping 100.0.10.5
  PING 100.0.10.5: 56  data bytes, press CTRL_C to break
    Reply from 100.0.10.5: bytes=56 Sequence=1 ttl=252 time=80 ms
    Reply from 100.0.10.5: bytes=56 Sequence=2 ttl=252 time=50 ms

  [vm3]tracert 100.0.10.5
 traceroute to  100.0.10.5(100.0.10.5), max hops: 30 ,packet length: 40,press CTRL_C to break
 1 10.0.10.2 60 ms  40 ms  40 ms       (到达boder vrf1 )
 2 10.1.10.1 40 ms  50 ms  50 ms   (到达fw vrf 1)
 3 100.1.10.2 60 ms  40 ms  50 ms   (回到boder vrf public)
 4 100.0.10.5 60 ms  70 ms  70 ms   (到达pe)

 

step 3: vpc 互访

  fw:

  ip route-static vpn-instance 1 10.0.20.0 255.255.255.0 vpn-instance 2 10.1.20.2      

  ip route-static vpn-instance 2 10.0.10.0 255.255.255.0 vpn-instance 1 10.1.10.2

测试:

 <vm3>ping 10.0.20.4
  PING 10.0.20.4: 56  data bytes, press CTRL_C to break
    Reply from 10.0.20.4: bytes=56 Sequence=1 ttl=252 time=100 ms
    Reply from 10.0.20.4: bytes=56 Sequence=2 ttl=252 time=90 ms

<vm3>tracert 10.0.20.4
 traceroute to  10.0.20.4(10.0.20.4), max hops: 30 ,packet length: 40,press CTRL_C to break
 1 10.0.10.2 50 ms  50 ms  50 ms  (到达boder vrf1
 2 10.1.10.1 40 ms  40 ms  40 ms   (到达fw vrf 1
 3 10.1.20.2 50 ms  30 ms  80 ms   (回到boder vrf2
 4 10.0.20.4 90 ms  90 ms  90 ms     

posted @ 2020-12-19 20:46  abel2020  阅读(1388)  评论(0编辑  收藏  举报