To understand BGP, you first need to understand the problem it was designed to solve.
When you look at a single organization, routing seems straightforward.
All routers belong to the same administrative entity and follow the same objectives.
Figure 1 – Routing Inside a Single Organization
OSPF in a Single Organization
In this type of environment, an IGP such as OSPF works well because:
You have a single administrative control
The routing policy is shared across the network
Selecting the shortest path usually makes sense
Inside one organization, these assumptions are valid.
You control everything, and every router trusts the others.From Single Domain to Multiple Domains
Now expand your view.
Instead of one organization, imagine multiple independent networks that need to communicate.
Figure 2 – Routing Between Independent Networks
You now have:
An ISP
A cloud provider
Several enterprises
Other independent organizations
Each of these networks is managed independently and operates under its own objectives and constraints.
Why OSPF Cannot Run the Internet
At this point, you might ask yourself:
Why not simply use OSPF everywhere?
The answer lies in the assumptions OSPF makes.OSPF assumes:
One trusted administrative domain
Shared routing policies
Full visibility of the network topology
Decisions based strictly on the shortest path
But on the Internet, none of these assumptions hold.
Independent networks:
Do not share administrative control
Do not expose their internal topology
Do not share business objectives
Do not always prefer the shortest path
At Internet scale, routing decisions are driven by policy rather than purely by topology.
A different approach is required.Answer the question below
What type of routing protocol typically works well inside a single organization with one administrative control?
Why BGP Exists
BGP was designed to interconnect independent networks while allowing each of them to enforce its own routing policy.
BGP is a Path Vector routing protocol.
Unlike link-state protocols, it does not build a full topology database of the network or calculate routes using a shortest-path algorithm.
Instead, it exchanges network reachability information between networks and applies routing decisions based on policy.
Figure 3 – Global BGP connectivity
With BGP, you do not share your internal topology.
You share reachability information.
You decide which routes to advertise and which routes to accept.The Internet is a collection of interconnected networks.
BGP is the protocol that enables this interconnection.Answer the question below
What drives routing decisions at Internet scale instead of purely topology?
Now that you understand why BGP is needed, you must understand how independent networks are identified.
When independent networks want to exchange their internal routes in order to communicate with each other, they must establish a BGP relationship.

Figure 4 – Basic BGP exchange
In this example, two separate organizations want to exchange routing information.
Each side controls its own internal network, but they agree to exchange reachability information through BGP.To make this possible, each network must be uniquely identified.
Identifying Independent Networks
To distinguish independent networks, the concept of an Autonomous System (AS) is used.
An Autonomous System represents a network under a single administrative control.
Figure 5 – Autonomous system concept
Each Autonomous System is identified by a unique number.
In this example, the organization on the left is AS 65001 and the one on the right is AS 65002.On a live router, you can see these numbers directly in the BGP neighbor table.
R1# show ip bgp summary BGP router identifier 1.1.1.1, local AS number 65001 BGP table version is 3, main routing table version 3 2 network entries using 288 bytes of memory 2 path entries using 168 bytes of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.0.12.2 4 65002 34 35 3 0 0 00:30:12 1The local AS number at the top confirms this router belongs to AS 65001.
The AS column shows that the neighbor belongs to AS 65002.These numbers are called Autonomous System Numbers (ASN).
They allow networks to identify each other when forming BGP relationships.
When configuring BGP, you must define the local Autonomous System number.Autonomous System Numbers were originally defined as 16-bit values (range 1–65535).
Due to Internet growth and ASN exhaustion, 32-bit ASNs were later introduced to expand the available numbering space.Answer the question below
What uniquely identifies a network under a single administrative control?
The Internet as a Collection of AS
The Internet is structured around interconnected Autonomous Systems.
Each AS:
Decides which routes to advertise
Decides which routes to accept

Figure 6 – Internet of AS
If an organization wants to participate in Internet routing independently, it must obtain an Autonomous System Number.
Public AS numbers are assigned through Regional Internet Registries (RIRs).This numbering system allows every participating network on the Internet to be uniquely identified.
As you move forward in BGP, you will see that the AS number plays a central role in how routing decisions are made.Answer the question below
Who assigns public Autonomous System Numbers?
Now that you understand what an Autonomous System is, you need to understand how BGP operates both between and inside these systems.
BGP is divided into two types of sessions:
eBGP
iBGP
These two modes define how routing information is exchanged depending on where the routers are located.
eBGP – Between Different Autonomous Systems
eBGP stands for External BGP.
It is used when two routers belong to different Autonomous Systems.This is the type of BGP session used:
Between an enterprise and its ISP
Between two ISPs
Between a cloud provider and a service provider

Figure 7 – eBGP session
When a route is learned through eBGP, its default Administrative Distance is 20.
You can confirm this in the routing table.R1# show ip route bgp Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR Gateway of last resort is not set B 203.0.113.0/24 [20/0] via 10.0.12.2, 00:05:48The B code means the route was learned via BGP.
The [20/0] confirms the Administrative Distance is 20, the default for eBGP.During route selection, eBGP-learned routes are preferred over iBGP-learned routes.
eBGP is therefore the mechanism that connects independent networks across the Internet.Answer the question below
Which type of BGP session is used between different Autonomous Systems?
iBGP – Inside the Same Autonomous System
iBGP stands for Internal BGP.
It is used when routers belong to the same Autonomous System.
Its role is to distribute externally learned routes across the internal network.
Figure 8 – iBGP session
Routes learned via iBGP have a default Administrative Distance of 200.
This does not mean they are less important.
It simply reflects how they are treated in the routing table compared to other sources.iBGP ensures that all routers inside the same Autonomous System have consistent visibility of external routes.
Verifying iBGP in the Routing Table
On R11, you can confirm this in the routing table. The route to 192.168.2.0/24 was originally learned by R1 via eBGP from R2 and then distributed to R11 via iBGP.
R11# show ip route bgp Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR Gateway of last resort is not set B 192.168.2.0/24 [200/0] via 10.0.1.1, 00:12:35The [200/0] confirms the Administrative Distance is 200: this route was learned via iBGP.
Answer the question below
What is the default Administrative Distance of routes learned via iBGP?