8.2 HoPE典型配置
【组网图】
RT2为SPE,RT3为UPE设备,SPE只需要向UPE通告一条默认路由。
【组网图】
【配置脚本】
RT1配置脚本 |
# sysname RT1 # router id 1.1.1.1 # mpls lsr-id 1.1.1.1 # radius scheme system # mpls # mpls ldp # ip vpn-instance vpna route-distinguisher 100:1 vpn-target 100:1
export-extcommunity vpn-target 100:1
import-extcommunity # ip vpn-instance vpnb route-distinguisher 200:1 vpn-target 200:1
export-extcommunity vpn-target 200:1
import-extcommunity # domain system #
interface
Serial2/0/0
link-protocol ppp ip address 10.0.0.1 255.255.255.252 mpls mpls ldp enable # interface NULL0 # interface LoopBack0 ip address 1.1.1.1 255.255.255.255 # interface LoopBack11 ip binding vpn-instance
vpna ip address 192.168.11.1 255.255.255.0 # interface LoopBack21 ip binding vpn-instance
vpnb ip address 192.168.21.1 255.255.255.0 # bgp 100 undo synchronization group inter internal peer 2.2.2.2 group inter peer 2.2.2.2 connect-interface LoopBack0 #
ipv4-family vpn-instance
vpna
import-route
direct
undo synchronization # ipv4-family vpn-instance
vpnb import-route direct undo synchronization # ipv4-family vpnv4 peer inter enable peer 2.2.2.2 group inter # ospf 1 area 0.0.0.0 network 1.1.1.1 0.0.0.0 network 10.0.0.0 0.0.0.3 # return |
RT2配置脚本 |
# sysname RT2 # router id 2.2.2.2 # mpls lsr-id 2.2.2.2 # radius scheme system # mpls # mpls ldp # ip vpn-instance vpna route-distinguisher 100:1 vpn-target 100:1
export-extcommunity vpn-target 100:1
import-extcommunity # ip vpn-instance vpnb route-distinguisher 200:1 vpn-target 200:1
export-extcommunity # domain system # interface Serial2/0/0 link-protocol ppp ip address 10.0.0.2 255.255.255.252 mpls mpls ldp enable # interface Serial2/0/1 link-protocol ppp ip address 10.0.0.5 255.255.255.252 mpls mpls ldp enable # interface NULL0 # interface LoopBack0 ip address 2.2.2.2 255.255.255.255 # interface LoopBack12 ip binding vpn-instance vpna ip address 192.168.12.1 255.255.255.0 # interface LoopBack22 ip binding vpn-instance vpnb ip address 192.168.22.1 255.255.255.0 # bgp 100 undo synchronization group inter internal peer 1.1.1.1 group inter peer 1.1.1.1 connect-interface LoopBack0 peer 3.3.3.3 group inter peer 3.3.3.3 connect-interface LoopBack0 # ipv4-family vpn-instance vpna import-route direct undo synchronization # ipv4-family vpn-instance vpnb import-route direct undo synchronization # ipv4-family vpnv4 peer inter enable peer 1.1.1.1 group inter peer 3.3.3.3 group inter peer 3.3.3.3 upe
/配置3.3.3.3作为HoPE的UPE/ peer 3.3.3.3 default-route-advertise vpn-instance vpna /对UPE的vpna通告默认路由/ peer 3.3.3.3 default-route-advertise vpn-instance vpnb /对UPE的vpnb通告默认路由/ # ospf 1 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 10.0.0.0 0.0.0.3 network 10.0.0.4 0.0.0.3 # return |
RT3配置脚本 |
# sysname RT3 # router id 3.3.3.3 # mpls lsr-id 3.3.3.3 # radius scheme system # mpls # mpls ldp # ip vpn-instance vpna route-distinguisher 100:1 vpn-target 100:1
export-extcommunity vpn-target 100:1
import-extcommunity # ip vpn-instance vpnb route-distinguisher 200:1 vpn-target 200:1
export-extcommunity vpn-target 200:1
import-extcommunity # domain system #
interface
Serial2/0/0
link-protocol ppp ip address 10.0.0.6 255.255.255.252 mpls mpls ldp enable # interface NULL0 # interface LoopBack0 ip address 3.3.3.3 255.255.255.255 # interface LoopBack13 ip binding vpn-instance
vpna ip address 192.168.13.1 255.255.255.0 # interface LoopBack23 ip binding vpn-instance
vpnb ip address 192.168.23.1 255.255.255.0 # bgp 100 undo synchronization group inter internal peer 2.2.2.2 group inter peer 2.2.2.2 connect-interface LoopBack0 #
ipv4-family vpn-instance
vpna
import-route
direct
undo synchronization # ipv4-family vpn-instance
vpnb import-route direct undo synchronization # ipv4-family vpnv4 peer inter enable peer 2.2.2.2 group inter # ospf 1 area 0.0.0.0 network 3.3.3.3 0.0.0.0 network 10.0.0.4 0.0.0.3 # return |
【验证】
RT3上vpna的私网路由表:
disp ip routing vpn vpna
vpna Route Information
Routing Table: vpna Route-Distinguisher: 100:1
Destination/Mask Protocol Pre Cost Nexthop Interface
0.0.0.0/0 BGP 256 0 2.2.2.2 InLoopBack0
192.168.13.0/24 DIRECT 0 0 192.168.13.1 LoopBack13
192.168.13.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
只有一条由RT2通告的默认路由
【提示】
1、 HoPE和基本MPLS的配置基本上相同,只是在SPE上有所区别(红色部分)
peer 3.3.3.3 upe /配置3.3.3.3作为HoPE的UPE/
peer 3.3.3.3 default-route-advertise vpn-instance vpna /对UPE的vpna通告默认路由/
peer 3.3.3.3 default-route-advertise vpn-instance vpnb /对UPE的vpnb通告默认路由/
2、 UPE上不需要特殊的配置,和普通的MPLS的配置完全一样。
3、SPE的路由表容量大,转发性能强,但接口资源较少;UPE的路由容量和转发性能较低,但接入能力强。