1

I have the below topology: enter image description here

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
  • From which interface on R2 are you trying to ping? – Ron Trunk May 24 '17 at 18:34
  • On R2 , i do: ping vrf TEST 1.0.1.1 – fsociety May 25 '17 at 5:54
1

I got it working(with guidance of my colleague), please have a look at the configs, note that there is a minor change in the ip(replace 192 with 172), replace 1.0.1.1 with 100.0.0.1; and f0/1 is replaced with subinterfaces. Below are the working configs of my lab in GNS3.

On R1:

R1#ter len 0
R1#
R1#
R1#
R1#
R1#sho run
Building configuration...

Current configuration : 1076 bytes
!
! Last configuration change at 16:46:26 UTC Thu May 25 2017
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
!
!
!
!
!
no ip domain lookup
ip domain name lab.local
ip cef
no ipv6 cef
!
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 100.0.0.1 255.255.255.255
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex full
!
interface FastEthernet1/0
 ip address 172.16.1.14 255.255.255.252
 ip ospf 1 area 0
 speed auto
 duplex auto
!
interface FastEthernet1/1
 no ip address
 shutdown
 speed auto
 duplex auto
!
router ospf 1
 network 100.0.0.1 0.0.0.0 area 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
ip route 0.0.0.0 0.0.0.0 172.16.1.13
!
!
!
!
control-plane
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line vty 0 4
 login
!
!
end

R1#

On R2:

R2#sho run
Building configuration...

Current configuration : 1697 bytes
!
! Last configuration change at 16:48:08 UTC Thu May 25 2017
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
vrf definition TEST
 rd 2:1
 !
 address-family ipv4
 exit-address-family
!
!
no aaa new-model
!
!
!
!
!
!
no ip domain lookup
ip domain name lab.local
ip cef
no ipv6 cef
!
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex full
!
interface FastEthernet1/0
 ip address 172.16.2.9 255.255.255.252
 speed auto
 duplex auto
!
interface FastEthernet1/1
 no ip address
 speed auto
 duplex auto
!
interface FastEthernet1/1.2000
 encapsulation dot1Q 2000
 vrf forwarding TEST
 ip address 172.16.1.9 255.255.255.252
!
interface FastEthernet2/0
 ip address 172.16.1.13 255.255.255.252
 ip ospf 1 area 0
 speed auto
 duplex auto
!
interface FastEthernet2/1
 no ip address
 shutdown
 speed auto
 duplex auto
!
router ospf 1
!
router bgp 65002
 bgp log-neighbor-changes
 neighbor 172.16.2.10 remote-as 65003
 !
 address-family ipv4
  redistribute ospf 1
  neighbor 172.16.2.10 activate
 exit-address-family
 !
 address-family ipv4 vrf TEST
  neighbor 172.16.1.10 remote-as 65003
  neighbor 172.16.1.10 activate
  neighbor 172.16.1.10 allowas-in
 exit-address-family
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
ip route 172.16.1.8 255.255.255.252 FastEthernet1/1.2000
!
!
!
!
control-plane
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line vty 0 4
 login
!
!
end

R2#

On R3:

R3#ter len 0
R3#sho run
Building configuration...

Current configuration : 1567 bytes
!
! Last configuration change at 16:23:00 UTC Thu May 25 2017
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
vrf definition TEST
 rd 3:1
 !
 address-family ipv4
  import ipv4 unicast map GLOBAL_TO_VRF
 exit-address-family
!
!
no aaa new-model
!
!
!
!
!
!
no ip domain lookup
ip domain name lab.local
ip cef
no ipv6 cef
!
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex full
!
interface FastEthernet1/0
 ip address 172.16.2.10 255.255.255.252
 speed auto
 duplex auto
!
interface FastEthernet1/1
 no ip address
 speed auto
 duplex auto
!
interface FastEthernet1/1.2000
 encapsulation dot1Q 2000
 vrf forwarding TEST
 ip address 172.16.1.10 255.255.255.252
!
router bgp 65003
 bgp log-neighbor-changes
 neighbor 172.16.2.9 remote-as 65002
 !
 address-family ipv4
  neighbor 172.16.2.9 activate
 exit-address-family
 !
 address-family ipv4 vrf TEST
  neighbor 172.16.1.9 remote-as 65002
  neighbor 172.16.1.9 activate
 exit-address-family
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
ip route vrf TEST 172.16.2.8 255.255.255.252 172.16.2.9 global
!
access-list 10 permit any log
!
route-map GLOBAL_TO_VRF permit 10
 match ip address 10
!
!
!
control-plane
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line vty 0 4
 login
!
!
end

R3#

Verification:

R2#ping vrf TEST 100.0.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 52/60/68 ms
R2#
  • @RonTrunk i tried but found that i can do so only tomorrow – fsociety May 25 '17 at 11:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.