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     


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM