玩转华为ENSP模拟器系列 | 配置基于iBGP的PE和接入设备间路由交换

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

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

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


目标

配置基于iBGP的PE和接入侧设备间的路由交换

组网模型

配置思路

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

操作步骤

  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/0.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/1
 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

创建一个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

使能设备的MPLS LDP

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

配置CE与PE之间的iBGP路由交换

PE1:
bgp 65000
 ipv4-family vpn-instance test
  peer 10.0.0.2 as-number 65000
  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

创建一个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

使能设备的MPLS LDP

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

配置CE与PE之间的iBGP路由交换

PE2:
bgp 65000
 ipv4-family vpn-instance test
  peer 20.0.0.2 as-number 65000
  1. 配置节点CE1

配置eBGP邻居

CE1:
interface Ethernet1/0/0.1
 vlan-type dot1q 1
 ip address 10.0.0.2 255.255.255.0
bgp 65000
 peer 10.0.0.1 as-number 65000

创建Loopback10,将其路路由通告至BGP中

CE1:
interface LoopBack10
 ip address 30.1.1.1 255.255.255.255
bgp 100
 ipv4-family unicast
  network 30.1.1.1 255.255.255.255
  1. 配置节点CE2

配置eBGP邻居

CE2:
interface Ethernet1/0/0.1
 vlan-type dot1q 1
 ip address 20.0.0.2 255.255.255.0
bgp 65000
 peer 20.0.0.1 as-number 65000

创建Loopback10,将其路路由通告至BGP中

CE2:
interface LoopBack10
 ip address 40.1.1.1 255.255.255.255
bgp 100
 ipv4-family unicast
  network 40.1.1.1 255.255.255.255
  1. 配置验证

查看PE1的L3VPN实例的路由表

[~PE1-bgp]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 : 8        Routes : 8         
Destination/Mask    Proto   Pre  Cost        Flags NextHop         Interface
       10.0.0.0/24  Direct  0    0             D   10.0.0.1        Ethernet1/0/0
.1
       10.0.0.1/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/0
.1
     10.0.0.255/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/0
.1
       20.0.0.0/24  IBGP    255  0             RD  1.1.1.135       Ethernet1/0/1
       30.1.1.1/32  IBGP    255  0             RD  10.0.0.2        Ethernet1/0/0
.1
       40.1.1.1/32  IBGP    255  0             RD  1.1.1.135       Ethernet1/0/1
      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-bgp]

查看PE1的EVPN前缀路由表

[~PE1-bgp]dis bgp evpn all  routing-table prefix-route 
 Local AS number : 65000
 BGP Local router ID is 30.1.1.1
 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: 4
 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
 *>i   0:30.1.1.1:32                                          0.0.0.0
 *>i   0:40.1.1.1:32                                          1.1.1.135
 EVPN-Instance __RD_1_100_1__:
 Number of Ip Prefix Routes: 4
       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
 *>i   0:30.1.1.1:32                                          0.0.0.0
 *>i   0:40.1.1.1:32                                          1.1.1.135
[~PE1-bgp]  

查看PE2的L3VPN实例的路由表

[~PE2]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 : 8        Routes : 8         
Destination/Mask    Proto   Pre  Cost        Flags NextHop         Interface
       10.0.0.0/24  IBGP    255  0             RD  1.1.1.134       Ethernet1/0/0
       20.0.0.0/24  Direct  0    0             D   20.0.0.1        Ethernet1/0/1
.1
       20.0.0.1/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/1
.1
     20.0.0.255/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/1
.1
       30.1.1.1/32  IBGP    255  0             RD  1.1.1.134       Ethernet1/0/0
       40.1.1.1/32  IBGP    255  0             RD  20.0.0.2        Ethernet1/0/1
.1
      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
[~PE2]  

查看PE2的EVPN前缀路由表

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

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值