vxlan专题---第四章配置分布式网关部署方式的华为VXLAN示例-外部路由type5

本次华为vxlan实验采用eve-ng 5.0模拟器,使用华为CE12800、AR1000v、思科接入交换机两台。关于两个数据中心大二层互通、跨三层互通,已经在第二章和第三章讲解了。本次注意说明vxlan网络与非vxlan(互联网)如何互通。
1、ar100v模拟互联网区域
2、ce03作为spine和Border 作为外部引入,通告整个vlan中。

前言:

Type5路由——IP前缀路由
vxlan专题---第四章配置分布式网关部署方式的华为VXLAN示例-外部路由type5_第1张图片
该类型路由的IP Prefix Length和IP Prefix字段既可以携带主机IP地址,也可以携带网段地址:
•当携带主机IP地址时,该类型路由在VXLAN控制平面中的作用与IRB类型路由是一样的,主要用于分布式网关场景中的主机IP路由通告。
•当携带网段地址时,通过传递该类型路由,可以实现VXLAN网络中的主机访问外部网络。

1、拓扑图

vxlan专题---第四章配置分布式网关部署方式的华为VXLAN示例-外部路由type5_第2张图片

2、配置

2.1互联网的ar路由互联

inter g1/0/2  
 ip binding -instance A
 ip address 43.1.1.3 255.255.255.0
#

2.2创建实例几三层vni

ip -instance A  
 ipv4-family
  route-distinguisher 3:4
  -target 10:10 export-extcommunity e
  -target 10:10 import-extcommunity e
 vxlan vni 55
#

注意-target是e

2.3 配置默认路由

ip route-static -instance A 0.0.0.0 0.0.0.0 43.1.1.4
ip route-static -instance A 11.1.1.0 255.255.255.0 43.1.1.4

2.4 e发布前缀路由type5

bgp 100 instance e1
 router-id 3.3.3.3
 peer 1.1.1.1 as-number 100
 peer 1.1.1.1 connect-interface LoopBack0
 peer 2.2.2.2 as-number 100
 peer 2.2.2.2 connect-interface LoopBack0

 ipv4-family -instance A
  default-route imported
  network 0.0.0.0
  import-route static
  advertise l2 e
#

在bgp 族引入默认路由,并发布到e中。

整体配置

dis cu 
!Software Version V200R005C10SPC607B607
!Last configuration was updated at 2022-07-05 08:50:02+00:00
!Last configuration was saved at 2022-07-05 09:11:25+00:00
#
sysname CE03
#
device board 17 board-type CE-MPUB
device board 1 board-type CE-LPUE
#
e-overlay enable
#
ip -instance A
 ipv4-family
  route-distinguisher 3:4
  -target 10:10 export-extcommunity e
  -target 10:10 import-extcommunity e
 vxlan vni 55
#

 ip binding -instance A
 ip address 43.1.1.3 255.255.255.0
#

#               
interface LoopBack0
 ip address 3.3.3.3 255.255.255.255
#
interface Nve1
 source 3.3.3.3
#
interface NULL0
#
bgp 100 instance e1
 router-id 3.3.3.3
 peer 1.1.1.1 as-number 100
 peer 1.1.1.1 connect-interface LoopBack0
 peer 2.2.2.2 as-number 100
 peer 2.2.2.2 connect-interface LoopBack0
 #
 l2-family e
  undo policy -target
  peer 1.1.1.1 enable
  peer 1.1.1.1 reflect-client
  peer 2.2.2.2 enable
  peer 2.2.2.2 reflect-client
 #
 ipv4-family -instance A
  default-route imported
  network 0.0.0.0
  import-route static
  advertise l2 e
#
ospf 10 router-id 3.3.3.3
 area 0.0.0.0
  network 3.3.3.3 0.0.0.0
  network 13.1.1.3 0.0.0.0
  network 23.1.1.3 0.0.0.0
#
ip route-static -instance A 0.0.0.0 0.0.0.0 43.1.1.4
ip route-static -instance A 11.1.1.0 255.255.255.0 43.1.1.4

3、验证

ce3上查看前缀路由

[~CE03]dis bgp instance e1 e all routing-table  ?
  inclusive-route  Inclusive Multicast Route
  mac-route        MAC Advertisement Route
  peer             Peer routers
  prefix-route     IP-prefix routes
  statistics       Statistics of route
  |                Matching output
  >                Redirect the output to a file
  >>               Redirect the output to a file in append mode
               

[~CE03]dis bgp instance e1 e all routing-table  pr
[~CE03]dis bgp instance e1 e all routing-table  prefix-route 
 Local AS number : 100

 BGP Local router ID is 3.3.3.3
 Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
               h - history,  i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP, ? - incomplete

  
 EVPN address family:
  Number of Ip Prefix Routes: 3
 Route Distinguisher: 3:4
       Network(EthTagId/IpPrefix/IpPrefixLen)                 NextHop
 *>    0:0.0.0.0:0                                            0.0.0.0
 *                                                            0.0.0.0
 *>    0:11.1.1.0:24                                          0.0.0.0

   EVPN-Instance __RD_1_3_4__:
  
 Number of Ip Prefix Routes: 3
       Network(EthTagId/IpPrefix/IpPrefixLen)                 NextHop
 *>    0:0.0.0.0:0                                            0.0.0.0
 *                                                            0.0.0.0
 *>    0:11.1.1.0:24                                          0.0.0.0

ce1上查看路由

[~CE01]dis ip routing-table  -instance A
Proto: Protocol        Pre: Preference
Route Flags: R - relay, D - download to fib, T - to -instance, B - black hole route
------------------------------------------------------------------------------
Routing Table : A
         Destinations : 9        Routes : 9         

Destination/Mask    Proto   Pre  Cost        Flags NextHop         Interface

        0.0.0.0/0   IBGP    255  0             RD  3.3.3.3         VXLAN
       11.1.1.0/24  IBGP    255  0             RD  3.3.3.3         VXLAN
     172.16.1.0/24  Direct  0    0             D   172.16.1.254    Vbdif20
   172.16.1.254/32  Direct  0    0             D   127.0.0.1       Vbdif20
   172.16.1.255/32  Direct  0    0             D   127.0.0.1       Vbdif20
    192.168.1.0/24  Direct  0    0             D   192.168.1.254   Vbdif10
  192.168.1.254/32  Direct  0    0             D   127.0.0.1       Vbdif10
  192.168.1.255/32  Direct  0    0             D   127.0.0.1       Vbdif10
255.255.255.255/32  Direct  0    0             D   127.0.0.1       InLoopBack0
[~CE01]

pc测试

es from 11.1.1.1 icmp_seq=2 ttl=61 time=4.781 ms
84 bytes from 11.1.1.1 icmp_seq=3 ttl=61 time=5.231 ms
84 bytes from 11.1.1.1 icmp_seq=4 ttl=61 time=6.456 ms
84 bytes from 11.1.1.1 icmp_seq=5 ttl=61 time=5.092 ms
VPCS> trace  11.1.1.1
trace to 11.1.1.1, 8 hops max, press Ctrl+C to stop
1   192.168.1.254   13.446 ms  5.638 ms  3.441 ms
2     *  *  *
3   43.1.1.4   9.715 ms  5.565 ms  5.492 ms
4   *11.1.1.1   8.536 ms (ICMP type:3, code:3, Destination port unreachable)
VPCS> ping 11.1.1.1
84 bytes from 11.1.1.1 icmp_seq=1 ttl=61 time=7.009 ms
84 bytes from 11.1.1.1 icmp_seq=2 ttl=61 time=8.312 ms
84 bytes from 11.1.1.1 icmp_seq=3 ttl=61 time=6.321 ms
84 bytes from 11.1.1.1 icmp_seq=4 ttl=61 time=5.202 ms
84 bytes from 11.1.1.1 icmp_seq=5 ttl=61 time=6.477 ms
VPCS>

vxlan专题---第四章配置分布式网关部署方式的华为VXLAN示例-外部路由type5_第3张图片

你可能感兴趣的:(网络运维,分布式,华为,网络)