IP prefix import from a vrf table into global table

Unanswered Question
Jun 19th, 2008


Does any know how to import some of the vrf routes into global routing table.

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Harold Ritter Thu, 06/19/2008 - 05:27


There is a feature that allows you to dynamically import routes from the global to the VRF but not the other way around.

You can have a static route in the global with a NH interface in a VRF though.


Deniz AYDIN Thu, 06/19/2008 - 05:37


I cannot write static route for this case. Because I am using the vrf for my pppoe users. Router downloads the user profiles from the radius and put the users into the internet vrf. But I cannot install the reverse route for the user. If I use, route or framed route attribute in the userprofile ,router installs the route as it is a vrf route. The reason i am using the vrf is that I just wanna use different route table for different customers.

n.nandrekar Thu, 06/19/2008 - 07:39

Hi Harold!

I agree we cannot import routes from VRF to global. But we should be able to redistribute routes from the VRF PE-CE routing protocol into the global IGP, as i have mentioned in my earlier post. I have not tried it out but I do see the redistribute ospf x vrf xyz command in global ospf config mode.



Harold Ritter Thu, 06/19/2008 - 19:05


It is simply not allowed to redistribute from a routing process assigned to a VRF into the global.

One could probably loop two interfaces, one from the VRF and one from the global and run BGP between the two and therefore get the routes from the VRF into the global. Although I have never tried that I think this could work. You would need a special knob to configure the a separate BGP router id for the VRF, which is not available in all version of IOS (available in 12.2(22)SRB I believe) and would probably need to do some tricks with the local-as command to get it to work.


n.nandrekar Thu, 06/19/2008 - 05:30


You can create a distribute list and redistribute those routes from the vrf routing protocol (ospf x vrf test) into the global IGP.

eg. if you are running "ospf 1 vrf test" as the PE-CE protocol for vrf test, and you are running OSPF 100 as global igp, you can go to global IGP and redistribute the vrf routes in that using a distribute list to control the redistribution.

But doing this, you have to know the scenario completely and be sure that it doesnot overlap / cause problems in your global IGP.

For what scenario do you want to do that? If you have only a few prefixes, it is better to install static routes.



Deniz AYDIN Thu, 06/19/2008 - 06:07


When I try to redistribute, Router is not allowing.

#router ospf 100

(config-router)#redistribute ospf 1 vrf test subnets

%OSPF process 1 is attached to VRF test

waleed_amer Thu, 06/19/2008 - 06:28


1-Try to configure default route into the vrf for upload traffic with global key word:

ip route vrf internet (next-hop is your gateway router) global.

2-For download traffic configure static route into global routing table with the pppoe customers pool pointing to customers vrf interface or next-hop through this interface:

ip route customer pool ethernetx/x .


Deniz AYDIN Thu, 06/19/2008 - 06:36

Soryy, I guess I am not clear enough.

I cannot write a static route pointing to customer,as they are coming from L2TP tunnel which clones a virtual template. We can think as they are a normal dial-up users using a virtual-template. So I cannot write a static route manually pointing the customer.

waleed_amer Thu, 06/19/2008 - 07:04

If the uplink interface will be used only for internet traffic you can bind this interface to another vrf and now you can import & export routes (default and customer routes which are connected routes in the cust vrf routing table) by RTs between customer vrfs and uplink vrf and in the same time you will separate between cust VRFs and make uplink vrf as central vrf.


Why don't you create another interface for vrf "test" that facing to P Router and then enable ospf for vrf "test" ?

eg. Something like this.

in lo9999

ip vrf for test

ip add x.x.x.x/32

int gi2/0

description "Global TO P-router"

ip add y.y.y.y/30

int Gi2/0.1

description "VRF TO P-router"

encap dot 10

ip vrf for test

router ospf 1

router-id y.y.y.?

network area 0

router ospf 2 vrf test

redis connected subnet tag 1234 !

router-id x.x.x.x

network area 0


This Discussion