Related: BGP operates between Autonomous Systems (ASNs).

What is BGP?

Border Gateway Protocol (BGP) is the routing protocol used to exchange reachability information between autonomous systems on the internet. It decides which paths traffic takes between networks.

Why BGP exists

The internet is made up of thousands of independent networks. BGP allows these networks to advertise which IP prefixes they can reach and to apply routing policies.

Core BGP attributes

Download CSV
AttributeDescriptionWhy it mattersExample
AS_PATHList of ASNs a route traversesPrevents routing loopsShorter paths preferred
NEXT_HOPNext router for a routeDetermines forwardingNeighbor IP
LOCAL_PREFInternal preference valueControls outbound routingHigher wins
MEDMulti-exit discriminatorInbound path hintLower wins
ORIGINHow route was learnedTrust indicatorIGP preferred
COMMUNITYRoute tagsPolicy controlNo-export
PREFIXAdvertised IP rangeTraffic destination203.0.113.0/24
PEERINGBGP neighbor relationshipRoute exchangeIXP peering

How BGP selects routes

  1. Highest LOCAL_PREF
  2. Shortest AS_PATH
  3. Lowest ORIGIN type
  4. Lowest MED
  5. Lowest IGP cost to NEXT_HOP

BGP and security risks

Because BGP trusts announcements from neighbors, misconfigurations or malicious announcements can lead to traffic hijacking or blackholing.

How BGP relates to IP reputation and abuse

Related tools

Authoritative references