BGP Configuration and Troubleshooting Guide
Border Gateway Protocol (BGP) is the routing protocol used between autonomous systems and inside many large enterprise WAN designs. This guide focuses on neighbor formation, route policy, path selection, and troubleshooting.
In This Lesson
Configure and troubleshoot BGP by separating session formation, route advertisement, path selection, and forwarding. The workflow keeps policy changes controlled and verification evidence clear.
Quick Learning Map
Keep this three-step view in mind as you work through the detailed lesson.
Form the neighbor session
Check reachability, AS numbers, source addresses, and neighbor state.
Exchange and select routes
Verify network statements, policy, attributes, and the chosen best path.
Prove forwarding
Confirm the route reaches the RIB and FIB, then test the real traffic path.
BGP Configuration and Troubleshooting Guide at a Glance
Use this summary before moving into the detailed explanations, examples, commands, and checks.
Core focus
Configure and troubleshoot BGP by separating session formation, route advertisement, path selection, and forwarding.
Key connection
Form the neighbor session → Exchange and select routes → Prove forwarding
Practical outcome
The workflow keeps policy changes controlled and verification evidence clear.
1. What BGP Is Used For
BGP exchanges reachability between autonomous systems and gives engineers strong control over routing policy.
Unlike an interior routing protocol, BGP does not calculate the shortest physical path from link costs. It selects among policy-rich paths using attributes and requires an administrator to define neighbors and permitted routes. This makes it suitable for ISP connections, multihoming, large WAN boundaries, and controlled route exchange between administrative domains.
2. Neighbor Basics
BGP does not discover neighbors automatically. Configure each peer and remote AS explicitly.
- router bgp 65001
- neighbor 203.0.113.2 remote-as 65002
- network 198.51.100.0 mask 255.255.255.0
The peers need IP reachability and an allowed TCP port 179 session. The configured source address, remote address, AS numbers, authentication, TTL, and address family must agree. A network statement advertises a prefix only when the exact route and mask already exist in the local routing table; it does not create that route.
3. iBGP Design Rules
iBGP peers use the same AS and often peer with loopbacks. Full mesh, route reflectors, or confederations solve iBGP scaling.
- Use update-source Loopback0.
- Ensure loopback reachability with an IGP.
- Use next-hop-self at edge routers.
A route learned from one iBGP peer is not advertised to another iBGP peer by default. Small networks can use a full mesh; larger ones normally use route reflectors. Reflector clients and cluster IDs must be planned so redundancy does not create loops or hide alternate paths. The IGP must still provide reliable reachability to BGP next hops and loopbacks.
4. Path Attributes
BGP path selection commonly uses weight, local preference, AS path, origin, MED, and next-hop reachability.
- Higher local preference wins.
- Shorter AS path is preferred later.
- Reachable next hop is mandatory.
- Keep policies simple and documented.
Policy should express an operational intent such as preferring one exit, limiting customer routes, or preventing transit. Use prefix lists, route maps, and communities with explicit permit and deny behavior. Test exact and more-specific prefixes because an incorrectly broad match can leak routes or remove reachability.
BGP Configuration and Troubleshooting Guide: 5. Troubleshooting Workflow
Split BGP issues into session state, route receipt, best-path selection, and route advertisement.
- show ip bgp summary
- show ip bgp neighbors
- show ip bgp
- show ip route bgp
An Established session with no prefixes is a different failure from a neighbor stuck Active. For a missing route, prove whether it exists locally, enters BGP, passes outbound policy, arrives at the peer, passes inbound policy, wins best-path selection, and enters the routing table. Use soft route refresh where supported instead of resetting every neighbor.
Operational BGP Notes
BGP troubleshooting becomes calmer when the session and the route are treated as separate questions. A neighbor can be established while the expected prefix is missing because of address-family activation, policy, next-hop handling or route selection. Conversely, a route may be present in the table while the session is unstable and repeatedly reconverging.
Before changing policy, record the current neighbor state, received prefixes, advertised prefixes, best-path reason and relevant counters. Compare both sides of the session when possible. A prefix that is not advertised is a policy question; a prefix that is advertised but not selected is a path-selection question.
Make one controlled change at a time and use a route-refresh or soft policy method where supported. Avoid clearing a busy production session as a first diagnostic step. Preserve the evidence so the final fix can be explained and repeated safely.
BGP Configuration and Troubleshooting Guide: Frequently Asked Questions
What port does BGP use?
BGP uses TCP port 179.
What is eBGP?
eBGP runs between different autonomous systems.
Why is my BGP route not advertised?
Common causes include missing source route, policy filtering, or incorrect network mask.
Production safety checklist
Apply inbound and outbound prefix limits, bogon and ownership filters, route-policy review, peer authentication where supported, logging, and alerting for session or prefix-count changes. Validate policy with test prefixes or an offline lab before deployment. Avoid clear ip bgp * because it withdraws routes from all peers; target the affected neighbor and use an approved maintenance window when a hard reset is unavoidable.