I have to make sure that the loopback interface of R1(1.0.1.1/32) is learnt on R2 but with a few constraints.
Step1: The loopback of R1 is learnt in global routing table of R2 via ospf
Step2: R2 and R3 are ebgp neighbors for address-family ipv4 (on interface f0/2--which is in global routing table) and address-family ipv4 vrf (on interface f0/1 which is part of vrf TEST on both R2 and R3)
Step3: At R2, I redistribute the ospf learnt routes to BGP (ipv4 address-family).
Step4: R3 learns the bgp routes from R2 via ebgp (with a next hop of 192.16.2.9) in global routing table.
Step5: At R3, I do a route-leaking from the bgp ipv4 address family to bgp vpnv4 vrf TEST address family for 1.0.1.1/32
So, R3 has a route to 1.0.1.1/32 in vrf TEST with a next hop of 192.16.2.9 (which is in global routing table)
Step 6: R2 learns again the 1.0.1.1/32 route via ebgp address-family ipv4 vrf TEST with a next hop of 192.16.1.10
Now my objective is to make sure R2 can ping the 1.0.1.1/32 via the vrf TEST(but as expected it fails)
Any suggestions on how to get the above scenario working. (One of the ways,this can be done is to configure the interface f0/2 on both R2 and R3 as below:
int f0/2
ip vrf receive TEST