cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2151
Views
0
Helpful
8
Replies

Redistribute certain bgp route into ospf

miked
Level 1
Level 1

Greetings,

I'm running bgp with a customer inside my network. I can bring bgp up fine, I see the correct advertisements, as well as the correct routes in bgp. But I'm having an issue getting there specifc router into my ospf table or ip route table.

Ospf is up and running, if I add a static route some where in my network to the customers IP's it shows up in ospf and I can ping. But, this is part of a failover configuration with this customer and I ned to avoid a static route.

I've tried a few different ways to redistribute the bgp route into ospf using different route-map senario's. When I do this and do a "show ip route" for the block I see it redistributing the block (for the record, these are not the real IP addresses):

CORE#sho ip route 172.16.0.0

Routing entry for 172.16.0.0/16

  Known via "bgp 100", distance 20, metric 0

  Tag 200, type external

  Redistributing via ospf 100

  Last update from 10.1.1.1 00:11:28 ago

  Routing Descriptor Blocks:

  *10.1.1.1 00, from 10.1.1.1 00, 00:11:28 ago

      Route metric is 0, traffic share count is 1

      AS Hops 1

So, it says it's known by bgp and redistributed by ospf. But I still have no route in my network for it.

If I run a "show ip route" command on another router (that's as neighbor in the ospf process/area) I do not see the route for 172.16.0.0. I see all the other routes from around the network, just not this redistributed route.

I've used these two ways to get the route from bgp to ospf.

------

This is the first way

ip access-list BGPROUTE-TO-OSPF

permit ip 172.16.0.0 0.0.255.255 any

route-map BGPROUTE-TO-OSPF

match policy-list BGPROUTE-TO-OSPF

router ospf 100

redistribute bgp 100 route-map BGPROUTE-TO-OSPF

-------

And the second way is this:

access-list 10 remark ACL for BGPROUTE-TO-OSPF route map

access-list 10 permit 172.16.0.0 0.0.255.255

route-map BGPROUTE-TO-OSPF permit 10

match ip address 10

router ospf 100

redistribute bgp 100 route-map BGPROUTE-TO-OSPF

------

Both produce the same results, I see the block known by bgp and redistributed via ospf, but nothing shows up in my route table.

Can you help me with what I am missing here?

Thanks in advance for your time!

8 Replies 8

Marwan ALshawi
VIP Alumni
VIP Alumni

if the route 172.16.0.0/16 in BGP then use the bellow config

do show ip bgp 172.16.0.0

once confirmed then:

access-list 10 remark ACL for BGPROUTE-TO-OSPF route map

access-list 10 permit 172.16.0.0 0.0.255.255

route-map BGPROUTE-TO-OSPF permit 10

match ip address 10

router ospf 100

redistribute bgp 100 route-map BGPROUTE-TO-OSPF subnets

HTH

I believe the configuration mentioned above will work.

Regards, Sunil Khanna

Thanks, I had tried the adding the subnets attribute in before with no luck, and just tried it again. The route still isn't getting in the route table locally (other than the bgp entry) or across the network. Not sure where to go from here.

Hi,

can you show us the output of sh ip bgp 172.16.0.0 as well as sh run | s router bgp and sh run | s router ospf

You said you were running BGP with the customer in your network but the BGP prefix is advertised via eBGP because it has a AD of 20 so it comes from another AS

If it was an iBGP route then you'd have to issue fomllowing command: bgp redistribute internal under BGP process

Regards.

Alain.

Don't forget to rate helpful posts.

ok even when you redistribute it in the router you doing redistribution in it will remain in the routing table as BGP because you learn it via BGP not through any other sources

however after redistribution you should see in other OSPG peers

can you please do the following

- make sure both OSPF and BGP in that router has the same router-ID

-make sure BGP synchronization disabled

- when you redistribute you have the subnets command

- post the following show command result after doing the above

from the router you doing redistribute in

- show ip bgp 172.16.0.0

- show ip route 172.16.0.0

- show ip ospf database external 172.16.0.0

form a OSPS niehbor router

- show ip route 172.16.0.0

- show ip ospf database external 172.16.0.0

also if you can post you routing conifg will be better

HTH

Wanted to know if the issue persists or is it resolved?If resolved..how and what changes did you made???

Regards,

Sunil

Regards, Sunil Khanna

Hey guys, thanks for the help. I was doing this config in GNS3 and realized Wednesday afternoon there happens to be a bug with the 2621 emulation particularly with my IOS redistributing routes, arrrggg!!!

Anyways, I rebuilt the network mockup with all 7200's and I see the route being redistributed but now...

looking across the routers on the network the block is in the route table via ospf but the gateway it is showing is the address of my peer in the bgp config. So when a packet is destine for the 172.16.0.0 network what ever router it's sent from sends the packet to my peer instead for the router they are actually connect to, 10.1.1.1.

When I debug icmp from my bgp peer I get this:

*Sep  1 16:18:33.422: ICMP: bogus redirect from 11.1.1.2 - for 172.16.0.1 use gw 11.1.1.1

*Sep  1 16:18:33.426:       gateway address is one of our addresses.

This is the topology of my mockup:

mybgppeer-as100-ospf100

11.1.1.1

|

|

11.1.1.2

aggregaterouter-ospf100

10.1.1.2

|

|

10.1.1.1

customerrouter-as200

172.16.0.0/16

Using the topology mybgppeer-as100-ospf100 is seeing the 172.16.0.0/16 block routed to 10.1.1.1 but when redistributed in ospf the aggregaterouter-ospf100 device is seeing the gateway as 11.1.1.1. So, the packets never make it to the customerrouter-as200.

how many links you have between the routers where you doing redistribution in AS 100

i fyou can post a simple topology with your config will be much better