Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

problem of conditionally redistributing one BGP route into OSPF

Due to some reason, I need to redistribute one route leart from BGP into OSPF, in order to let the hosts in my network know this route. I use the following commands.

router ospf 17357

router-id 216.x.x.10

log-adjacency-changes

redistribute connected subnets

redistribute static subnets

redistribute bgp 7367 subnets route-map ToMDC

network 67.x.x.0 0.0.31.255 area 0

network 208.x.x.0 0.0.15.255 area 0

network 216.x.x.0 0.0.31.255 area 0

default-information originate always

route-map ToMDC permit 10

match ip address prefix-list MDC_IN

ip prefix-list MDC_IN seq 10 permit 131.190.0.0/16

When I verify the result on this router with following command, everything seems OK.

EdgeRouter2#show ip route 131.190.0.0

Routing entry for 131.x.0.0/16

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

Tag 11177, type external

Redistributing via ospf 17357

Last update from 216.x.110.62 7w0d ago

Routing Descriptor Blocks:

* 216.67.110.62, from 216.x.110.62, 7w0d ago

Route metric is 0, traffic share count is 1

AS Hops 1

Route tag 11177

However, when I check on its OSPF neighbors, those ones running BGP can learn this route through iBGP, but those ones only running OSPF cannot learn this route.

Is there anyone can tell me what's the cause to this problem or tell me how to make that? Thanks a lot.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: problem of conditionally redistributing one BGP route into O

Hi

" bgp redistribute-internal " command is used when you redistribute a ibgp learned route to igp . But in your case , its a ebgp route , so no other extra config is required , it should get redistributed.

Can u try doing a " clear ip route x.x.x.x mask " for this route in your ebgp router and check.

Hope this helps

regards

vanesh k

8 REPLIES

Re: problem of conditionally redistributing one BGP route into O

Hi,

Pls let me know wheter you are receiving the default route advertised by this router in your other OSPF router.

Also see wheter it gets into ospf database

sh ip ospf database external 131.190.0.0

regards

vanesh k

New Member

Re: problem of conditionally redistributing one BGP route into O

yes, other OSPF routers can recieve the default route advertised by this router.

and this route cannot be found in the OSPF database.

Cisco Employee

Re: problem of conditionally redistributing one BGP route into O

Philipp,

Can you try to do a "clear ip ospf redistribution" to see if it fixes the issue.

Hope this helps,

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
New Member

Re: problem of conditionally redistributing one BGP route into O

yes, I did do this, but it didn't work.

I think the router may do the redistribution in this mechanism: The routes leart from eBGP will convert to iBGP first, if you want to redistribute the routes into IGP, you have to use "bgp redistribute-internal" command. Am I right?

BTW, what if I just want to redistribute some of the routes? Should I redistribute all the iBGP routes into IGP?

Re: problem of conditionally redistributing one BGP route into O

Hi

" bgp redistribute-internal " command is used when you redistribute a ibgp learned route to igp . But in your case , its a ebgp route , so no other extra config is required , it should get redistributed.

Can u try doing a " clear ip route x.x.x.x mask " for this route in your ebgp router and check.

Hope this helps

regards

vanesh k

New Member

Re: problem of conditionally redistributing one BGP route into O

The only reason why I thought about using " bgp redistribute-internal " is that other routers running both OSPF and BGP in my network will learn this route from iBGP, but only after I configure the redistributing BGP to OSPF. It's very odd, isn't it? anyway, we solve the problem, thanks a lot!

Gold

Re: problem of conditionally redistributing one BGP route into O

You really shouldn't use the redistribute internal unless you have no other option. You will end up having to mess with administrative distance on some routers to make it really work.

If I read you post correctly the routes you are redistributing are EBGP routes anyway. If you do show ip bgp you should see if they are ebgp or Ibgp.

It appears it does redistribute them into OSPF.... at least it says it does. Do a show ip ospf database external and see if the routes and in the ospf database.

You can then do the same command on one of the ospf only routers. See if the entry is in the database. If it is then you have a problem with ospf not installing the route into the routing table and that can be caused by a number of things. If it is not in the ospf database on the remote ospf routers then you must look at your design. If you are using stub or NSSA areas these routers will not get this route and that is the correct thing since they are assumed to use the default route.

Hopefull this is more helpful than confusing now that I reread this

New Member

Re: problem of conditionally redistributing one BGP route into O

The problem is sovled. Thanks a lot to network.king, your last advice is really helpful. And also many thanks to tdrais too.

When I made my first configuration and check with "show ip route 131.190.0.0" on that router, it said "Redistributing via ospf 17356". But it was not in the database when I use the command "show ip ospf database".

But thing is different with the command "clear route 131.190.0.0 255.255.0.0" adviced by network.king. The following is the result:

EdgeRouter2#show ip route 131.190.0.0

Routing entry for 131.191.0.0/16

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

Tag 11177, type external

Redistributing via ospf 17357

Advertised by ospf 17357 subnets route-map ToMDC

Last update from 216.67.110.62 00:13:00 ago

Routing Descriptor Blocks:

* 216.67.110.62, from 216.67.110.62, 00:13:00 ago

Route metric is 0, traffic share count is 1

AS Hops 1

Route tag 11177

"Advertised by ospf 17357 subnets route-map ToMDC" is really the differnece. It's very confusing, when the IOS says "redistributing", it does not mean it will "advertising".

296
Views
0
Helpful
8
Replies
CreatePlease to create content