素材来源:华为路由器配置指南
一边学习一边整理试验笔记,并与大家分享,侵权即删,谢谢支持!
附上汇总贴:玩转华为ENSP模拟器系列 | 合集_COCOgsta的博客-CSDN博客_ensp实验大全
目标
配置BGP的EVPN地址族以实现PE设备之间的EVPN前缀路由的传递
组网模型
配置思路
- 配置使能EVPN的基于IPv4的L3VPN实例。
- 配置静态路由使两台PE的Loopback地址互通。
- 创建一个BGP实例。
- 配置iBGP对等体。
- 配置基于IPv4的BGP-VPN。
- 使能BGP的EVPN地址族。
操作步骤
- 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
创建一个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和MPLS LDP
PE1:
mpls lsr-id 1.1.1.134
mpls
mpls ldp
interface Ethernet1/0/0
mpls
mpls ldp
- 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和MPLS LDP
PE2:
mpls lsr-id 1.1.1.135
mpls
mpls ldp
interface Ethernet1/0/0
mpls
mpls ldp
- 配置验证
查看L3VPN实例的路由表
[~PE1-Ethernet1/0/0]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-Ethernet1/0/0]
查看EVPN前缀路由表
[~PE1-Ethernet1/0/0] dis bgp evpn all routing-table prefix-route 0:20.0.0.0:24
BGP local router ID : 1.1.1.134
Local AS number : 65000
Total routes of Route Distinguisher(100:1): 1
BGP routing table entry information of 0:20.0.0.0:24:
Label information (Received/Applied): 48121/NULL
From: 1.1.1.135 (1.1.1.135)
Route Duration: 0d00h03m26s
Relay IP Nexthop: 100.0.0.2
Relay Tunnel Out-Interface: LDP LSP
Original nexthop: 1.1.1.135
Qos information : 0x0
Ext-Community: RT <100 : 1>
AS-path Nil, origin incomplete, MED 0, localpref 100, pref-val 0, valid, intern
al, best, select, pre 255
Route Type: 5 (Ip Prefix Route)
Ethernet Tag ID: 0, IP Prefix/Len: 20.0.0.0/24, ESI: 0000.0000.0000.0000.0000,
GW IP Address: 0.0.0.0
Not advertised to any peer yet
EVPN-Instance __RD_1_100_1__:
Number of Ip Prefix Routes: 1
BGP routing table entry information of 0:20.0.0.0:24:
Route Distinguisher: 100:1
Remote-Cross route
Label information (Received/Applied): 48121/NULL
From: 1.1.1.135 (1.1.1.135)
Route Duration: 0d00h03m26s
Relay Tunnel Out-Interface: LDP LSP
Original nexthop: 1.1.1.135
Qos information : 0x0
Ext-Community: RT <100 : 1>
AS-path Nil, origin incomplete, MED 0, localpref 100, pref-val 0, valid, intern
al, best, select, pre 255
Route Type: 5 (Ip Prefix Route)
Ethernet Tag ID: 0, IP Prefix/Len: 20.0.0.0/24, ESI: 0000.0000.0000.0000.0000,
GW IP Address: 0.0.0.0
Not advertised to any peer yet
[~PE1-Ethernet1/0/0]