What Is BGP? Overview and Core Features

Border Gateway Protocol (BGP) is an exterior gateway protocol (EGP) used to exchange routing information among autonomous systems (AS) on the Internet. It is a path-vector protocol, meaning it carries a list of AS numbers that a route has traversed.

Core BGP Features

  • Path Vector Protocol: BGP advertises paths, not just next-hop information.
  • Policy-Based Routing: Highly flexible for implementing routing policies.
  • Scalability: Designed to handle the large scale of the Internet.
  • TCP Port 179: Uses TCP for reliable communication between BGP peers.
  • Autonomous Systems: Operates between different autonomous systems.

Why BGP Is Different

BGP is not designed to find the shortest path in the same way an interior gateway protocol does. It is designed to exchange reachability between autonomous systems and apply policy. That policy might prefer one provider, avoid another provider, advertise only approved prefixes, tag routes with communities, or influence inbound traffic with AS path prepending and provider-specific community values.

Because BGP is policy-driven, a route that looks shorter is not always selected. Local preference, AS path, origin, MED, next-hop reachability, and other best-path rules can change the final choice. This makes BGP extremely flexible, but it also means engineers must troubleshoot both route visibility and route policy.

eBGP and iBGP Basics

  • eBGP: Runs between different autonomous systems, commonly between a customer and provider or between two internet peers.
  • iBGP: Runs inside the same autonomous system to share externally learned routes between internal BGP speakers.
  • Next-hop behavior: eBGP usually changes the next hop when advertising routes, while iBGP commonly preserves it.
  • Loop prevention: eBGP uses AS_PATH checks, while iBGP relies on split-horizon behavior and often needs route reflectors in larger designs.

Useful Verification Commands

  • show ip bgp summary checks neighbor state, uptime, received prefixes, and session health.
  • show ip bgp displays BGP paths, best-path markers, next hops, and attributes.
  • show ip route bgp confirms which BGP routes were installed into the routing table.
  • show ip bgp neighbors gives deeper session, policy, capability, and prefix information.
  • show route-map and show ip prefix-list help verify route policy filters.

Related BGP Resources

After reviewing the overview, continue with attributes and policy because those two areas explain most BGP design and troubleshooting questions. A BGP session can be established and still fail to pass the intended routes if filters, next-hop reachability, or prefix advertisements are wrong.

For lab practice, build two small autonomous systems first, then add a second link and compare path selection. Once the basic session is stable, add prefix filtering, local preference, and AS path prepending so you can see how BGP policy changes route choice.

Record three views during every change: the neighbor state, the BGP table, and the forwarding table. They answer different questions. The neighbor view proves that peers can exchange updates, the BGP table shows candidate paths and attributes, and the forwarding table shows which route the router can actually use for traffic.

How BGP Builds and Selects Routes

BGP exchanges network reachability information over TCP port 179. Each route carries attributes that describe its path and policy. A router may learn several paths to the same prefix, but it normally installs only the selected best path in the routing table. The exact decision process varies slightly by platform, yet commonly considers weight, local preference, locally originated status, AS-path length, origin, MED, eBGP versus iBGP, IGP cost to the next hop and router identifiers.

eBGP connects different autonomous systems. iBGP distributes externally learned or locally originated routes inside one autonomous system. iBGP does not automatically provide next-hop reachability, so the IGP or static routing design must still carry loopbacks and external next hops. In larger networks, route reflectors reduce the need for a full iBGP mesh.

What to Verify in a BGP Lab

  • Confirm the peer address, source address and local and remote AS numbers.
  • Verify TCP reachability and that the session reaches Established.
  • Check which prefixes are received, accepted, advertised and selected as best.
  • Inspect next-hop reachability before assuming an attribute problem.
  • Apply explicit inbound and outbound filters, then verify their counters and effects.

Use show ip bgp summary for session state and prefix counts, show ip bgp for path selection, and neighbor-specific advertised or received route commands for policy validation. Continue with BGP configuration, path attributes, and routing policies.