玩转华为ENSP模拟器系列 | 配置基于iBGP的PE和接入设备间路由交换
Posted COCOgsta
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了玩转华为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路由交换。
操作步骤
- 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
- 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
- 配置节点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
- 配置节点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
- 配置验证
查看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]
创作打卡挑战赛 赢取流量/现金/CSDN周边激励大奖
以上是关于玩转华为ENSP模拟器系列 | 配置基于iBGP的PE和接入设备间路由交换的主要内容,如果未能解决你的问题,请参考以下文章
玩转华为ENSP模拟器系列 | 配置基于接口划分VLAN示例
玩转华为ENSP模拟器系列 | 配置基于MAC地址划分VLAN示例
玩转华为ENSP模拟器系列 | 配置基于VLAN的二层协议透明传输示例
玩转华为ENSP模拟器系列 | 配置基于路由的IPSec VdPdNd(采用预共享密钥认证)