BGP troubleshooting cheat sheet
A BGP problem is almost always one of two things: the session won't come up, or the session is up but a route is missing. Work from the bottom of the stack up — link, IP reachability, TCP port 179, the OPEN exchange, then policy — and the cause usually shows itself within a few commands.
Commands are given for VyOS operational mode and for FRR's vtysh (VyOS runs FRR underneath, so the output looks the same). The linked lessons show each one with real output from a lab.
What the session state tells you
| State | What it means | Usual causes |
|---|---|---|
| Idle | Not trying: waiting to start, or held down after an error | Neighbour shut down, no route to the peer address, maximum-prefix limit hit |
| Connect / Active | Trying to open the TCP connection, failing, retrying | Wrong peer address, peer not configured for you, a firewall dropping TCP 179, no route back, eBGP to a loopback without multihop, mismatched TCP-MD5 password |
| OpenSent → Idle | TCP worked, but the OPEN was rejected | Wrong remote-as, bad router ID, unacceptable hold time, mismatched capabilities |
| OpenConfirm | OPENs exchanged, waiting for the first KEEPALIVE | Rarely stays here; if it does, keepalives are being lost |
| Established, then drops every few minutes | Keepalives lost until the hold timer expires | MTU problems on the path, policers, overloaded control plane |
The name Active misleads everyone: it means the router is actively retrying, not that the session is up. A session that flips between Connect and Active is a reachability or TCP problem, not a BGP configuration problem.
Session won't come up
- Can you reach the peer address from the address you peer from?
ping 192.0.2.1 source-address 198.51.100.1 count 3. When peering between loopbacks, both loopbacks must be in the routing table at both ends. - Is TCP 179 getting through? Capture it:
monitor traffic interface eth0 filter "tcp port 179"on VyOS,tcpdump -ni eth0 tcp port 179on Linux. SYNs with no reply point at a firewall or a peer that isn't configured; a RST means the peer refuses this source address. - Is the router's own firewall blocking it? An input filter that doesn't allow TCP 179 from the peer stops the session as surely as a remote one. Check
show firewall ipv4 input filter. - What does the session say about the last failure?
show ip bgp neighbors 192.0.2.1 | match "BGP state|Last reset"on VyOS, orshow bgp neighbors 192.0.2.1in FRR. The last reset reason and any NOTIFICATION (bad peer AS, hold timer expired, authentication) usually name the problem. - eBGP between loopbacks? eBGP packets are sent with a TTL of 1 by default and peers are expected to be directly connected; use
ebgp-multihop(ordisable-connected-checkfor directly connected loopbacks).
Session is up but a route is missing
- Did the peer send it? Compare
show ip bgp neighbors 192.0.2.1 received-routes(what arrived, before your policy; needssoft-reconfiguration inbound) withshow ip bgp neighbors 192.0.2.1 routes(what your import policy kept). A prefix in the first but not the second was filtered by you. - Is it in the table but not chosen?
show bgp ipv4 203.0.113.0/24lists every path and marks the best one. Work down the best-path order: local preference, AS path length, origin, MED, eBGP over iBGP, IGP cost to the next hop. - Is the next hop reachable? A path whose next hop can't be resolved is never best. This is the classic iBGP problem: routes learned from an eBGP neighbour keep that neighbour's address as next hop unless the border router sets
next-hop-self.show ip nhtshows what each next hop resolves through. - Is it best in BGP but not in the routing table? Another source with a lower administrative distance (a static route, OSPF) may own the prefix. Check
show ip route 203.0.113.0/24. - Are you not sending it?
show ip bgp neighbors 192.0.2.1 advertised-routesshows what leaves. A network statement only advertises a prefix that exists in the routing table exactly; an export route-map without a final permit rule sends nothing. FRR also refuses to send or accept any eBGP routes until a policy is applied, by default.
The commands
| Task | VyOS | FRR (vtysh) |
|---|---|---|
| All sessions at a glance | show ip bgp summary | show bgp summary |
| One session in detail | show ip bgp neighbors 192.0.2.1 | show bgp neighbors 192.0.2.1 |
| Every path for a prefix | show bgp ipv4 203.0.113.0/24 | show bgp ipv4 unicast 203.0.113.0/24 |
| What you send a peer | show ip bgp neighbors 192.0.2.1 advertised-routes | show bgp neighbors 192.0.2.1 advertised-routes |
| What a peer sent, after policy | show ip bgp neighbors 192.0.2.1 routes | show bgp neighbors 192.0.2.1 routes |
| Next-hop tracking | show ip nht | show ip nht |
| BFD sessions | show bfd peers brief | show bfd peers brief |
| Re-apply policy without dropping the session | — | clear bgp 192.0.2.1 soft in |
Learn the why
- BGP Fundamentals: the state machine, best-path selection and a troubleshooting walk-through on FRR.
- Setting up VyOS with basic BGP: sessions to a transit provider and an IX route server, with the policy that keeps them safe.
- BGP on loopbacks vs interface addresses: update-source, multihop and BFD.
- Debugging BGP: every session state, reproduced: every failure on this page, broken on purpose in a lab, with the real output.
- Packets That Never Come Back: capturing traffic on VyOS and Linux when something disappears.