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

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

前言:

Type5路由——IP前缀路由
在这里插入图片描述
该类型路由的IP Prefix Length和IP Prefix字段既可以携带主机IP地址,也可以携带网段地址:
•当携带主机IP地址时,该类型路由在VXLAN控制平面中的作用与IRB类型路由是一样的,主要用于分布式网关场景中的主机IP路由通告。
•当携带网段地址时,通过传递该类型路由,可以实现VXLAN网络中的主机访问外部网络。

1、拓扑图

在这里插入图片描述

2、配置

2.1互联网的ar路由互联

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

2.2创建vpn实例几三层vni

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

注意vpn-target是evpn

2.3 配置默认路由

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

2.4 evpn发布前缀路由type5

bgp 100 instance evpn1
 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 vpn-instance A
  default-route imported
  network 0.0.0.0
  import-route static
  advertise l2vpn evpn
#

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

整体配置

<CE03>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
#
evpn-overlay enable
#
ip vpn-instance A
 ipv4-family
  route-distinguisher 3:4
  vpn-target 10:10 export-extcommunity evpn
  vpn-target 10:10 import-extcommunity evpn
 vxlan vni 55
#

 ip binding vpn-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 evpn1
 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
 #
 l2vpn-family evpn
  undo policy vpn-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 vpn-instance A
  default-route imported
  network 0.0.0.0
  import-route static
  advertise l2vpn evpn
#
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 vpn-instance A 0.0.0.0 0.0.0.0 43.1.1.4
ip route-static vpn-instance A 11.1.1.0 255.255.255.0 43.1.1.4

3、验证

ce3上查看前缀路由

[~CE03]dis bgp instance evpn1 evpn 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
  <cr>             

[~CE03]dis bgp instance evpn1 evpn all routing-table  pr
[~CE03]dis bgp instance evpn1 evpn 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  vpn-instance A
Proto: Protocol        Pre: Preference
Route Flags: R - relay, D - download to fib, T - to vpn-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>

在这里插入图片描述

  • 5
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值