拓扑:

配置:

R1:
interface FastEthernet0/0
xconnect 7.7.7.7 10 encapsulation mpls

-------------------------------------------------
R2:
nterface FastEthernet0/0
xconnect 2.2.2.2 10 encapsulation mpls

--------------------------------------------------
R4:
router ospf 100
redistribute bgp 100 subnets
router bgp 100
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 192.168.45.5 remote-as 200
!
address-family ipv4
neighbor 192.168.45.5 activate
neighbor 192.168.45.5 send-label
no auto-summary
no synchronization
network 2.2.2.2 mask 255.255.255.255
exit-address-family

--------------------------------
R5:
router ospf 200
redistribute bgp 200 subnets
router bgp 200
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 192.168.45.4 remote-as 100
!
address-family ipv4
neighbor 192.168.45.4 activate
neighbor 192.168.45.4 send-label
no auto-summary
no synchronization
network 7.7.7.7 mask 255.255.255.255
exit-address-family
其他配置是普通的mpls 配置,不在此给出。

验证: