Introduction to BGP

Small ISP eBGP config

EBGP Small-Scale Config

Recently I was tasked with a project configuring eBGP with 2 UPSTREAM (ISP) and various customers who have ASN and a public IP Address.

What is BGP?

Known as Border Gateway Protocol is an Exterior Gateway Protocol <EGP> that enables the internet to exchange routing information between autonomous systems. BGP is a standardized path vector routing protocol that provides scalability and flexibility. BGP is the only protocol used to exchange networks on the Internet.

BGP is called an Application Layer protocol, it cannot transport by itself but needs the L4 transport protocol (TCP).

What are an Autonomous Systems:

Known as (AS) is a set of IP prefixes belonging to a network or a collection of networks that are all controlled and managed by a single entity or organization

Autonomous systems (AS) can be grouped into four categories:

Multihomed: An AS that maintains connections to more than one other AS.

Stub: An AS that is connected to only one other AS.

Transit: An AS that provides connections through itself to other networks.

Internet Exchange Point (IX or IXP): A physical infrastructure through which ISPs or content delivery networks (CDNs) exchange Internet traffic between their networks (autonomous systems).

An organization requiring connectivity to the Internet must obtain an ASN. ASNs were originally 2 bytes (in the 16-bit range), which made 65,535 ASNs possible. Due to exhaustion, RFC 4893 expanded the ASN field to accommodate 4 bytes (in the 32-bit range). This allows for 4,294,967,295 unique ASNs, providing quite an increase from the original 65,535 ASNs.

Types of ASNs

There are two types of ASNs, namely private and public ASN.

private ASN can be used for a system which is communicating via BGP locally

public ASN is needed to exchange information over the Internet.

Private ASN:

64,512–65,535 (16-bit ASN range)

4,200,000,000–4,294,967,294 (32-bit ASN range)

Public ASN:

0–64,511 (16-bit ASN range)

131072–4199999999 (32-bit ASN range)

IANA

APNIC: https://www.apnic.net/

RIPE NCC: https://www.ripe.net/

AFRINIC: https://afrinic.net/

ARIN: https://www.arin.net/

LACNIC: https://www.lacnic.net/

Types of BGP.

There are two types of BGP, namely iBGP and eBGP.

iBGP: Established with an iBGP router that is in the same AS or that participates in the same BGP confederation. Assigned an AD of 200

eBGP: Established with a BGP router that is in a different AS. Assigned an AD of 20

BGP uses path attributes (PAs) associated with each network path. The PAs provides granularity and control of routing policies in BGP.

The BGP prefix PAs are :

Well-known mandatory

Well-known discretionary

Optional transitive

Optional non-transitive

BGP Messages.

BGP communication uses four message types:

OPEN: Sets up and establishes BGP adjacency

UPDATE: Advertises, updates, or withdraws routes

NOTIFICATION: Indicates an error condition to a BGP neighbor

KEEPALIVE: Ensures that BGP neighbors are still alive

BGP Neighbor States.

BGP forms a TCP session with neighbor routers called peers. Stages of BGP session are:

Idle

Connect

Active

OpenSent

OpenConfirm

Established

Project:

Let say a new startup company just acquired a /22 public IP address and ASN from IANA and will like to have an ebgp peering with 2 UPSTREAM and DOWNSTREAM Customers.

In this topology, We won’t be configuring IGP or iBGP since this is a simple ISP with fewer routers.

We will have an ebgp peering with one customer <ENT-2>, while <ENT-1> will connect via static route..

and will perform some subnetting which will be allocated to the customers.

NOTE: ISP does not accept prefixes lesser /24. You can’t advertise a /30 or /29 to your ISP.

You have to make use of null0 in order to prevent a loop. e.g ip route 102.100.0.0 255.255.252.0 Null0

All configs will be uploaded on github

Next I will write on PBR and IP SLA and more content will be on BGP as I progress with practice or project and studies.

Press enter or click to view image in full size

cisco sandbox

CONCLUSION:

Bgp requires more practice and Lab-work is very much different compared to production environment.

You can make use of Cisco-Sanbox or GNS3 or any other emulator or simulator for practice. All the best and reach me for any questions.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top