iBGP Peering
Let’s look at a BGP scenario and more specifically iBGP peering.
Let’s take a look at the topology, our goal is to have AS-500 (R5) be able to reach AS-400 (R4) and reverse.
In order to get from R5 to R4 and from R4 to R5 we have to go through R1, R2, R3 or AS-100 which will be acting as a transit AS. We will configure iBGP between the 3 routers in AS-100 and EBGP between R1 and R5, R3 and R4.
Let’s dive in-
We’ll start with R1 and setup all the interfaces including the loopback first and once that’s done, we’ll do the iBGP configuration-
One thing to note R1, R2 and R3 are not directly connected and they don’t need to but we do need full mesh connectivity between all 3 routers in AS-100 and since R1 and R3 are not directly connected we will also configure an IGP to make that happen and we will use OSPF as our IGP of choice.
Let’s do our OSPF configuration on the 3 routers.
R1(config)#router ospf 1
R1(config-router)#network 192.168.12.0 0.0.0.255 area 0
R1(config-router)#network 10.10.10.0 0.0.0.255 area 0
R2(config)#router ospf 1
R2(config-router)#network 192.168.12.0 0.0.0.255 area 0
R2(config-router)#network 192.168.23.0 0.0.0.255 area 0
R2(config-router)#network 20.20.20.0 0.0.0.255 area 0
R3(config)#router ospf 1
R3(config-router)#network 192.168.23.0 0.0.0.255 area 0
R3(config-router)#network 30.30.30.0 0.0.0.255 area 0
This takes care of our full mesh connectivity with AS-100
Now we’re able to ping from R1 to R3 and from R3 to R1 because of OSPF.

Now we’ll do our iBGP configuration between the 3 routers in AS-100.
We’re using the loopback address on all the routers as the source and for that reason we’ll use the update-source command.
We will also be using the next-hop-self command on R1 and R3, so that R4 and R5 can know what the next hop should be. This particular command is primarily used in iBGP scenarios and by setting this command, the receiving router will always use the advertising router and the next hop to reach the destination network.
R1(config)#router bgp 100
R1(config-router)#neighbor 20.20.20.20 remote-as 100
R1(config-router)#neighbor 20.20.20.20 update-source loopback0
R1(config-router)#neighbor 20.20.20.20 next-hop-self
R1(config-router)#neighbor 30.30.30.30 remote-as 100
R1(config-router)#neighbor 30.30.30.30 update-source loopback0
R1(config-router)#neighbor 30.30.30.30 next-hop-self
R2(config)#router bgp 100
R2(config-router)#neighbor 10.10.10.10 remote-as 100
R2(config-router)#neighbor 10.10.10.10 update-source loopback0
R2(config-router)#neighbor 30.30.30.30 remote-as 100
R2(config-router)#neighbor 30.30.30.30 update-source loopback0
R3(config)#router bgp 100
R3(config-router)#neighbor 10.10.10.10 remote-as 100
R3(config-router)#neighbor 10.10.10.10 update-source loopback0
R3(config-router)#neighbor 10.10.10.10 next-hop-self
R3(config-router)#neighbor 20.20.20.20 remote-as 100
R3(config-router)#neighbor 20.20.20.20 update-source loopback0
R3(config-router)#neighbor 20.20.20.20 next-hop-self
Now we can also do our eBGP between R1 and R5, R3 and R4. We will also advertise all the interfaces on R4 and R5
R1(config)#router bgp 100
R1(config-router)#neighbor 192.168.15.5 remote-as 500
R5(config)#router bgp 500
R5(config-router)#neighbor 192.168.15.1 remote-as 100
R5(config-router)#network 192.168.15.0 mask 255.255.255.0
R5(config-router)#network 50.50.50.50 mask 255.255.255.0
R3(config)#router bgp 100
R3(config-router)#neighbor 192.168.34.4 remote-as 400
R4(config)#router bgp 400
R4(config-router)#neighbor 192.168.34.3 remote-as 100
R4(config-router)#network 192.168.34.0 mask 255.255.255.0
R4(config-router)#network 40.40.40.40 mask 255.255.255.0
Configuration is complete, let’s take a look at the routing table.

We can see above that the route to R4 is in the BGP table and the routing table of R5, meaning it knows how to reach AS-400 via AS-100.
Let’s look at R4 routing table.
We can see that R4 also knows how to reach the prefixes of R5 in AS-500 via AS-100.
NOTE- This was a very small topology so a full mesh connectivity with IGP works but with large topologies with 20, 30 or more routers, this is not a good solution. There are other options designed to handle large topologies which will be discussed in next labs.