Networking BGPNetwork EngineeringRoute SecurityRouting Protocols

Article & Tutorial

BGP Explained: eBGP, iBGP, Path Selection and Troubleshooting

Understand BGP sessions, eBGP and iBGP, route attributes, path selection, filtering, communities, convergence, security, and a practical troubleshooting sequence.

Border Gateway Protocol routing paths between autonomous systems
Border Gateway Protocol routing paths between autonomous systems
Contents

Border Gateway Protocol exchanges reachability information between routing domains called autonomous systems. It is a policy-driven path-vector protocol: operators decide which prefixes to accept, prefer, and advertise rather than relying on a single shortest-path metric.

eBGP and iBGP serve different scopes

Session typeWhere it runsPrimary purpose
eBGPBetween autonomous systemsExchange routes with external networks
iBGPInside one autonomous systemDistribute externally learned and policy-controlled routes internally

BGP uses TCP port 179. A stable TCP session, matching neighbor parameters, correct autonomous-system numbers, reachable peer addresses, and compatible address families are prerequisites for route exchange.

Important path attributes

  • LOCAL_PREF influences outbound selection inside an autonomous system; higher is commonly preferred.
  • AS_PATH records traversed autonomous systems and helps prevent loops.
  • ORIGIN indicates how a route entered BGP.
  • MED can suggest a preferred entry point to a neighboring autonomous system.
  • NEXT_HOP identifies the address used to reach the advertised prefix.
  • Communities attach policy labels that simplify consistent routing decisions.

Path selection is implementation-specific

Most platforms evaluate attributes in a defined sequence, but exact order and tie-breakers vary. Verify the vendor decision process before predicting a winner. Policy set by weight, local preference, route maps, and filtering can be more important than raw AS-path length.

Session states and diagnosis

Start with the neighbor state, then work outward. Idle or Active often points to reachability, addressing, TCP, or configuration problems. An Established session proves the control channel is up, but it does not prove that useful routes are accepted or installed.

  1. Verify peer IP reachability and the expected source address.
  2. Confirm local and remote autonomous-system numbers.
  3. Check TCP 179 and any authentication configuration.
  4. Verify address-family activation and import/export policy.
  5. Inspect received, accepted, selected, and advertised routes separately.
  6. Confirm next-hop reachability and routing-table installation.

Safety and route hygiene

Apply explicit prefix limits, inbound and outbound filters, maximum-prefix thresholds, bogon filtering, and RPKI-based origin validation where appropriate. Use change control for policy updates; a syntactically valid route map can still create a large outage.

BGP-4 specification, RFC 4271

Did this help?

Yes No

Join the discussion

0 Comments

Ask questions, add context, or share what worked.

Sign in to join the discussion

No comments yet. Start the discussion.

More from Melochip Editorial

Related articles

Stay in the loop. Get new Melochip articles

Receive Melochip article updates when new articles are available. Explicit opt-in only.

No pre-checked boxes. Unsubscribe support is part of the subscriber foundation.