Related: BGP operates between Autonomous Systems (ASNs).
What is BGP?
Border Gateway Protocol (BGP) is basically the routing protocol that lets different networks talk to each other and share information about what IP addresses they can reach. It's what decides which paths your traffic takes when it moves between networks.
Why BGP exists
Here's the thing-the internet is made up of thousands of independent networks. And they all need a way to tell each other "hey, we can reach this IP range" and set their own routing rules. That's what BGP does.
Core BGP attributes
Download CSV| Attribute | Description | Why it matters | Example |
|---|---|---|---|
| AS_PATH | The list of ASNs that a route travels through | Stops routing loops from happening | Shorter paths get picked first |
| NEXT_HOP | The next router in the path for a route | Tells the router where to send traffic | Neighbor IP |
| LOCAL_PREF | A preference value used internally | Controls how traffic gets routed outbound | Higher number wins |
| MED | Multi-exit discriminator | Hints at the best inbound path | Lower number wins |
| ORIGIN | Shows how the route was originally learned | Helps you know if it's trustworthy | IGP is preferred |
| COMMUNITY | Tags attached to routes | Lets you control routing policies | No-export |
| PREFIX | The IP range being advertised | Where traffic is actually headed | 203.0.113.0/24 |
| PEERING | The BGP neighbor relationship | How routes get exchanged | IXP peering |
How BGP selects routes
- Highest LOCAL_PREF
- Shortest AS_PATH
- Lowest ORIGIN type
- Lowest MED
- Lowest IGP cost to NEXT_HOP
BGP and security risks
The problem is that BGP basically trusts what its neighbors tell it. So if someone misconfigures something or announces a route they shouldn't, traffic can get hijacked or just disappear into a black hole.
How BGP relates to IP reputation and abuse
- Bad traffic usually comes from specific ASNs.
- Route leaks can accidentally send traffic through networks you don't want it in.
- Lots of security systems filter things at the ASN level.
