A layered checklist for BGP neighbor troubleshooting
Separate BGP transport, session, policy, and route-advertisement problems with a repeatable peer checklist.
Routing / Field note
Learn how BGP compares routes to the same network, how policy changes the result, and how to check the selected path.
BGP can learn several routes to the same network. It then selects a preferred route using policy and path attributes. This process is often called best-path selection.
The selected route is not always the physically shortest or fastest route. A network team may prefer one provider because of cost, capacity, security, or business agreements. BGP follows the policy configured by the network operator.
This guide uses a Cisco-style example to explain the common decision points. The exact order and some tie-breaks can differ between vendors, software versions, and configuration.
Routers use longest-prefix match to forward each packet. If a destination matches both 192.0.2.0/24 and 192.0.2.128/25, the /25 is more specific and wins for addresses inside that range.
That is separate from BGP best-path selection. BGP compares candidate routes for the same prefix. So first confirm that the routes you are comparing are for the same network.
Before comparing preferences, a router must be able to use a route. A route may be removed by an import policy, rejected by validation policy, contain the router's own AS in its AS_PATH, or have an unreachable next hop. Such a route cannot become the usable best path.
For this reason, “the router learned the route” does not always mean “the router can forward traffic through it.”
Corp-X router X1 (AS 64531) learns 192.0.2.0/24 through two providers. Path A comes from ISP-B (AS 64520), and Path B comes from ISP-C (AS 64540). Both routes are eligible, and both next hops are reachable. In the default scenario, both have Local Preference 100, and both AS_PATH values have two AS numbers. Path A wins because its IGP cost to next hop 10.0.2.1 is 10, lower than Path B's cost of 20 to 10.0.4.1.
The Local Preference preset changes this result: Path B's value becomes 200, while Path A stays at 100. Path B then wins at the Local Preference check, before IGP cost is considered. Local Preference is an internal policy signal: a larger number is preferred.
The list below is a simplified Cisco-style order. It helps explain many route choices, but it is not a universal sequence for every BGP implementation.
Some implementations offer additional controls such as AIGP or configurable comparison behavior. Consult the vendor documentation for the exact order on your routers.
Local Preference is used inside one autonomous system (AS). In the simulator, Corp-X AS 64531 receives Path A from ISP-B with value 100 and Path B from ISP-C with value 100. The Local Preference preset raises Path B to 200, so Corp-X prefers ISP-C. These are example policy values, not protocol defaults.
Local Preference mainly affects outbound traffic leaving your AS. It does not directly command another AS to send traffic to you.
AS_PATH records the autonomous systems a route passed through. In the default simulator scenario, Path A has 64520 64512; Path B has 64540 64512. Both paths contain two AS numbers, so AS_PATH does not decide that result. In the AS_PATH preset, Path A is prepended twice and becomes longer, so Path B wins at this check. Prepending may influence other networks' inbound choices, but those networks remain free to use their own policies.
Multi-Exit Discriminator (MED) is a hint that can help a neighboring AS choose an entry point to your network. Lower is generally preferred. The simulator's MED preset sets Path A to 50 and Path B to 10, and turns on an explicit comparison across ISP-B and ISP-C. Many implementations compare MED only for routes learned from the same neighboring AS by default, so this preset is a teaching override rather than a universal default.
MED is a suggestion, not a guarantee. The receiving network controls its own route policy.
NEXT_HOP identifies where traffic should go next. It is a reachability requirement, not simply a “higher is better” preference value. At Corp-X X1, Path A uses next hop 10.0.2.1 and Path B uses 10.0.4.1. If X1 cannot resolve a next hop, it cannot use that path. With iBGP, the next hop is often preserved; next-hop-self is commonly used to make an internal router advertise itself as the next hop.
RPKI origin validation can label a route Valid, Invalid, or NotFound. Operators may use that result in policy to reject a route or change its preference. RPKI validation is not a universal extra step in the BGP best-path list; its effect depends on the network's configuration.
Some networks install multiple equal or sufficiently similar paths for load sharing, often called multipath or ECMP. This is a platform and policy feature. It does not mean that every BGP router forwards over every route it learns.
Also distinguish the BGP best path from the route used for forwarding. A platform may select a BGP path that then loses to another routing source under its route-preference rules. Check both the BGP table and the main routing table.
On Cisco IOS-style equipment, these commands can help. Other platforms use different commands and output formats.
show ip bgp 192.0.2.0/24
show ip route 192.0.2.0
show ip bgp neighbors 10.0.2.1 received-routes
show ip bgp neighbors 10.0.4.1 received-routesStart with the exact prefix. Then check which paths are present, whether each next hop is reachable, and whether import policy or route validation removed a candidate. Compare the attributes in the platform's best-path order; the first meaningful difference often explains the decision. Finally, check whether the chosen BGP path was installed for forwarding.
Quick answers about BGP route choices, path attributes, and traffic direction. Open a question to see the answer.
4 answersDoes BGP choose the route with the lowest latency?
No. BGP does not normally measure end-to-end latency as its basic best-path rule. Policy, path attributes, and the internal cost to the next hop influence selection. A team can build latency-aware policy, but it must configure or add that behavior.
Does a shorter AS_PATH always win?
No. Attributes earlier in the configured decision order can decide the result first. In the example above, ISP-B wins on Local Preference even though its AS_PATH is longer.
Can I use Local Preference to control traffic coming into my AS?
Local Preference controls route choice inside your own AS, so it mainly affects traffic leaving your AS. To influence inbound traffic, operators may use tools such as AS_PATH prepending or MED, but the neighboring networks make the final decision.
Will every router select the same path?
Not necessarily. Routers can receive different routes or have different policies and configurations. Local Preference is normally shared across an AS through iBGP, but other inputs and route-reflector design can still affect what each router knows and selects.
Continue reading
Separate BGP transport, session, policy, and route-advertisement problems with a repeatable peer checklist.
Learn what BGP does, how autonomous systems and peers exchange routes, and then explore interactive route selection, configuration, and practice.
Use Local Preference, AS_PATH, and MED to guide BGP traffic while understanding what each network controls.
Reader signal
Your feedback helps shape the next field note and lab.
Views count when this page opens. You can change or remove your vote during this tab session.