BGP Notes – Path Decision
This is required blogging…and reading for that matter. A good chunk of this is taken from my CCNP posts from last year. Corrections, please.
—–
How does a BGP router decide which BGP route is the best?
Next-hop : Does the router have a route to the next-hop?
Weight : This is a numeric value where bigger is better. Weight is not passed onto other peers and is a Cisco proprietary feature.
LOCAL_PREF : This is a numeric value where bigger is better. All iBGP peers pass this value around amongst themselves.
Local : Is the next hop me (0.0.0.0)?
AS_PATH length : This is the number of AS hops to the destination. If you don’t know this one by now, then you missed something big.
: This is the number of AS hops to the destination. If you don’t know this one by now, then you missed something big.
ORIGIN : Did this route come from a netowork statement in an IGP (I), from EGP (E, which shouldn’t exist any more), or somewhere else (?) like a redistributed route? I is better than E is better than ?.
MED : The Multi Exit Discriminator can be used by one AS to influence routes to that AS. The smaller the better.
Neighbor type : eBGP are better than iBGP routes.
IGP metric : Prefer the next-hop address that’s closest via an IGP like OSPF or EIGRP (or RIP, Ivan).
Route age : Prefer the oldest (and, thusly, the most stable) route.
Lowest BGP neighbor router ID : Do I have to explain that one?
Lowest BGP neighbor IP : You know what this is, right?
- Generating Network Diagrams from Netbox with Pynetbox - August 23, 2023
- Out-of-band Management – Useful Beyond Catastrophe - July 13, 2023
- Overlay Management - July 12, 2023
The only slight addition I’d make is on the ORIGIN decision, in that IGP actually refers to routes generated by the “network” command, whereas INCOMPLETE refers to routes redistributed in.
You’re absolutely right, Stuart. That correction has been made.
It’s quite odd but we do have several routes with that have an origin code of “e”
Don’t ask me why I don’t know but someone somewhere is using the e
Yes, I have noticed that too. There’s whole bunch of them out in internet wild as well. Since you can change them with route-map. my assumption is they are tagged like this for specific purpose of path selection or filtering.
The ORIGIN description is still a bit off. ” “means it came from a BGP “network” statement whereas it reads as though it comes from a network statement under an IGP which makes you think OSPF, EIGRP etc.
Loving the quick notes though, great refreshers!
L