配置IPv6 VPN路由的负载分担示例
PE去往远端或本2001:db8:12::2端站点的路由有多路可达时,配置IPv6 VPN路由的负载分担,可以充分利用网络资源,提高网络的可靠性。
组网需求
本地PE通过不同的PE对等体收到了多条到达同一前缀的VPNv6路由,希望在转发IPv6 VPN流量时,进行流量的负载分担。
同一站点的不同CE对等体通过BGP接入到同一PE,PE通过CE对等体学到了多条到达同一私网前缀的IPv6 VPN路由,希望在转发IPv6流量时,进行流量的负载分担。
如图8-12所示,PE1和PE3、PE2都建立了VPNv6邻居,PE1通过PE2、PE3学到了两条去往CE所在站点路由。希望通过在PE1上配置IPv6 VPN路由的负载分担,使得后续去往CE1所在站点的IPv6 VPN流量能够负载分担到PE2、PE3上。
配置思路
采用如下的思路配置IPv6 VPN路由的负载分担:
配置BGP/MPLS IPv6 VPN,并配置CE双归到PE2、PE3
PE1的BGP-VPN实例IPv6地址族下配置IPv6 VPN路由的负载分担
操作步骤
- 配置VPN骨干网各接口的IP地址和VPN site中各接口的IPv6地址(略)
- 在MPLS骨干网上配置OSPF协议,实现骨干网PE互通(略)
- 在MPLS骨干网上配置MPLS基本能力和MPLS LDP,建立LDP LSP
# 配置PE1。
<PE1> system-view
[~PE1] mpls lsr-id 1.1.1.1
[*PE1] mpls
[*PE1-mpls] quit
[*PE1] mpls ldp
[*PE1-mpls-ldp] quit
[*PE1] interface gigabitEthernet2/0/0
[*PE1-GigabitEthernet2/0/0] mpls
[*PE1-GigabitEthernet2/0/0] mpls ldp
[*PE1-GigabitEthernet2/0/0] quit
[*PE1] interface gigabitEthernet3/0/0
[*PE1-GigabitEthernet3/0/0] mpls
[*PE1-GigabitEthernet3/0/0] mpls ldp
[*PE1-GigabitEthernet3/0/0] quit
[*PE1] commit
# 配置PE2。
<PE2> system-view
[~PE2] mpls lsr-id 2.2.2.2
[*PE2] mpls
[*PE2-mpls] quit
[*PE2] mpls ldp
[*PE2-mpls-ldp] quit
[*PE2] interface gigabitEthernet1/0/0
[*PE2-GigabitEthernet1/0/0] mpls
[*PE2-GigabitEthernet1/0/0] mpls ldp
[*PE2-GigabitEthernet1/0/0] quit
[*PE2] commit
# 配置PE3。
<PE3> system-view
[~PE3] mpls lsr-id 3.3.3.3
[*PE3] mpls
[*PE3-mpls] quit
[*PE3] mpls ldp
[*PE3-mpls-ldp] quit
[*PE3] interface gigabitEthernet1/0/0
[*PE3-GigabitEthernet1/0/0] mpls
[*PE3-GigabitEthernet1/0/0] mpls ldp
[*PE3-GigabitEthernet1/0/0] quit
[*PE3] commit
此时在PE上执行命令display mpls lsp,可看到PE1与PE2、PE1与PE3之间的LSP建立成功。以PE1的显示为例:
[~PE1] display mpls lsp
------------------------------------------------------------------------------- LSP Information: LDP LSP ------------------------------------------------------------------------------- FEC In/Out Label In/Out IF Vrf Name 1.1.1.1/32 3/NULL -/- 2.2.2.2/32 NULL/3 -/GE2/0/0 2.2.2.2/32 1025/3 -/GE2/0/0 3.3.3.3/32 NULL/3 -/GE3/0/0 3.3.3.3/32 1024/3 -/GE3/0/0
- 在PE设备上配置支持IPv6地址族的VPN实例,将CE接入PE2和PE3
# 配置PE1。
[~PE1] ip vpn-instance vpn1
[*PE1-vpn-instance-vpn1] ipv6-family
[*PE1-vpn-instance-vpn1-af-ipv6] route-distinguisher 100:1
[*PE1-vpn-instance-vpn1-af-ipv6] vpn-target 111:1
[*PE1-vpn-instance-vpn1-af-ipv6] quit
[*PE1-vpn-instance-vpn1] quit
[*PE1] interface loopback2
[*PE1-Loopback2] ip binding vpn-instance vpn1
[*PE1-Loopback2] ipv6 enable
[*PE1-Loopback2] ipv6 address 2001:db8:11::1/128
[*PE1-Loobpack2] quit
[*PE1] commit
# 配置PE2。
[~PE2] ip vpn-instance vpn1
[*PE2-vpn-instance-vpn1] ipv6-family
[*PE2-vpn-instance-vpn1-af-ipv6] route-distinguisher 100:2
[*PE2-vpn-instance-vpn1-af-ipv6] vpn-target 111:1
[*PE2-vpn-instance-vpn1-af-ipv6] quit
[*PE2-vpn-instance-vpn1] quit
[*PE2] interface gigabitethernet2/0/0
[*PE2-GigabitEthernet2/0/0] ip binding vpn-instance vpn1
[*PE2-GigabitEthernet2/0/0] ipv6 enable
[*PE2-GigabitEthernet2/0/0] ipv6 address 2001:db8:1::2 64
[*PE2-GigabitEthernet2/0/0] quit
[*PE2] commit
# 配置PE3。
[~PE3] ip vpn-instance vpn1
[*PE3-vpn-instance-vpn1] ipv6-family
[*PE3-vpn-instance-vpn1-af-ipv6] route-distinguisher 100:3
[*PE3-vpn-instance-vpn1-af-ipv6] vpn-target 111:1
[*PE3-vpn-instance-vpn1-af-ipv6] quit
[*PE3-vpn-instance-vpn1] quit
[*PE3] interface gigabitethernet2/0/0
[*PE3-GigabitEthernet2/0/0] ip binding vpn-instance vpn1
[*PE3-GigabitEthernet2/0/0] ipv6 enable
[*PE3-GigabitEthernet2/0/0] ipv6 address 2001:db8:3::2 64
[*PE3-GigabitEthernet2/0/0] quit
[*PE3] commit
- 在PE2与CE,及PE3与CE之间建立EBGP对等体
# 配置PE2。
[~PE2] bgp 100
[*PE2-bgp] ipv6-family vpn-instance vpn1
[*PE2-bgp6-vpn1] peer 2001:db8:1::1 as-number 65410
[*PE2-bgp6-vpn1] quit
[*PE2-bgp] quit
[*PE2] commit
# 配置PE3。
[~PE3] bgp 100
[*PE3-bgp] ipv6-family vpn-instance vpn1
[*PE3-bgp6-vpn1] peer 2001:db8:3::1 as-number 65410
[*PE3-bgp6-vpn1] quit
[*PE3-bgp] quit
[*PE3] commit
# 配置CE,引入Loopback1的接口路由到BGP中。
<CE> system-view
[~CE] bgp 65410
[*CE-bgp] router-id 10.10.10.10
[*CE-bgp] peer 2001:db8:1::2 as-number 100
[*CE-bgp] peer 2001:db8:3::2 as-number 100
[*CE-bgp] ipv6-family unicast
[*CE-bgp-af-ipv6] peer 2001:db8:1::2 enable
[*CE-bgp-af-ipv6] peer 2001:db8:3::2 enable
[*CE-bgp-af-ipv6] network 2001:db8:0:1:2::1 128
[*CE-bgp-af-ipv6] quit
[*CE-bgp] quit
[*CE] commit
完成此步骤后,在PE2和PE3上执行display bgp vpnv6 all peer命令,可看到PE和CE之间的EBGP对等体建立成功,其状态为“Established”。
以PE2的显示为例:
[~PE2] display bgp vpnv6 all peer
BGP local router ID : 2.2.2.2 Local AS number : 100 Total number of peers : 2 Peers in established state : 2 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 1.1.1.1 4 100 27 24 0 00:19:33 Established 0 Peer of vpn instance : VPN-Instance vpn1, Router ID 2.2.2.2: Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 2001:DB8:1::1 4 65410 0 0 0 01:10:03 Established 0
- 在PE之间建立MP-IBGP对等体
# 配置PE1。
[~PE1] bgp 100
[*PE1-bgp] peer 2.2.2.2 as-number 100
[*PE1-bgp] peer 2.2.2.2 connect-interface loopback 1
[*PE1-bgp] peer 3.3.3.3 as-number 100
[*PE1-bgp] peer 3.3.3.3 connect-interface loopback 1
[*PE1-bgp] ipv6-family vpnv6
[*PE1-bgp-af-vpnv6] peer 2.2.2.2 enable
[*PE1-bgp-af-vpnv6] peer 3.3.3.3 enable
[*PE1-bgp-af-vpnv6] quit
[*PE1-bgp] quit
[*PE1] commit
# 配置PE2。
[~PE2] bgp 100
[*PE2-bgp] peer 1.1.1.1 as-number 100
[*PE2-bgp] peer 1.1.1.1 connect-interface loopback 1
[*PE2-bgp] ipv6-family vpnv6
[*PE2-bgp-af-vpnv6] peer 1.1.1.1 enable
[*PE2-bgp-af-vpnv6] quit
[*PE2-bgp] quit
[*PE2-bgp] commit
# 配置PE3。
[~PE3] bgp 100
[*PE3-bgp] peer 1.1.1.1 as-number 100
[*PE3-bgp] peer 1.1.1.1 connect-interface loopback 1
[*PE3-bgp] ipv6-family vpnv6
[*PE3-bgp-af-vpnv6] peer 1.1.1.1 enable
[*PE3-bgp-af-vpnv6] quit
[*PE3-bgp] quit
[*PE3] commit
完成此步骤后,在PE上执行display bgp vpnv6 all peer命令,可看到MP-IBGP对等体建立成功,其状态为“Established”。
以PE1的显示为例:
<PE1> display bgp vpnv6 all peer
BGP local router ID : 1.1.1.1
Local AS number : 100
Total number of peers : 2 Peers in established state : 2
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
2.2.2.2 4 100 20 17 0 00:13:26 Established 5
3.3.3.3 4 100 24 19 0 00:17:18 Established 5
- 配置IPv6 VPN路由的负载分担
# 配置PE1。
[~PE1] bgp 100
[~PE1-bgp] ipv6-family vpn-instance vpn1
[*PE1-bgp6-vpn1] maximum load-balancing 2
[*PE1-bgp6-vpn1] quit
[*PE1-bgp] quit
[*PE1] commit
- 检查配置结果
以上配置完成后,PE1上执行命令display ipv6 routing-table vpn-instance verbose,可以查看去往远端CE的Loopback接口的IPv6 VPN路由同时有PE2、PE3做为下一跳。
<PE1> display ipv6 routing-table vpn-instance vpn1 2001:db8:0:1:2::1 Routing Table : vpn1 Summary Count : 2 Destination : 2001:db8:0:1:2::1 PrefixLength : 128 NextHop : ::FFFF:2.2.2.2 Preference : 255 Cost : 0 Protocol : BGP RelayNextHop : ::FFFF:10.10.1.2 TunnelID : 0x800003 Interface : GigabitEthernet2/0/0 Flags : RD Destination : 2001:db8:0:1:2::1 PrefixLength : 128 NextHop : ::FFFF:3.3.3.3 Preference : 255 Cost : 0 Protocol : BGP RelayNextHop : ::FFFF:10.20.1.2 TunnelID : 0x800001 Interface : GigabitEthernet3/0/0 Flags : RD
配置文件
PE1的配置文件
#
sysname PE1
#
ip vpn-instance vpn1
ipv6-family
route-distinguisher 100:1
apply-label per-instance
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
mpls lsr-id 1.1.1.1
#
mpls
#
mpls ldp
#
interface GigabitEthernet2/0/0
undo shutdown
ip address 10.10.1.1 255.255.255.252
mpls
mpls ldp
#
interface GigabitEthernet3/0/0
undo shutdown
ip address 10.20.1.1 255.255.255.252
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
interface LoopBack2
ip binding vpn-instance vpn1
ipv6 enable
ipv6 address 2001:db8:11::1/128
#
bgp 100
peer 2.2.2.2 as-number 100
peer 2.2.2.2 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 2.2.2.2 enable
peer 3.3.3.3 enable
#
ipv6-family vpnv6
policy vpn-target
peer 2.2.2.2 enable
peer 3.3.3.3 enable
#
ipv6-family vpn-instance vpn1
maximum load-balancing 2
#
ospf 1
area 0.0.0.0
network 10.10.1.0 0.0.0.3
network 10.20.1.0 0.0.0.3
network 1.1.1.1 0.0.0.0
#
return
PE2的配置文件
#
sysname PE2
#
ip vpn-instance vpn1
ipv6-family
route-distinguisher 100:2
apply-label per-instance
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
mpls lsr-id 2.2.2.2
#
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.10.1.2 255.255.255.252
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
undo shutdown
ipv6 enable
ip binding vpn-instance vpn1
ipv6 address 2001:db8:1::2/64
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization peer 1.1.1.1 enable
#
ipv6-family vpnv6
policy vpn-target
peer 1.1.1.1 enable
#
ipv6-family vpn-instance vpn1
peer 2001:db8:1::1 as-number 65410
import-route direct
#
ospf 1
area 0.0.0.0
network 10.10.1.0 0.0.0.3
network 2.2.2.2 0.0.0.0
#
return
PE3的配置文件
#
sysname PE3
#
ip vpn-instance vpn1
ipv6-family
route-distinguisher 100:3
apply-label per-instance
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
mpls lsr-id 3.3.3.3
#
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.20.1.2 255.255.255.252
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
undo shutdown
ipv6 enable
ip binding vpn-instance vpn1
ip address 2001:db8:3::2/64
#
interface LoopBack1
ip address 3.3.3.3 255.255.255.255
#
bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization peer 1.1.1.1 enable
#
ipv6-family vpnv6
policy vpn-target
peer 1.1.1.1 enable
#
ipv6-family vpn-instance vpn1
peer 2001:db8:3::1 as-number 65410
#
ospf 1
area 0.0.0.0
network 10.20.1.0 0.0.0.3
network 3.3.3.3 0.0.0.0
#
return
CE的配置文件
#
sysname CE
#
interface GigabitEthernet1/0/0
undo shutdown
ipv6 enable
ipv6 address 2001:db8:1::1/64
#
interface GigabitEthernet2/0/0
undo shutdown
ipv6 enable
ipv6 address 2001:db8:3::1/64
#
interface LoopBack1
ipv6 enable
ipv6 address 2001:db8:0:1:2::1/128
#
bgp 65410
router-id 10.10.10.10
peer 2001:db8:1::2 as-number 100
peer 2001:db8:3::2 as-number 100
#
ipv4-family unicast
undo synchronization #
ipv6-family unicast
undo synchronization network 2001:db8:0:1:2::1 128
peer 2001:db8:1::2 enable
peer 2001:db8:3::2 enable
#
return