cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1748
Views
5
Helpful
4
Replies

VRF to VRF default route

Ahmed Ashfaque
Level 1
Level 1

Good Day,

 

I have two VRFs, let's say VRF_A & VRF_B.

 

I want to leak a default route in VRF A for VRF B so that VRF A hosts can access VRFB with there should be a default route only, 

how can I achieve this?

 

Many thanks & Regards, 

 

4 Replies 4

Harold Ritter
Cisco Employee
Cisco Employee

You can selectively export the default route from VRF_B to VRF_A using an export map, but you would also need to leak some routes from VRF_A to VRF_B for the return traffic.

 

vrf definition vrfB
rd 1:2
!
address-family ipv4
export map tovrfA
route-target export 1:2
route-target import 1:2

!

ip prefix-list default seq 10 permit 0.0.0.0/0

!

route-map tovrfA permit 10
match ip address prefix-list default
set extcommunity rt 1:1 additive
!

 

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Steven Case
Level 1
Level 1

If I'm following this correctly, why not just do a static route?

 

ip route vrf vrfA {network for vrfB} {subnet for vrfB} {interface/subinterface to vrfB's router/environment} {next hop IP}

 

Example:

VRF vrfA is 10.1.1.1/24 on gi 0/0.1

VRF vrfB is 10.2.1.1/24 on gi 0/0.2

 

Route in your inquiry:

 

ip route vrf vrfA 10.1.2.0 255.255.255.0 gi 0/0.2 10.2.1.1

Harold Ritter
Cisco Employee
Cisco Employee

Hi Steven,

 

You could certainly use a static route as you mentioned. If the default route present in VRF_B is learned dynamically and you want to keep the dynamic nature through the export/import process, you could then use the export map as I suggested.

 

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Yeah, and after reading your response I had forgotten that the return traffic would also need to be static. Route maps would be nicer, but a bit deeper, whereas the static would be slightly cleaner but involve more administrative overhead to monitor and administer. 

 

I love using route maps for redistributions, think that's by far the coolest implement in routing the past few decades.

 

At least the OP has a few approaches now. Hopefully one resolves the issue.

Review Cisco Networking for a $25 gift card