1

I'm doing a Lab and it's very simple. it's just like I need to confirm some commands but I'm really getting upset.

here is my lab. I configured a vrf and a loopback interface which I apply it under the vrf. the loopback has been disappear from the global table and it's inserted in the vrf table. so I added a static route to be able to ping the interface from the global table. Now I can see the loopback interface in the global table inserted as static but i can't pings.

I feel there is something silly missing becasue everything seems ok and it should work. the output of my router configuratuion is shown below:

ip vrf HQ
 rd 30:50

!
!
!
!
!
!
!

interface Loopback1
 ip vrf forwarding HQ
 ip address 1.1.1.1 255.255.255.255
!

ip classless
ip route 1.1.1.1 255.255.255.255 Loopback1
no ip http server
no ip http secure-server
!
!
!
!


R2#sh ip ro
R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
S       1.1.1.1 is directly connected, Loopback1



R2#sh ip ro
R2#sh ip route vrf HQ

Routing Table: HQ
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback1
R2#

Note: I can traceroute the ip of the interface

2 Answers 2

1

What you need is route leaking from VRF into Global Routing Table (you already did) and route leaking from Global Routing Table into VRF.

I assume your network diagram is as simple as the following

enter image description here

On R2, you already have ip route 1.1.1.1 255.255.255.255 Loopback1.

Now you will need another static VRF route to leak the route 10.0.0.0/24 into VRF HQ:

  ip route vrf HQ 10.0.0.0 255.255.255.0 10.0.0.1 global

Verification on R2:

R2#show run | i route
ip route 1.1.1.1 255.255.255.255 Loopback1
ip route vrf HQ 10.0.0.0 255.255.255.0 10.0.0.1 global


R2#show ip route | beg Gateway
Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
S       1.1.1.1 is directly connected, Loopback1
     10.0.0.0/24 is subnetted, 1 subnets
C       10.0.0.0 is directly connected, FastEthernet0/0


R2#show ip route vrf HQ | beg Gateway
Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback1
     10.0.0.0/24 is subnetted, 1 subnets
S       10.0.0.0 [1/0] via 10.0.0.1


R2#ping 1.1.1.1 source 10.0.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 10.0.0.2
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 68/70/72 ms

Verification on R1:

R1#show run | i route
ip route 1.1.1.1 255.255.255.255 10.0.0.2


R1#ping 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/36/64 ms

I hope it is helpful and answers your question.

4
  • It's really awesome. Finally it worked!!!.. I know it simple thing is missing. what I can understand is when we ping 1.1.1.1 from R1, the packet travels to R2 then he finds a route as static for 1.1.1.1 in the global table now there should be i reply since a route is already found in the table so why we need to leak the P2P link subnet from global into vrf. I need to understand how the flow of the packet in this scenarios. it's a little confusing for me. Thank you so much Oct 5, 2017 at 8:12
  • @AsemMoqbel We need to leak the P2P link subnet from global into vrf for return traffic. If we do not do this vrf does not know where to return the traffic back. If it works and you have no further concerns, please mark my answer as the solution :).
    – Hung Tran
    Oct 5, 2017 at 8:39
  • but when I ping from R1 to 1.1.1.1 at R2 interface. I ping through global table and it should hit the route in R2 global table which has the route as static. right? so how come the packet hits the vrf and even I don't ping using Ping vrf hq. can you just please explain more how the packet travels from r! and comes back. thank you Oct 5, 2017 at 8:51
  • When you ping 1.1.1.1 from R1, the traffic hits R2. R2 checks its global routing table and see that to reach 1.1.1.1, it needs to send the traffic to Loopback1. Once traffic is sent to Loopback1 (which belongs to vrf HQ), Loopback1 will reply back by check its vrf routing table and it knows that it can reach (return traffic to) 10.0.0.0/24 through the next-hop IP 10.0.0.1 which is resolved in R2 global routing table (with keyword global in the static vrf route command).
    – Hung Tran
    Oct 5, 2017 at 9:41
1

You do not need static route you just neef to ping within the vrf as below:

ping vrf vrfname ip
1
  • I can ping within the vrf as you told but what i want to do is to ping it from the global table and that's why i add the static route Oct 1, 2017 at 6:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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