cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1887
Views
0
Helpful
3
Replies

BGP to OSPF redistribution

x_plana01
Level 1
Level 1

Hello,

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:

PE:

router ospf 120 vrf szdc_global

log-adjacency-changes

redistribute connected subnets

redistribute static subnets

redistribute bgp 64512 subnets

network 10.12.0.0 0.0.255.255 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

exit-address-family

and on CE router:

router ospf 120 vrf szdc_global

log-adjacency-changes

redistribute connected subnets

redistribute static subnets

network 10.12.0.0 0.0.255.255 area 12

routing table of vrf szdc_global on PE router:

10.0.0.0/8 is variably subnetted, 8 subnets, 3 masks

C 10.12.254.222/32 is directly connected, Loopback5

B 10.16.254.201/32 [200/0] via 10.251.254.16, 4d23h

B 10.80.254.200/32 [200/0] via 10.251.254.80, 4d22h

B 10.80.251.32/30 [200/0] via 10.251.254.80, 4d22h

B 10.80.200.0/24 [200/110] via 10.251.254.80, 03:54:03

C 10.12.251.92/30 is directly connected, Tunnel10

C 10.12.194.0/24 is directly connected, GigabitEthernet0/1.194

B 10.12.193.0/24 is directly connected, 4d23h, GigabitEthernet0/1.193

S* 0.0.0.0/0 [1/0] via 10.12.194.2

and on CE router:

10.0.0.0/8 is variably subnetted, 4 subnets, 3 masks

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

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

C 10.12.251.92/30 is directly connected, Tunnel0

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

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

Thanks in advance,

Martin

3 Replies 3

Marwan ALshawi
VIP Alumni
VIP Alumni

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 10.80.254.200/32

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

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
Hall of Fame
Hall of Fame

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 :

http://www.cisco.com/en/US/docs/ios/12_3t/12_3t4/feature/guide/gtospfvf.html)

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 10.16.254.201/32 and 10.12.254.200/32 do the following on PE :

show ip bgp vpvn4 all 10.12.254.200

show ip bgp vpvn4 all 10.12.254.201

and

sh ip route vrf szdc_global 10.12.254.200

sh ip route vrf szdc_global 10.12.254.201

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

Routing entry for 172.16.60.11/32

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:

http://www.cisco.com/en/US/docs/ios/12_0st/12_0st21/feature/guide/ospfvrfl.html#wp1038874

Hope to help

Giuseppe

Review Cisco Networking products for a $25 gift card