06-02-2014 10:06 AM - edited 03-04-2019 11:04 PM
Hello:
I have a little ISP with 3 routers.
The ISP is running OSPF as Interior Routing Protocol. One router have one client directly connected and i have included the client IP into OSPF using redistribution. I have redistributed connected routes into OSPF.
Then the same router is running BGP and the configuration of BGP is redistribute OSPF into BGP.This is not working for my scenario.
If I switch one other router of the ISP this router learns de route of the client by OSPF and redistributes it correctly into BGP and it works well.
I think that redistribute connected routes into OSPF is not a good idea because the router takes the connected route to put it in the routing table because of the administrative distance. So if the route is not in the routing table as learned by OSPF the OSPF redistribution into BGP dos not works.
If I quit the redistribute connected into OSPF and I put network command for the Client IP and make this interface passive all works Ok. So in this case also the route to the client isn’t in the routing table as learned by OSPF so i’m not sure if my suspect of the last paragraph is correct.
Ah, I have also tryed to make the redistribution of OSPF into BGP using the math internal external 1 external 2 command.
So more than a solution of this I want the exact explain of the problem. Thank you very much for your help.
With regards, Juan
Solved! Go to Solution.
06-04-2014 02:27 AM
Hi,
yes, you are correct, I've forgotten this OSPF feature.
It's mentioned here:
http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/5242-bgp-ospf-redis.html
"Both Intra and Inter-Area routes are also called OSPF Internal routes, as they are generated by OSPF itself, when an interface is covered with the OSPF network command."
So you could test if redistributing OSPF internal routes only will still put them to the BGP table.
Best regards,
Milan
06-03-2014 09:04 AM
Hi there
below command only redistribute OSPF Intra/Inter Area routes which are O or IA in the routing table because these routes are native to OSPF and learned via OSPF protocol
router bgp 100
redistribute ospf 1
while below command, redistributes OSPF external routes which could be learned by another routing protocol and redistributed in OSPF. without below match commands it will not work
router bgp 100 redistribute ospf 1 match external 1 external 2
06-03-2014 11:13 PM
Hi,
it was told in the original post:
"...I have also tryed to make the redistribution of OSPF into BGP using the math internal external 1 external 2 command."
IMHO, the root problem cause is the fact that static or directly connected routes redistributed to OSPF on a router remain static/connected in the router RIB.
They are not considered OSFP external from the redistribution point of view!
So will not get redistributed from OSPF to BGP.
Am I clear now?
Best regards,
Milan
06-04-2014 12:24 AM
Hi Milan,
I think i was in haste to reply before i leave for the day. Your observation is correct as connected routes will show up as "C" on the router even if they are redistributed.
Hence to redistribute the connected routes in BGP, one needs to redistribute connected routes in BGP, better with route-map to control what goes into BGP table.
Cheers mate and thanks for the correction
Hitesh
06-03-2014 11:15 PM
Hi,
if you use
network .... mask ...
command within your BGP configuratiopn section, it puts that subnet to your BGP table in a case it's present in your RIB.
No matter how it got into the RIB - static, directly connected, from any routing protocol.
If you use
redistribute ospf ...
command within your BGP configuratiopn section, only routes which are in your router RIB sourced from OSPF are redistributed to the BGP table.
So if there is an external OSPF route (received from other router) in your RIB, it could be redistributed.
BUT if you redistribute a static or connected route to OSPF on your router, it's still in your RIB as a static/connected one. So will not be redistributed from OSPF to BGP!
Best regards,
Milan
06-04-2014 12:56 AM
Hello:
Thank you for your reply.
If I understand well the route is not redistributed into BGP because the route is not in the routing table as learned from OSPF.
So if I add the route to OSPF via the network command the route is not in the routing table learned from OSPF but the route is redistributed into BGP well. I think that this last point is unclear for me.
Is this the answer to last point ?
"below command only redistribute OSPF Intra/Inter Area routes which are O or IA in the routing table because these routes are native to OSPF and learned via OSPF protocol"
Also say you that I appreciate so much your help. This answers help me to finish my final career project.
If some of you have knowledge of MPLS could you please take a look at this: https://supportforums.cisco.com/discussion/12221026/ospf-area-range-and-mpls
Thank you very much
06-04-2014 01:13 AM
Hi,
regarding your ".. if I add the route to OSPF via the network command the route is not in the routing table learned from OSPF but the route is redistributed into BGP well."
If you add the route to OSPF via the network command used in
router ospf ...
section, it will not get redistributed into BGP.
If you use
network ... mask ...
command under
router BGP ...
section, it will get into the BGP table.
Do you undersatnd the difference between the "network ... " command usage under "router BGP" and "router OSPF" sections?
Best regards,
Milan
06-04-2014 01:19 AM
Hello Milan:
With this phrase I'm refering to the OSPF network command (under router ospf).
"So if I add the route to OSPF via the network command the route is not in the routing table learned from OSPF but the route is redistributed into BGP well"
I have try it and this is true. In a router that have the redistribute connected subnets (under router bgp) the route is not redistributed into BGP) but if I add it to OSPF with the network command under the router ospf section the route is redistributed into BGP.
Thanks for your help.
06-04-2014 02:27 AM
Hi,
yes, you are correct, I've forgotten this OSPF feature.
It's mentioned here:
http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/5242-bgp-ospf-redis.html
"Both Intra and Inter-Area routes are also called OSPF Internal routes, as they are generated by OSPF itself, when an interface is covered with the OSPF network command."
So you could test if redistributing OSPF internal routes only will still put them to the BGP table.
Best regards,
Milan
06-04-2014 09:16 AM
Hello:
Thanks you very much for your interest and clarification. This helped me so much.
If you have time I have posted here a Question about network command...https://supportforums.cisco.com/discussion/12223191/exclude-network-using-bgp-network-command
With regards, Juan
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide