Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

BGP Extensive Cheat Sheet

Here’s an extensive cheat sheet for BGP (Border Gateway Protocol):

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.

BGP Neighbor Establishment:

 BGP neighbors are manually configured between routers in different ASs.


 BGP establishes a TCP session with its neighbors using port 179.
 BGP routers use the neighbor IP address and AS number for establishing connections.
 Authentication can be enabled to secure BGP sessions using MD5 authentication.

BGP Message Types:

 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.

BGP Path Attributes:

 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 Route Selection:

 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.

BGP Route Filtering and Manipulation:

 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.

You might also like