配置EVPN L3VPNv6 H-VPN示例
本例介绍通过部署EVPN L3VPNv6 H-VPN功能实现网络互通。
组网需求
当前IP承载网络一般使用L3VPN(HVPN)和L2VPN协议承载二三层业务,协议复杂度较高。由于EVPN协议可以同时承载二三层业务,为了简化IP承载网络的业务承载协议,因此很多IP承载网络将会演进为EVPN协议,其中对于承载IPv6三层业务的L3VPNv6 HVPN功能需要演进为EVPN L3VPNv6 HVPN功能。如图12-79所示,UPE和SPE之间为接入层网络,SPE和NPE之间为汇聚层网络,接入层网络和汇聚层网络分别部署独立IGP协议实现各自网络层的互通,然后部署EVPN L3VPNv6 H-VPN实现网络的端到端互通。在EVPN L3VPNv6 H-VPN网络中,UPE作为反射器的SPE的客户端,接收SPE反射的明细路由,这样更加便于对路由管理和流量转发进行控制。
配置思路
采用如下的思路进行配置:
UPE和SPE之间、SPE和NPE之间部署IGP协议,本例分别使用OSPF和IS-IS。
UPE、SPE和NPE上配置MPLS LDP功能。
在UPE和NPE上创建VPN实例。
在UPE和NPE上配置接入侧接口绑定VPN实例。
在UPE和SPE之间、SPE和NPE之间配置BGP EVPN功能。
在SPE上配置UPE为BGP EVPN路由反射器客户端,并配置向对等体发布BGP EVPN路由修改下一跳。
数据准备
为完成此配置例,需准备如下的数据:
UPE、SPE及NPE上的MPLS LSR-ID分别为1.1.1.1、2.2.2.2和3.3.3.3。
VPN实例名称为vpn1,RD为100:1。
VPN实例的收发路由属性VPN-Target为2:2。
操作步骤
- 配置UPE、SPE和NPE的IP地址及Loopback接口的地址
配置各接口的IP地址和掩码,具体配置过程请参考配置文件。
- UPE和SPE之间、SPE和NPE之间部署IGP协议,本例分别使用OSPF和IS-IS
具体配置过程请参考配置文件。
- 配置UPE、SPE和NPE的MPLS LDP功能
具体配置过程请参考配置文件。
- 在UPE和NPE上创建VPN实例
# 配置UPE。
[~UPE] ip vpn-instance vpn1
[*UPE-vpn-instance-vpn1] ipv6-family
[*UPE-vpn-instance-vpn1-af-ipv6] route-distinguisher 100:1
[*UPE-vpn-instance-vpn1-af-ipv6] vpn-target 2:2 both evpn
[*UPE-vpn-instance-vpn1-af-ipv6] evpn mpls routing-enable
[*UPE-vpn-instance-vpn1-af-ipv6] quit
[*UPE-vpn-instance-vpn1] quit
[*UPE] commit
# 配置NPE。
[~NPE] ip vpn-instance vpn1
[*NPE-vpn-instance-vpn1] ipv6-family
[*NPE-vpn-instance-vpn1-af-ipv6] route-distinguisher 100:1
[*NPE-vpn-instance-vpn1-af-ipv6] vpn-target 2:2 both evpn
[*NPE-vpn-instance-vpn1-af-ipv6] evpn mpls routing-enable
[*NPE-vpn-instance-vpn1-af-ipv6] quit
[*NPE-vpn-instance-vpn1] quit
[*NPE] commit
- 在UPE和NPE上配置接入侧接口绑定VPN实例
# 配置UPE。
[~UPE] interface GigabitEthernet 2/0/0
[*UPE-GigabitEthernet2/0/0] ip binding vpn-instance vpn1
[*UPE-GigabitEthernet2/0/0] ipv6 enable
[*UPE-GigabitEthernet2/0/0] ipv6 address 2001:DB8:20::1 64
[*UPE-GigabitEthernet2/0/0] quit
[*UPE] commit
# 配置NPE。
[~NPE] interface GigabitEthernet 2/0/0
[*NPE-GigabitEthernet2/0/0] ip binding vpn-instance vpn1
[*NPE-GigabitEthernet2/0/0] ipv6 enable
[*NPE-GigabitEthernet2/0/0] ipv6 address 2001:DB8:30::1 64
[*NPE-GigabitEthernet2/0/0] quit
[*NPE] commit
- 在UPE和SPE之间、SPE和NPE之间配置BGP EVPN功能
# 配置UPE。
[~UPE] bgp 100
[*UPE-bgp] peer 2.2.2.2 as-number 100
[*UPE-bgp] peer 2.2.2.2 connect-interface LoopBack1
[*UPE-bgp] l2vpn-family evpn
[*UPE-bgp-af-evpn] peer 2.2.2.2 enable
[*UPE-bgp-af-evpn] quit
[*UPE-bgp] ipv6-family vpn-instance vpn1
[*UPE-bgp-6-vpn1] advertise l2vpn evpn
[*UPE-bgp-6-vpn1] import-route direct
[*UPE-bgp-6-vpn1] quit
[*UPE-bgp] quit
[*UPE] commit
# 配置SPE。
[~SPE] bgp 100
[*SPE-bgp] peer 1.1.1.1 as-number 100
[*SPE-bgp] peer 1.1.1.1 connect-interface LoopBack1
[*SPE-bgp] peer 3.3.3.3 as-number 100
[*SPE-bgp] peer 3.3.3.3 connect-interface LoopBack1
[*SPE-bgp] l2vpn-family evpn
[*SPE-bgp-af-evpn] peer 1.1.1.1 enable
[*SPE-bgp-af-evpn] peer 3.3.3.3 enable
[*SPE-bgp-af-evpn] quit
[*SPE-bgp] quit
[*SPE] commit
# 配置NPE。
[~NPE] bgp 100
[*NPE-bgp] peer 2.2.2.2 as-number 100
[*NPE-bgp] peer 2.2.2.2 connect-interface LoopBack1
[*NPE-bgp] l2vpn-family evpn
[*NPE-bgp-af-evpn] peer 2.2.2.2 enable
[*NPE-bgp-af-evpn] quit
[*NPE-bgp] ipv6-family vpn-instance vpn1
[*NPE-bgp-6-vpn1] advertise l2vpn evpn
[*NPE-bgp-6-vpn1] import-route direct
[*NPE-bgp-6-vpn1] quit
[*NPE-bgp] quit
[*NPE] commit
- 在SPE上配置UPE为BGP EVPN路由反射器客户端,并配置向对等体发布BGP EVPN路由修改下一跳
# 配置SPE。
[~SPE] bgp 100
[*SPE-bgp] l2vpn-family evpn
[*SPE-bgp-af-evpn] peer 1.1.1.1 reflect-client
[*SPE-bgp-af-evpn] peer 1.1.1.1 next-hop-local
[*SPE-bgp-af-evpn] peer 3.3.3.3 reflect-client
[*SPE-bgp-af-evpn] peer 3.3.3.3 next-hop-local
[*SPE-bgp-af-evpn] quit
[*SPE-bgp] quit
[*SPE] commit
- 验证配置结果
在NPE和UPE设备上执行display bgp evpn all routing-table命令,可以看到从远端收到的EVPN路由信息。以NPE为例:
[~NPE] display bgp evpn all routing-table
Local AS number : 100 BGP Local router ID is 10.2.1.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: 2 Route Distinguisher: 100:1 Network(EthTagId/IpPrefix/IpPrefixLen) NextHop *>i 0:[2001:DB8:20::]:64 2.2.2.2 *> 0:[2001:DB8:30::]:64 0.0.0.0
在NPE和UPE上执行display ipv6 routing-table vpn-instance vpn1命令可查看到从远端收到的私网路由信息。以NPE为例:
[~NPE] display ipv6 routing-table vpn-instance vpn1
Routing Table : vpn1 Destinations : 4 Routes : 4 Destination : 2001:DB8:20:: PrefixLength : 64 NextHop : ::FFFF:2.2.2.2 Preference : 255 Cost : 0 Protocol : IBGP RelayNextHop : ::FFFF:10.2.1.1 TunnelID : 0x0000000001004c4b42 Interface : GigabitEthernet1/0/0 Flags : RD Destination : 2001:DB8:30:: PrefixLength : 64 NextHop : 2001:DB8:30::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet2/0/0 Flags : D Destination : 2001:DB8:30::1 PrefixLength : 128 NextHop : ::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet2/0/0 Flags : D Destination : FE80:: PrefixLength : 10 NextHop : :: Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : NULL0 Flags : DB
配置文件
UPE的配置文件
# sysname UPE # ip vpn-instance vpn1 ipv6-family route-distinguisher 100:1 apply-label per-instance vpn-target 2:2 export-extcommunity evpn vpn-target 2:2 import-extcommunity evpn evpn mpls routing-enable # mpls lsr-id 1.1.1.1 # mpls # mpls ldp # interface GigabitEthernet1/0/0 undo shutdown ip address 10.1.1.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet2/0/0 undo shutdown ip binding vpn-instance vpn1 ipv6 enable ipv6 address 2001:DB8:20::1/64 # interface LoopBack1 ip address 1.1.1.1 255.255.255.255 # bgp 100 peer 2.2.2.2 as-number 100 peer 2.2.2.2 connect-interface LoopBack1 # ipv4-family unicast undo synchronization peer 2.2.2.2 enable # ipv6-family vpn-instance vpn1 import-route direct advertise l2vpn evpn # l2vpn-family evpn undo policy vpn-target peer 2.2.2.2 enable # ospf 1 area 0.0.0.0 network 1.1.1.1 0.0.0.0 network 10.1.1.0 0.0.0.255 # return
SPE的配置文件
# sysname SPE # mpls lsr-id 2.2.2.2 # mpls # mpls ldp # isis 1 network-entity 10.0000.0000.0002.00 # interface GigabitEthernet1/0/0 undo shutdown ip address 10.1.1.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet2/0/0 undo shutdown ip address 10.2.1.1 255.255.255.0 isis enable 1 mpls mpls ldp # interface LoopBack1 ip address 2.2.2.2 255.255.255.255 isis enable 1 # bgp 100 peer 1.1.1.1 as-number 100 peer 1.1.1.1 connect-interface LoopBack1 peer 3.3.3.3 as-number 100 peer 3.3.3.3 connect-interface LoopBack1 # ipv4-family unicast undo synchronization peer 1.1.1.1 enable peer 3.3.3.3 enable # l2vpn-family evpn undo policy vpn-target peer 1.1.1.1 enable peer 1.1.1.1 reflect-client peer 1.1.1.1 next-hop-local peer 3.3.3.3 enable peer 3.3.3.3 reflect-client peer 3.3.3.3 next-hop-local # ospf 1 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 10.1.1.0 0.0.0.255 # return
NPE的配置文件
# sysname NPE # ip vpn-instance vpn1 ipv6-family route-distinguisher 100:1 apply-label per-instance vpn-target 2:2 export-extcommunity evpn vpn-target 2:2 import-extcommunity evpn evpn mpls routing-enable # mpls lsr-id 3.3.3.3 # mpls # mpls ldp # isis 1 network-entity 10.0000.0000.0003.00 # interface GigabitEthernet2/0/0 undo shutdown ip binding vpn-instance vpn1 ipv6 enable ipv6 address 2001:DB8:30::1/64 # interface GigabitEthernet1/0/0 undo shutdown ip address 10.2.1.2 255.255.255.0 isis enable 1 mpls mpls ldp # interface LoopBack1 ip address 3.3.3.3 255.255.255.255 isis enable 1 # bgp 100 peer 2.2.2.2 as-number 100 peer 2.2.2.2 connect-interface LoopBack1 # ipv4-family unicast undo synchronization peer 2.2.2.2 enable # ipv6-family vpn-instance vpn1 import-route direct advertise l2vpn evpn # l2vpn-family evpn undo policy vpn-target peer 2.2.2.2 enable # return