玩转华为ENSP模拟器系列 | 配置BGP EVPN

素材来源:华为路由器配置指南

一边学习一边整理试验笔记,并与大家分享,侵权即删,谢谢支持!

附上汇总贴:玩转华为ENSP模拟器系列 | 合集_COCOgsta的博客-CSDN博客_ensp实验大全


目标

配置BGP的EVPN地址族以实现PE之间的EVPN前缀路由的传递

组网模型

配置思路

  • 配置使能EVPN的基于IPv4的L3VPN实例。
  • 配置静态路由使两台PE的Loopback地址互通。
  • 两台PE间启用MPLS和MPLS LDP
  • 创建一个BGP实例。
  • 配置iBGP对等体。
  • 配置基于IPv4的BGP-VPN。
  • 使能BGP的EVPN地址族。

操作步骤

  1. PE1节点配置

配置使能EVPN的基于IPv4的L3VPN实例

PE1:
ip vpn-instance test
 ipv4-family
  route-distinguisher 100:1
  apply-label per-instance
  vpn-target 100:1 export-extcommunity evpn
  vpn-target 100:1 import-extcommunity evpn
  evpn mpls routing-enable
interface Ethernet1/0/1.1
 vlan-type dot1q 1
 ip binding vpn-instance test
 ip address 10.0.0.1 255.255.255.0

配置静态路由使两台PE的Loopback地址互通

PE1:
interface LoopBack1
 ip address 1.1.1.134 255.255.255.255
interface Ethernet1/0/0
 ip address 100.0.0.1 255.255.255.0
ip route-static 1.1.1.135 255.255.255.255 100.0.0.2

启用MPLS和MPLS LDP

PE1:
mpls lsr-id 1.1.1.134
mpls
mpls ldp
interface Ethernet1/0/0
 mpls
 mpls ldp

创建一个BGP实例

PE1:
bgp 65000

配置iBGP对等体

PE1:
bgp 65000
 peer 1.1.1.135 as-number 65000
 peer 1.1.1.135 connect-interface LoopBack1

配置基于IPv4的BGP-VPN

PE1:
bgp 65000
 ipv4-family vpn-instance test
  import-route direct
  advertise l2vpn evpn

使能BGP的EVPN地址族

PE1:
bgp 65000
 l2vpn-family evpn
  peer 1.1.1.135 enable
  1. PE2节点配置

配置使能EVPN的基于IPv4的L3VPN实例

PE2:
ip vpn-instance test
 ipv4-family
  route-distinguisher 100:1
  apply-label per-instance
  vpn-target 100:1 export-extcommunity evpn
  vpn-target 100:1 import-extcommunity evpn
  evpn mpls routing-enable
interface Ethernet1/0/1.1
 vlan-type dot1q 1
 ip binding vpn-instance test
 ip address 20.0.0.1 255.255.255.0

配置静态路由使两台PE的Loopback地址互通

PE2:
interface LoopBack1
 ip address 1.1.1.135 255.255.255.255
interface Ethernet1/0/0
 ip address 100.0.0.2 255.255.255.0
ip route-static 1.1.1.134 255.255.255.255 100.0.0.1

启用MPLS和MPLS LDP

PE2:
mpls lsr-id 1.1.1.135
mpls
mpls ldp
interface Ethernet1/0/0
 mpls
 mpls ldp

创建一个BGP实例

PE2:
bgp 65000

配置iBGP对等体

PE2:
bgp 65000
 peer 1.1.1.134 as-number 65000
 peer 1.1.1.134 connect-interface LoopBack1

配置IPv4的BGP-VPN

PE2:
bgp 65000
 ipv4-family vpn-instance test
  import-route direct
  advertise l2vpn evpn

使能BGP的EVPN地址族

PE2:
bgp 65000
 l2vpn-family evpn
  peer 1.1.1.134 enable
  1. 配置验证

查看L3VPN实例的路由表

[~PE1]dis ip routing-table vpn-instance test
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole
 route
------------------------------------------------------------------------------
Routing Table : test
         Destinations : 6        Routes : 6         
Destination/Mask    Proto   Pre  Cost        Flags NextHop         Interface
       10.0.0.0/24  Direct  0    0             D   10.0.0.1        Ethernet1/0/1
.1
       10.0.0.1/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/1
.1
     10.0.0.255/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/1
.1
       20.0.0.0/24  IBGP    255  0             RD  1.1.1.135       Ethernet1/0/0
      127.0.0.0/8   Direct  0    0             D   127.0.0.1       InLoopBack0
255.255.255.255/32  Direct  0    0             D   127.0.0.1       InLoopBack0
[~PE1]

查看EVPN前缀路由表

[~PE1]dis bgp evpn all routing-table prefix-route 
 Local AS number : 65000
 BGP Local router ID is 1.1.1.134
 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: 2
 Route Distinguisher: 100:1
       Network(EthTagId/IpPrefix/IpPrefixLen)                 NextHop
 *>    0:10.0.0.0:24                                          0.0.0.0
 *>i   0:20.0.0.0:24                                          1.1.1.135
 EVPN-Instance __RD_1_100_1__:
 Number of Ip Prefix Routes: 2
       Network(EthTagId/IpPrefix/IpPrefixLen)                 NextHop
 *>    0:10.0.0.0:24                                          0.0.0.0
 *>i   0:20.0.0.0:24                                          1.1.1.135
[~PE1]

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值