Professional Documents
Culture Documents
BGP Extensive Cheat Sheet
BGP Extensive Cheat Sheet
BGP Basics:
BGP is the protocol used to exchange routing information between autonomous systems
(AS) on the Internet.
BGP operates on TCP (Transmission Control Protocol) port 179.
BGP is a path vector protocol, which means it makes routing decisions based on the path
attributes of different routes.
BGP uses the AS_PATH attribute to prevent routing loops and ensure loop-free paths.
Open: The initial message sent to establish a BGP connection, including version, AS
number, and optional parameters.
Keepalive: Periodic message to maintain the BGP session after the initial establishment.
Update: Carries the routing information (prefixes and attributes) between BGP neighbors.
Notification: Used to indicate an error or terminate the BGP session.
AS_PATH: Lists the ASs through which the route has passed, preventing routing loops.
NEXT_HOP: Indicates the IP address to reach the next hop towards the destination.
LOCAL_PREF: Indicates the local preference for a route within an AS, used for route
selection within the AS.
MED (Multi-Exit Discriminator): Used to influence inbound traffic by advertising
multiple exit points to neighboring ASs.
COMMUNITY: Tags used to group routes for specific policies, allowing fine-grained
route control.
BGP uses a set of rules to select the best route from multiple alternatives. The order of
preference is as follows:
1. Highest LOCAL_PREF value.
2. Shortest AS_PATH.
3. Lowest origin type (IGP < EGP < Incomplete).
4. Lowest MED value (if received from neighboring AS).
5. eBGP over iBGP (External BGP preferred over Internal BGP).
6. Lowest IGP metric to the NEXT_HOP.
7. Oldest route (the one received first).
8. Lowest router ID.
Prefix-based filtering: You can use prefix-lists or access control lists (ACLs) to filter
BGP routes based on their IP prefixes.
AS_PATH filtering: You can filter routes based on specific AS_PATH patterns.
Route maps: Allow you to filter or modify BGP routes based on various attributes,
including prefix, AS_PATH, community, etc.
Route aggregation: Aggregating multiple routes into a single summarized route using
route summarization techniques.
Route reflectors and confederations: Methods for scaling iBGP in large networks by
reducing the number of required iBGP peerings.
BGP Troubleshooting:
Use the show ip bgp command to display BGP routing table entries.
Check the BGP neighbor status using the show ip bgp neighbors command.
Verify BGP path attributes with the show ip bgp attributes command.
Check BGP peering and session details with the show tcp brief or show bgp
summary command.
Enable BGP debugging with the debug ip bgp command to troubleshoot BGP-related
issues.
Remember that BGP is a complex protocol, and this cheat sheet only covers the basics. For in-
depth understanding and troubleshooting, consult the official documentation and resources
provided by networking vendors.