Experiment topology:
R1 configuration:
IP VRF Retail
Rd 100:100
Route-target Export 100:100
Route-target Import 100:100
!
IP VRF Trading
Rd 100:200
Route-target Export 100:200
Route-target Import 100:200
MPLS Label Range 100 199
MPLS Label Protocol LDP
!
Interface Loopback0
IP Address 1.1.1.1 255.255.255.255
!
Interface fastethernet0/0
IP address 12.1.1.1 255.255.255.0
Duplex Auto
Speed auto
MPLS IP
!
Interface FASTETHERNET0/1
No IP address
Duplex Auto
Speed auto
!
Interface fastethernet0/1.100
Encapsulation dot1q 100
IP VRF Forwarding Retail
IP address 192.168.14.1 255.255.255.0
!
Interface fastethernet0/1.200
Encapsulation dot1q 200
IP VRF Forwarding Trading
IP address 172.16.14.1 255.255.255.0
!
router OSPF 100
Router-id 1.1.1.1
Log-adjacency-changes
Network 1.1.1.1 0.0.0.0 Area 0
Network 12.1.1.0 0.0.0.255 Area 0
!
Router RIP
Version 2
No auto-summary
!
address-family IPv4 VRF Trading
Redistribute BGP metric Transparent
Network 172.16.0.0
No auto-summary
Exit-address-family
!
address-family IPv4 VRF Retail
Redistribute BGP metric Transparent
Network 192.168.14.0
No auto-summary
Exit-address-family
!
Router BGP 100
BGP Router-id 1.1.1.1
No BGP default Ipv4-unicast
BGP log-neighbor-changes
Neighbor 3.3.3.3 Remote-as 100
Neighbor 3.3.3.3 Update-source Loopback0
!
Address-family vpnv4
Neighbor 3.3.3.3 Activate
Neighbor 3.3.3.3 Send-community Extended
Exit-address-family
!
address-family IPv4 VRF Trading
Redistribute RIP
No synchronization
Exit-address-family
!
address-family IPv4 VRF Retail
Redistribute RIP
No synchronization
Exit-address-family
!
MPLS LDP Router-id Loopback0
R2 configuration:
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 address 12.1.1.2 255.255.255.0
Duplex Auto
Speed auto
MPLS IP
!
Interface FASTETHERNET0/1
IP address 23.1.1.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 12.1.1.0 0.0.0.255 Area 0
Network 23.1.1.0 0.0.0.255 Area 0
!
MPLS LDP Router-id Loopback0
R3 configuration:
IP VRF Retail
Rd 100:100
Route-target Export 100:100
Route-target Import 100:100
!
IP VRF Trading
Rd 100:200
Route-target Export 100:200
Route-target Import 100:200
!
MPLS Label Range 300 399
MPLS Label Protocol LDP
!
Interface Loopback0
IP address 3.3.3.3 255.255.255.255
!
Interface fastethernet0/0
No IP address
Duplex Auto
Speed auto
!
Interface fastethernet0/0.100
Encapsulation dot1q 100
IP VRF Forwarding Retail
IP address 192.168.35.3 255.255.255.0
!
Interface fastethernet0/0.200
Encapsulation dot1q 200
IP VRF Forwarding Trading
IP address 172.16.35.3 255.255.255.0
!
Interface FASTETHERNET0/1
IP address 23.1.1.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 23.1.1.0 0.0.0.255 Area 0
!
Router RIP
Version 2
No auto-summary
!
address-family IPv4 VRF Trading
Redistribute BGP metric Transparent
Network 172.16.0.0
No auto-summary
Exit-address-family
!
address-family IPv4 VRF Retail
Redistribute BGP metric Transparent
Network 192.168.35.0
No auto-summary
Exit-address-family
!
Router BGP 100
BGP Router-id 3.3.3.3
No BGP default Ipv4-unicast
BGP log-neighbor-changes
Neighbor 1.1.1.1 Remote-as 100
Neighbor 1.1.1.1 Update-source Loopback0
!
Address-family vpnv4
Neighbor 1.1.1.1 Activate
Neighbor 1.1.1.1 Send-community Extended
Exit-address-family
!
address-family IPv4 VRF Trading
Redistribute RIP
No synchronization
Exit-address-family
!
address-family IPv4 VRF Retail
Redistribute RIP
No synchronization
Exit-address-family
!
MPLS LDP Router-id Loopback0
R4 configuration: