BGP Commands Cheat Sheet
BGP Commands Cheat Sheet
router bgp <ASN> Enables BGP and sets the local AS number
redistribute <protocol> Redistributes routes from another protocol (OSPF, EIGRP, etc.) into BGP
show ip bgp summary Displays BGP neighbor status and session states
show ip bgp neighbors <neighbor-IP> received-routes Displays routes received from a neighbor
show ip bgp neighbors <neighbor-IP> routes Displays the BGP table entries received from a
neighbor
https://chatgpt.com/share/67a5f973-c768-800f-a17c-e02a14553b17 1/10
2/12/25, 1:25 AM BGP Commands Cheat Sheet
Command Purpose
neighbor <IP> route-map <name> in/out Applies a route map to influence incoming/outgoing routes
neighbor <IP> next-hop-self Sets the router as the next-hop for advertised routes
bgp bestpath as-path ignore Ignores AS-path length for path selection
bgp default local-preference <value> Sets the default local preference (higher = preferred)
neighbor <IP> route-map <name> in Modifies MED (Multi-Exit Discriminator) to influence inbound traffic
https://chatgpt.com/share/67a5f973-c768-800f-a17c-e02a14553b17 2/10
2/12/25, 1:25 AM BGP Commands Cheat Sheet
Command Purpose
This cheat sheet covers essential BGP commands and their uses. Let me know if you need more details!
show ip bgp summary Displays BGP neighbor states, prefixes, and hold timers.
show ip bgp neighbors <neighbor- Shows detailed BGP neighbor information, including capabilities and
IP> messages exchanged.
show ip bgp neighbors <neighbor-IP> Checks the FSM (Finite State Machine) state of a neighbor. Should
state be Established if operational.
show ip bgp neighbors <neighbor-IP> Checks keepalive and hold timer values for mismatches.
timers
show ip bgp neighbors <neighbor-IP> Verifies TCP connection issues (useful for checking MTU mismatches).
transport
If neighbor is stuck in Active → Check TCP port 179 connectivity ( telnet <neighbor-IP> 179 ).
https://chatgpt.com/share/67a5f973-c768-800f-a17c-e02a14553b17 3/10
2/12/25, 1:25 AM BGP Commands Cheat Sheet
If neighbor keeps flapping → Investigate high CPU, unstable links, or interface errors ( show
interfaces <interface> ).
show ip bgp neighbors <neighbor-IP> Displays all routes received from a neighbor (needs soft-
received-routes reconfiguration inbound enabled).
show ip bgp rib-failure Shows routes that failed to install into the routing table.
show bgp all dampening parameters Checks if routes are suppressed due to route dampening.
If a route is not installed in the routing table → Check show ip bgp rib-failure .
If MED or local preference is incorrect → Check show ip bgp <prefix> and look for attributes
influencing path selection.
clear ip bgp <neighbor-IP> soft Performs a soft reset (recommended over hard reset).
https://chatgpt.com/share/67a5f973-c768-800f-a17c-e02a14553b17 4/10
2/12/25, 1:25 AM BGP Commands Cheat Sheet
If routes are being filtered, check show ip bgp neighbors <neighbor-IP> advertised-
routes and received-routes .
4. Debugging BGP
Command Purpose
debug ip bgp keepalives Monitors keepalive messages (useful for session drops).
If updates are missing → Use debug ip bgp updates to verify if prefixes are being sent/received.
If dampening is suppressing routes → Use show bgp all dampening parameters and disable
dampening if necessary.
show tcp brief Checks active TCP sessions, including BGP (port 179).
show ip bgp neighbors <neighbor-IP> transport Displays TCP-related settings like MSS and MTU.
ping <neighbor-IP> df-bit size <MTU> Checks MTU mismatches (DF-bit prevents fragmentation).
If MTU mismatch is suspected → Use ping <neighbor-IP> df-bit size <MTU> and adjust MTU
settings if needed.
Command Purpose
show ip bgp neighbors <neighbor-IP> Checks if any policy is applied (route-map, prefix-list, AS-path
policy filter).
show route-map <name> Checks applied route maps and match/permit/deny conditions.
If a route is not received → Check inbound filters ( show ip bgp neighbors <neighbor-IP>
received-routes ).
show ip bgp paths Displays all paths received for each prefix.
show ip bgp bestpath Explains why a specific route was chosen as the best path.
If ECMP (Equal Cost Multi-Path) is needed → Ensure maximum-paths <value> is configured under
BGP.
Final Notes
✅ Use soft clear ( clear ip bgp <neighbor-IP> soft ) instead of hard resets.
✅ Use debugging commands cautiously in production (can cause high CPU load).
✅ Check route filtering policies if routes are missing or not propagating.
✅ Monitor TCP and MTU settings if sessions fail to establish.
https://chatgpt.com/share/67a5f973-c768-800f-a17c-e02a14553b17 6/10
2/12/25, 1:25 AM BGP Commands Cheat Sheet
This cheat sheet covers key break-fix BGP troubleshooting commands. Let me know if you need more
details!
Example:
Example:
https://chatgpt.com/share/67a5f973-c768-800f-a17c-e02a14553b17 7/10
2/12/25, 1:25 AM BGP Commands Cheat Sheet
Example:
Example:
https://chatgpt.com/share/67a5f973-c768-800f-a17c-e02a14553b17 8/10
2/12/25, 1:25 AM BGP Commands Cheat Sheet
Example:
Example:
Example:
https://chatgpt.com/share/67a5f973-c768-800f-a17c-e02a14553b17 9/10
2/12/25, 1:25 AM BGP Commands Cheat Sheet
Example:
Verification Commands
Command Purpose
show ip bgp neighbor <IP> advertised-routes Checks which routes are advertised to a neighbor.
show ip bgp neighbor <IP> received-routes Checks routes received from a neighbor.
https://chatgpt.com/share/67a5f973-c768-800f-a17c-e02a14553b17 10/10