Why do we need more than a default route?
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Our example company in AS 64500 uses the address block 198.51.100.0/24 and buys internet access from two providers, ISP A and ISP B, so that it stays online if one of them fails. A static default route to each ISP gets traffic out, but it cannot solve the other half: the rest of the internet must learn that 198.51.100.0/24 is reachable through both ISPs. If one connection fails, affected networks need to learn that the old path is no longer available. BGP (Border Gateway Protocol) exchanges that reachability information between networks.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
A prefix is a block of IP addresses written with its length. Here /24 means that the first 24 bits identify the network. A user outside the company is trying to open a service at 198.51.100.10. The providers need a route to its prefix; a default route configured only inside the company does not announce that prefix to them.
A route that gets a request out of your network does not automatically provide the return route.
Autonomous systems
An autonomous system (AS) is a set of networks run by one organisation with one routing policy towards the outside: an ISP, a cloud provider, a university, or a company with its own addresses. Inside an AS, an IGP (interior gateway protocol) such as OSPF finds the shortest paths. Between autonomous systems, BGP carries routes, and each organisation decides what it accepts and what it announces.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Every AS is identified by an AS number (ASN). Public ASNs are assigned by the five regional internet registries (ARIN, RIPE NCC, APNIC, LACNIC and AFRINIC).
On small screens, swipe sideways or focus the diagram and use the arrow keys.
This is a learning summary, not an allocation authority. AS 23456 has the special AS_TRANS purpose described below; 65552–131071 are also reserved. Check the IANA AS-number registry before choosing a public number.
AS numbers were 16 bits (2 bytes) until the registries began to run out; 4-byte ASNs (RFC 6793) raised the limit to 4 294 967 295. Cisco IOS shows them in asplain notation by default (65546) and can show asdot notation instead (1.10, meaning 1 × 65536 + 10). A router that only understands 2-byte ASNs sees a 4-byte AS as AS 23456 (AS_TRANS), a placeholder, while the real number travels in a separate attribute.
Private ASNs work like private IP addresses: fine inside an organisation or between a customer and its provider, but they should not appear in public-internet AS paths. Removing or replacing them requires an agreed provider configuration; BGP does not automatically remove every private ASN.
How the AS path carries a route
BGP is a path-vector protocol. When a router sends a route to another AS, it adds its own ASN to the front of the route's AS_PATH attribute. An attribute is information attached to a route. In this simple example, the path lists the ASes through which the announcement travelled. By default, a router rejects a received route whose AS path contains its own ASN. That stops the same announcement being accepted after travelling back around a loop.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
The four router symbols below represent the borders of four autonomous systems. The lines show BGP relationships between those systems. They do not show individual Ethernet cables, interface addresses or the path of a web packet. The moving labels are route announcements travelling away from the company; user packets for its service travel towards it.
Device key: Company, ISP A, ISP B, Remote network (router)
Lines show the example’s network connections. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.
- 1. The company announces its block. It sends 198.51.100.0/24 to both providers with AS path 64500.
- 2. ISP A passes it on. ISP A adds 64501 to the front, so the remote network sees two ASes on the way.
- 3. ISP B does the same. The remote network now has two paths and picks one by its own policy.
- 4. ISP A also hears it from ISP B. With no other policy set, ISP A keeps the direct path: the shorter AS path wins.
- 5. Loop prevention. If ISP A sends the selected route back to the company, the company sees its own 64500 in the path and rejects it.
Notice what BGP does not compare: link speed. OSPF picks the lowest total cost; BGP picks by attributes, in a fixed order, and the length of the AS path is only one step in that order. The administrator can override it, for example to keep ISP B as a backup even when its path is shorter. The course covers those attributes in Module 3.
Why the internet needs a protocol of its own
On small screens, swipe sideways or focus the diagram and use the arrow keys.
- Scale. BGP exchanges reachable prefixes without requiring every organisation to share one detailed link-state map. After the initial exchange, updates normally describe changes. This does not mean BGP uses no memory or processing power: large tables still need suitable hardware.
- Policy. An ISP must decide which neighbours may send it traffic for which destinations, because that is what customers pay for. BGP's attributes and filters express those business rules.
- Separate administration. Each AS controls its own routing policy. BGP does not require neighbours to share a complete internal topology. A received announcement still needs filtering and validation; an AS path is not proof that the advertised route is legitimate.
Does this network need BGP?
On small screens, swipe sideways or focus the diagram and use the arrow keys.
In practice, many enterprises run BGP today without ever touching the public internet table: towards a cloud provider, an MPLS provider or inside an SD-WAN. The protocol is the same; only the scale and the policy differ.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
If static routes and floating static routes are unfamiliar, the CCNA floating static routes lesson covers the no-BGP option.
The trade-off: control adds responsibility
BGP gives you control over accepted and announced routes. It also gives you more ways to make a mistake. A wrong outbound filter can announce routes your company should not carry. A missing inbound limit can accept far more routes than the router was sized for. Start with explicit permitted prefixes and the smallest route set your design needs, rather than requesting a full internet table by habit.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
A short reading lab
Use an existing Cisco IOS or IOS XE BGP lab with the course AS numbers. These are privileged EXEC checks, not a complete BGP configuration. No router is started by this page.
show ip bgp summary
show ip bgp 198.51.100.0 255.255.255.0
show ip route 198.51.100.10On a provider-side lab router: check the company peer, inspect its prefix and AS path, then check which route forwards packets for the company service.
- In the summary, find the company neighbour and its AS. A prefix count in the final column means the session is established; a state name such as Active means it is not.
- Read the AS path from the nearest AS towards the originating AS. On ISP A, the directly learned company path is 64500. On the remote AS through ISP A, it is 64501 64500.
- Compare the BGP entry with the IP route. Learning a route, selecting it in BGP and installing it for forwarding are separate checks.
Technical references: BGP-4, RFC 4271, the IANA ASN registry and Cisco's BGP troubleshooting guide. The examples are written for teaching, not captured from a running router.
Test yourself on autonomous systems
A router in AS 64500 receives a route with AS path 64502 64500 64510. What does it do?
Which AS number is private?
A branch has one internet connection and uses the provider's addresses. What does it need to reach the internet?
What does BGP compare first when OSPF would compare total cost?