The Border Gateway Protocol (BGP) is a protocol used to make core routing decisions on the Internet. BGP is commonly mislabeled or referred to as an IP routing protocol. However, it is not a routing protocol; rather, it is a TCP application that carries routing information with it. It is better referred to as a reach-ability protocol rather than a routing protocol.
External BGP (eBGP) helps connect networks with different Autonomous Numbers (AS) to each other. eBGP is used heavily by Internet service providers to establish routing between one another; this is especially the case if they are multihomed (for more info on multihoming, see my prior blog, Single/Dual and Multihomed Connections). Internal BGP (iBGP) is a BGP connection within the same AS and is used as a way to exchange BGP information between multiple BGP border routers.
In this lab, I use three Cisco 3725 routers [IOS 12.4(15)T10] to demonstrate how to setup basic iBGP and eBGP on Cisco routers. I have two routers, R1 and R2, in AS 200 and setup iBGP between them. R3 is in AS 400 so I setup eBGP between R1 and R3. I configured loopback addresses on both R2 and R3 to confirm communication is good between them; this also helps confirm that BGP is working properly. Below is the lab setup I used.
The configuration I used to setup the routers is shown below. Note, in BGP, the redistribution of static and connected routes into BGP is enabled with the “redistribute connected” and “redistribute static” commands. I use the “redistribute connected” command below.
R1 Configuration
– enable
– conf t
– router bgp 200
– redistribute connected
– neighbor 180.0.0.2 remote-as 400
– neighbor 10.0.0.2 remote-as 200
– exit
– exit
– write
R2 Configuration
– enable
– conf t
– router bgp 200
– redistribute connected
– neighbor 10.0.0.1 remote-as 200
– exit
– exit
– write
R3 Configuration
– enable
– conf t
– router bgp 400
– redistribute connected
– neighbor 180.0.0.1 remote-as 200
– exit
– exit
– write
The “show ip bgp summary” command outputs the identified neighbors and their associated Autonomous System (AS) number. The current state of the neighbor relationship is also listed. If all is working, this show display as ‘established’ or show the count of prefixes learned. The prefixes indicate the prefixes learned from the respective neighbor and confirms the state is established.
Below, from the “show ip bgp summary” command run on both R2 an R3, you can see that the respective neighbor is listed and the state is established with each having learned three prefxes.
Next, I display the BGP table of R2 via the “show ip bgp” command. As you can see, all respective routes have been learned. Further, I ping from the loopback on R2 (2.2.2.2) to the loopback on R3 (3.3.3.3) to confirm there is no issue with communication. If you are having issues establishing a neighbor relationship, you may want to enable “logging console” and “logging buffer”; this will allow you to see triggered events on the screen and via the “show logging” command.