R1#show run
Building configuration...

Current configuration : 1126 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup

interface Loopback0
 ip address 1.1.1.1 255.255.255.0
!
interface Loopback1
 ip address 11.11.11.11 255.255.255.0
!
interface Tunnel1
 ip address 172.16.15.1 255.255.255.0
 tunnel source Loopback0
 tunnel destination 5.5.5.5
 tunnel checksum
!
interface FastEthernet0/0
 ip address 192.168.12.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
!
router ospf 15
 router-id 1.1.1.1
 log-adjacency-changes
 network 11.11.11.0 0.0.0.255 area 0
 network 172.16.15.0 0.0.0.255 area 0
!
router rip
 version 2
 network 1.0.0.0
 network 192.168.12.0
 no auto-summary
!
no ip http server
no ip http secure-server
ip route 0.0.0.0 0.0.0.0 Tunnel1
!
control-plane
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
!
!
end

R2#show run
Building configuration...

Current configuration : 1557 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
ip vrf r2
 rd 100:2
 route-target export 100:100
 route-target import 100:100
!
mpls label range 200 299
mpls label protocol ldp
!
!
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
 ip vrf forwarding r2
 ip address 192.168.12.2 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.23.2 255.255.255.0
 duplex auto
 speed auto
 mpls ip
!
!
router ospf 100
 router-id 2.2.2.2
 log-adjacency-changes
 network 2.2.2.2 0.0.0.0 area 0
 network 192.168.23.0 0.0.0.255 area 0
!
router rip
 !
 address-family ipv4 vrf r2
 redistribute bgp 100 metric transparent
 network 192.168.12.0
 no auto-summary
 version 2
 exit-address-family
!
router bgp 100
 bgp router-id 2.2.2.2
 no bgp default ipv4-unicast
 bgp log-neighbor-changes
 neighbor 4.4.4.4 remote-as 100
 neighbor 4.4.4.4 update-source Loopback0
 !
 address-family ***v4
 neighbor 4.4.4.4 activate
 neighbor 4.4.4.4 send-community extended
 exit-address-family
 !       
 address-family ipv4 vrf r2
 redistribute rip
 no synchronization
 exit-address-family
!
no ip http server
no ip http secure-server
!
mpls ldp router-id Loopback0
!
!
control-plane

!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
!
!
end

 

R3#show run
Building configuration...

Current configuration : 973 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
mpls label range 300 399
mpls label protocol ldp
!
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.34.3 255.255.255.0
 duplex auto
 speed auto
 mpls ip
!
interface FastEthernet0/1
 ip address 192.168.23.3 255.255.255.0
 duplex auto
 speed auto
 mpls ip
!
!
router ospf 100
 router-id 3.3.3.3
 log-adjacency-changes
 network 3.3.3.3 0.0.0.0 area 0
 network 192.168.23.0 0.0.0.255 area 0
 network 192.168.34.0 0.0.0.255 area 0
!
no ip http server
no ip http secure-server
!
!
!
!
!
mpls ldp router-id Loopback0
!
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
!
!
end

 

R4#show run
Building configuration...

Current configuration : 1557 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
ip vrf r4
 rd 100:4
 route-target export 100:100
 route-target import 100:100
!
mpls label range 400 499
mpls label protocol ldp
!

!
interface Loopback0
 ip address 4.4.4.4 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.34.4 255.255.255.0
 duplex auto
 speed auto
 mpls ip
!
interface FastEthernet0/1
 ip vrf forwarding r4
 ip address 192.168.45.4 255.255.255.0
 duplex auto
 speed auto
!
!
router ospf 100
 router-id 4.4.4.4
 log-adjacency-changes
 network 4.4.4.4 0.0.0.0 area 0
 network 192.168.34.0 0.0.0.255 area 0
!
router rip
 !
 address-family ipv4 vrf r4
 redistribute bgp 100 metric transparent
 network 192.168.45.0
 no auto-summary
 version 2
 exit-address-family
!
router bgp 100
 bgp router-id 4.4.4.4
 no bgp default ipv4-unicast
 bgp log-neighbor-changes
 neighbor 2.2.2.2 remote-as 100
 neighbor 2.2.2.2 update-source Loopback0
 !
 address-family ***v4
 neighbor 2.2.2.2 activate
 neighbor 2.2.2.2 send-community extended
 exit-address-family
 !       
 address-family ipv4 vrf r4
 redistribute rip
 no synchronization
 exit-address-family
!
no ip http server
no ip http secure-server
!
!
!
!
!
mpls ldp router-id Loopback0
!
!
control-plane
!
!
!
!
!
!
!        
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
!
!
end

R5#show run
Building configuration...

Current configuration : 1126 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R5
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
interface Loopback0
 ip address 5.5.5.5 255.255.255.0
!
interface Loopback1
 ip address 55.55.55.55 255.255.255.0
!
interface Tunnel5
 ip address 172.16.15.5 255.255.255.0
 tunnel source Loopback0
 tunnel destination 1.1.1.1
 tunnel checksum
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.45.5 255.255.255.0
 duplex auto
 speed auto
!
!
router ospf 15
 router-id 5.5.5.5
 log-adjacency-changes
 network 55.55.55.0 0.0.0.255 area 0
 network 172.16.15.0 0.0.0.255 area 0
!
router rip
 version 2
 network 5.0.0.0
 network 192.168.45.0
 no auto-summary
!
no ip http server
no ip http secure-server
ip route 0.0.0.0 0.0.0.0 Tunnel5
!
!
!
!
!
!
!
control-plane
!
!
!        
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
!
!
end

 测试:

 

抓包分析: