07-25-2013 09:16 AM - edited 03-07-2019 02:35 PM
Could somebody help me understand the network and redistribute commands as used in context of BGP?
Solved! Go to Solution.
07-28-2013 02:59 AM
Hi,
Yes you're correct only the BGP best routes(in the BGP table) will be advertised not taking filtering into account of course.
Then the peer receiving the routes(if they are not filtered) will install them in the RIB if it doesn't know about them from a source with a better AD.
Regards
Alain
Don't forget to rate helpful posts.
07-25-2013 09:27 AM
The network command will check prefixes from the Route Table and add it to the BGP table.
The redistribute command will check prefixes from the Route Table, depending of what protocol are you redistributing (OSPF, RIP, IS-IS, EIGRP connected, statics...) from, and add it to the BGP table.
One of the differences is that the Origin attribute by default will be IGP in case of the Network command and Incomplete in case of redistribution.
The Network command gives you better control about what prefixes you would like to add. On the other hand, redistribution could be better in case you want to add a lot of prefixes and using the network command for every prefix would be cumbersome.
Hope this helps,
Jose.
07-25-2013 09:47 AM
Thanks Jose.
Suppose I am running bgp on router A...Router A has 10.1.1.1/32 loopback on it...Router A is also learning 10/8 subnetworks using ospf...then if I do "network 10.1.1.0 mask 255.255.255.0" under router bgp configuration, what networks (if at all) will bgp advertise? What if I do "redistribute ospf 1 subnets" under router bgp configuration?
07-25-2013 10:03 AM
Hi,
if you have no auto-suumary which is the default then to inject a route in the BGP table with the network command the mask must correspond to the subnet mask in the routing table so the /32 won't get injected for sure with a mask of 255.255.255.0, only the corresponding /24s that are in the routing table will get injected.
Now if you redistribute ospf then only the OSPF routes will get injected.
if you have auto-summary then classful network will be injected but not the subnets.
Regards
Alain
Don't forget to rate helpful posts.
07-25-2013 10:17 AM
Thanks Cadet.
How does the routing information flow in this case? Specifically, how routes from routing table (known via ospf) go to bgp table and further to routing table (as bgp known routes) and in what sequence? How is the information advertised to other bgp peers?
07-25-2013 10:30 AM
HI Kashish,
In this case you have OSPF routes in the routing table say 10.0.0.0/8 as OPSF routes with an AD of 110. When you redistribute this route into BGP the same route 10.0.0.0/8 will be populated into the BGP table. The router now has the same route from two routing protocols ie OSPF and BGP and it needs to select the best route which it does based on the AD. In this case since the BGP routes are redistributed locally the AD of the 10.0.0.0/8 BG route is 200. And hence the OSPF roue wins and remains in the global routing table. So if you have a BGP peer this route will not be advertised to that peer.
HTH !!!
Regards
Umesh Shetty
07-25-2013 10:41 AM
Hi,
So if you have a BGP peer this route will not be advertised to that peer.
WRONG if this was the case what would be the use of redistribution ?
Regards
Alain
Don't forget to rate helpful posts.
07-25-2013 10:45 AM
I am confused and still looking for an answer for:
How does the routing information flow in this case? Specifically, how routes from routing table (known via ospf) go to bgp table and further to routing table (as bgp known routes) and in what sequence? How is the information advertised to other bgp peers?
07-25-2013 10:49 AM
Hi,
they stay as OSPF routes in the routing table but get injected in the BGP table then get advertised to peers that can install them as BGP in the routing table provided these BGP peers don't learn these eoutes from another protocol with better( lower) AD
Regards
Alain
Don't forget to rate helpful posts.
07-25-2013 11:05 AM
So it means that bgp will advertise best routes (from its bgp table) to its peer and it is not always that these best routes will also be present in ip routing table as bgp routes??
07-25-2013 11:04 AM
Hi Alain,
I was wrong you were right..the routes are locally originated hence will be advertised...thnx for correcting me here.
Kashish,
This document will help you in understanding basic route selection criteria in cisco routers, later on reading through redistribution will help you understand things better...
http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094823.shtml
Regards
Umesh Shetty
07-25-2013 11:35 AM
Not exactly related to this case but, by default, BGP advertises routes even though are not the best or are not in the routing table. For example:
- a prefix is learned via OSPF and internal BGP. The AD of OSPF is better 110 to 200, it will give a RIB failure but still the prefix will be propagated to the eBGP peer.
The reason why is advertising these prefixes in this case is because by default BGP sends inactive routes by default, and you may modify this behavior with: bgp suppress-inactive
http://www.cisco.com/en/US/docs/ios/12_2s/feature/guide/fs_sbair.html
Best Regards,
Jose.
07-25-2013 11:56 AM
Hi,
rib-failures can still be best routes( greater than sign), these are 2 different things and routes that are not best routes are not propagated.
Regards
Alain
Don't forget to rate helpful posts.
07-26-2013 02:03 AM
Cadet,
What I was trying to say is the best routes regarding the RIB, not BGP best routes.
Best Regards,
Jose.
07-27-2013 03:40 AM
Cadet,
Your answers have helped...Could you confirm my understanding here:
bgp propagates best routes from its bgp table to its bgp peers...And it is not always true that these best routes from bgp table will also go to routing table of that router....so the decision of what routes will be advertised is taken based on bgp table and not ip routing table?
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: