BGP to OSPF redistribution

Unanswered Question
Oct 15th, 2008


I am trying to redistribute BGP routes to OSPF. BGP and OSPF is running on PE router, OSPF only on CE router. Routers are connected via IP tunnel.

I have following configuration:


router ospf 120 vrf szdc_global


redistribute connected subnets

redistribute static subnets

redistribute bgp 64512 subnets

network area 12

router bgp 64512


address-family ipv4 vrf szdc_global

redistribute connected

redistribute static

redistribute ospf 120 vrf szdc_global match internal external 1 external 2 nssa-external 1 nssa-external 2

default-information originate

bgp redistribute-internal

no auto-summary

no synchronization


and on CE router:

router ospf 120 vrf szdc_global


redistribute connected subnets

redistribute static subnets

network area 12

routing table of vrf szdc_global on PE router: is variably subnetted, 8 subnets, 3 masks

C is directly connected, Loopback5

B [200/0] via, 4d23h

B [200/0] via, 4d22h

B [200/0] via, 4d22h

B [200/110] via, 03:54:03

C is directly connected, Tunnel10

C is directly connected, GigabitEthernet0/1.194

B is directly connected, 4d23h, GigabitEthernet0/1.193

S* [1/0] via

and on CE router: is variably subnetted, 4 subnets, 3 masks

O [110/11112] via, 01:17:06, Tunnel0

O E2 [110/1] via, 01:17:06, Tunnel0

C is directly connected, Tunnel0

O [110/11112] via, 01:17:06, Tunnel0

How is it possible, that is redistributed, and (for example) is not? Can't see the diffrence.

Thanks in advance,


I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Marwan ALshawi Wed, 10/15/2008 - 03:06

u can use prefix list wirh route-map to deny what ever subnet/prefix to be redistributed

then use this route map in the redistribution command for example

ip prefix-list list1 seq 10 permit

route-map bgp-ospf deny 10

match ip address prefix-list list1

route-map bgp-ospf permit 20

redistribute bgp 64512 subnets route-map bgp-ospf

note: the second route map with sequence number 20 important because first one deny the match traffic the second one permit all other

and u can put what ever prefixes u want

good luck

if helpful Rate

x_plana01 Wed, 10/15/2008 - 03:16

Yeah, sure, I can use route-maps to filter prefixes, which I need to redistribute. But if I don't use any route-map, all prefixes should be redistributed by default...? Or am I mistaken here?

Giuseppe Larosa Wed, 10/15/2008 - 07:47

Hello Martin,

first of all I would try to change the redistribute command within AF ipv4 vrf szdc_global.

I would change it to:

redistribute ospf 120 vrf szdc_global

(actually in my IOS was only red ospf 120 there was a change in syntax for supporting up to 32 ospf processes for each VRF :

and then on CE

router ospf 120 vrf szdc_global

capability vrf-lite

see the notes below and the link

Second note:

if you have other VRF sites using the OSPF as PE-CE link you are probably using different OSPF process-ids in different PE routers because I see the imported prefix as O E2 instead of O IA.

In my tests and in documents the OSPF area between PE and CE is area 0 so to let the PE build the "superbackbone area"

another difference I used O E1 routes:

red bgp 16232 metric-type 1 subnets

To compare the two prefixes and do the following on PE :

show ip bgp vpvn4 all

show ip bgp vpvn4 all


sh ip route vrf szdc_global

sh ip route vrf szdc_global

check to see if there is the following sentence imagine the changes for your scenario:

Routing entry for

Known via "bgp 16232", distance 200, metric 2, type internal

Redistributing via ospf 6762

>> Advertised by ospf 6762 metric-type 1 subnets

the key word is advertised.

If it is missing for the prefix not redistributed you need to find out why it is so because there are no route-filters

I just see that there are also examples using an area different from 0 between Pe-CE so this is not a valid argument.

If you are using a MultiVRF CE you may need:

router ospf 120 vrf szdc_global

capability vrf-lite

as explained in:

Hope to help



This Discussion