The Internet is a huge network and is made up of many smaller networks. To learn about routes in other networks, each network has to run a routing protocol. While protocols such as EIGRP (Enhanced Interior Gateway Routing Protocol), OSPF (Open Shortest Path First), and RIP (Routing Information Protocol) work well for many networks, they do not scale to support the needs of a gigantic network like the Internet, nor do they provide the level of administrative separation required. So, BGP (Border Gateway Protocol) is used by ISP (Internet Service Provider) and large enterprises to advertise IP routes to one another.
In this chapter, we'll learn about BGP and its features when compared to other routing protocols. We will also learn the commands used in BGP and configure it in Cisco Packet Tracer.
BGP is a very robust routing protocol that is used to exchange routing information between multiple Autonomous Systems (AS). This brings up the question of what an AS is. An AS is a collection of IP prefixes (read IP networks) that are maintained by a network operator. This network operator could be an enterprise or an ISP.
Each AS has a number assigned to it called ASN (Autonomous System Number). Public AS numbers are assigned by the IANA (Internet Assigned Numbers Authority) to the RIRs (Regional Internet Registries). These RIRs, in turn, assign them to individual enterprises or ISPs.
Configuration of BGP largely depends on how an organization is connected to an ISP. There are four possible ways in which this can be done:




BGP may not always be used in all the previously-discussed designs. For some designs such as single homed, it is better to just have a static default route in the enterprise router towards the ISP, and another on the ISP side for just the network prefix of the enterprise. However, implementing BGP on multihomed networks ensures that the most efficient route is used as these networks have two or more links to ISP(s).
There are two types of BGP:
This type of BGP is used to exchange routes between two types of AS. The administrative distance of eBGP is 20. By default, the update packets in eBGP have the TTL set to 1, so that only directly connected BGP routers receive it. However, this behavior can be changed by using commands. Also, an eBGP peer will advertise all the valid routes it has learned from its eBGP and iBGP peers. When an eBGP neighbor advertises a route, it sets the next-hop field of the route to its own address.
This type of BGP is used to exchange routes within an AS. The administrative distance of iBGP is 200. Updates in iBGP do not have TTL value limitations. An iBGP peer does not advertise a route to another iBGP peer if the route was learned via iBGP. This is done to prevent routing loops within an AS. The next-hop field of the route updates remains unchanged when one iBGP peer advertises to another iBGP peer. This behavior can be modified with the use of commands.