拓扑如下图所示:
PE1关键配置如下:
#配置IGP协议(OSPF),实现PE1与PE2之间互通
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 12.1.1.1 0.0.0.0
network 112.1.1.1 0.0.0.0
#
#配置MPLS基本能力和MPLS LDP,建立LDP LSP
#
mpls lsr-id 1.1.1.1
mpls ldp
#
interface GigabitEthernet0/1
port link-mode route
ip address 12.1.1.1 255.255.255.0
mpls enable
mpls ldp enable
#
interface GigabitEthernet0/2
port link-mode route
ip address 112.1.1.1 255.255.255.0
mpls enable
mpls ldp enable
#
#配置VPN实例
#
ip vpn-instance 12
route-distinguisher 1:1
vpn-target 12:12 import-extcommunity
vpn-target 12:12 export-extcommunity
#
interface GigabitEthernet0/0
port link-mode route
ip binding vpn-instance 12
ip address 14.1.1.1 255.255.255.0
#
#PE之间建立MP-IBGP对等体
#
bgp 12
router-id 1.1.1.1
peer 2.2.2.2 as-number 12
peer 2.2.2.2 connect-interface LoopBack0
#
address-family ipv4 unicast
peer 2.2.2.2 enable
#
address-family vpnv4
peer 2.2.2.2 enable
#
ip vpn-instance 12
#
address-family ipv4 unicast
import-route direct
#
#创建并使能VPN实例的隧道策略,实现VRF转发负载功能
#
tunnel-policy 12
select-seq lsp load-balance-number 2
#
ip vpn-instance 12
route-distinguisher 1:1
tnl-policy 12 //使能TNL隧道策略
vpn-target 12:12 import-extcommunity
vpn-target 12:12 export-extcommunity
#
PE2关键配置如下:
#配置IGP协议(OSPF),实现PE2与PE1之间互通
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 12.1.1.2 0.0.0.0
network 112.1.1.2 0.0.0.0
#
#配置MPLS基本能力和MPLS LDP,建立LDP LSP
#
mpls lsr-id 2.2.2.2
mpls ldp
#
interface GigabitEthernet0/1
port link-mode route
ip address 12.1.1.2 255.255.255.0
mpls enable
mpls ldp enable
#
interface GigabitEthernet0/2
port link-mode route
ip address 112.1.1.2 255.255.255.0
mpls enable
mpls ldp enable
#
#配置VPN实例
#
ip vpn-instance 12
route-distinguisher 2:2
vpn-target 12:12 import-extcommunity
vpn-target 12:12 export-extcommunity
#
interface GigabitEthernet0/0
port link-mode route
ip binding vpn-instance 12
ip address 25.1.1.2 255.255.255.0
#
#PE之间建立MP-IBGP对等体
#
bgp 12
router-id 2.2.2.2
peer 1.1.1.1 as-number 12
peer 1.1.1.1 connect-interface LoopBack0
#
address-family ipv4 unicast
peer 1.1.1.1 enable
#
address-family vpnv4
peer 1.1.1.1 enable
#
ip vpn-instance 12
#
address-family ipv4 unicast
import-route direct
#
#创建并使能VPN实例的隧道策略,实现VRF转发负载功能
#
tunnel-policy 12
select-seq lsp load-balance-number 2
#
ip vpn-instance 12
route-distinguisher 2:2
tnl-policy 12 //使能TNL隧道策略
vpn-target 12:12 import-extcommunity
vpn-target 12:12 export-extcommunity
#
按照上述关键配置部署后,PE设备上可实现去往远端PE VRF流量转发等价负载。PE1 为例,显示转发等价表项:
Destination count: 1 FIB entry count: 2
Flag:
U:Usable G:Gateway H:Host B:Blackhole D:Dynamic S:Static R:Relay F:FRR
Destination/Mask Nexthop Flag OutInterface/Token Label
25.1.1.0/24 2.2.2.2 UGR 1 1151
25.1.1.0/24 2.2.2.2 UGR 3 1151
Summary count : 2
Destination/Mask Proto Pre Cost NextHop Interface
2.2.2.2/32 O_INTRA 10 1 12.1.1.2 GE0/1
112.1.1.2 GE0/2
Total NHLFE entries: 4
Flags: T - Forwarded through a tunnel
N - Forwarded through the outgoing interface to the nexthop IP address
B - Backup forwarding information
A - Active forwarding information
M - P2MP forwarding information
NID Tnl-Type Flag OutLabel Forwarding Info
--------------------------------------------------------------------------------
0 LOCAL NA - GE0/1 12.1.1.2
1 LSP NA 3 GE0/1 12.1.1.2
2 LOCAL NA - GE0/2 112.1.1.2
3 LSP NA 3 GE0/2 112.1.1.2
FEC Proto In/Out Label Interface/Out NHLFE
1.1.1.1/32 LDP 3/- -
2.2.2.2/32 LDP 1279/3 GE0/1
2.2.2.2/32 LDP -/3 GE0/1
2.2.2.2/32 LDP 1279/3 GE0/2
2.2.2.2/32 LDP -/3 GE0/2
12.1.1.2 Local -/- GE0/1
112.1.1.2 Local -/- GE0/2
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作