How to configure iBGP on Cisco Router

In this lesson, we will configure iBGP on Cisco Router. This is the second part of our BGP series. We have chosen a network where we have three routers which are not directly connected. We will configure ibgp among them and check the reachability from end to end.

Below are the list of our BGP series. This will be updated day by day.

Advertisements

Network Topology

How to configure iBGP on Cisco Router

Configuration

First of all, let’s configure interfaces of all three routers according our design.

R1:
interface GigabitEthernet0/0
 ip address 10.1.1.1 255.255.255.0
 no shutdown

interface GigabitEthernet0/1
 ip address 1.1.1.1 255.255.255.252
 no shutdown

R2:
interface GigabitEthernet0/1
 ip address 1.1.1.2 255.255.255.252
 no shutdown

interface GigabitEthernet0/2
 ip address 2.2.2.1 255.255.255.252
 no shutdown

R3:
interface GigabitEthernet0/2
 ip address 2.2.2.2 255.255.255.252
 no shutdown

interface GigabitEthernet0/3
 ip address 10.2.2.1 255.255.255.0
 no shutdown

After configuring the IP addressing, let’s configure ibgp for these 3 routers. We also need to announce our 10.1.1.0/24 network in router R1 and 10.2.2.0/24 network in router R3.

R1:
R1#configure terminal
R1(config)#router bgp 100
R1(config-router)# network 10.1.1.0 mask 255.255.255.0
R1(config-router)# neighbor 1.1.1.2 remote-as 100
R1(config-router)#^Z
R1#

R2:
R2#configure terminal
R2(config)#router bgp 100
R2(config-router)# neighbor 1.1.1.1 remote-as 100
R2(config-router)# neighbor 2.2.2.2 remote-as 100
R2(config-router)#^Z
R2#

R3:
R3#configure terminal
R3(config)#router bgp 100
R3(config-router)# network 10.2.2.0 mask 255.255.255.0
R3(config-router)# neighbor 2.2.2.1 remote-as 100
R3(config-router)#^Z
R3#

Now, let’s verify our bgp neighborship using “show ip bgp summary” command.

R1:
R1#show ip bgp summary
BGP router identifier 10.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor       V         AS  MsgRcvd MsgSent   TblVer  InQ OutQ   Up/Down  State/PfxRcd
1.1.1.2           4       100       5          2             1        0      0       00:00:11         0

R2:
R2#show ip bgp summary
BGP router identifier 2.2.2.1, local AS number 100
BGP table version is 7, main routing table version 7
2 network entries using 288 bytes of memory
2 path entries using 160 bytes of memory
1/1 BGP path/bestpath attribute entries using 152 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 600 total bytes of memory
BGP activity 4/2 prefixes, 4/2 paths, scan interval 60 secs

Neighbor        V        AS  MsgRcvd  MsgSent   TblVer  InQ OutQ  Up/Down  State/PfxRcd
1.1.1.1           4       100       7          8             7        0      0       00:02:54         1
2.2.2.2           4       100       5          6             7        0      0       00:00:53         1

R3:
R3#show ip bgp summary
BGP router identifier 10.2.2.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V        AS  MsgRcvd  MsgSent   TblVer  InQ  OutQ  Up/Down  State/PfxRcd
2.2.2.1           4       100       5          2             1        0      0       00:00:04         0

If you check closely, you will see router R1 and R3 didn’t received any routes, while R2 received routes from both routers. It means R2 are not forwarding it’s learnt routes. So, why is that?

Advertisements

It’s because, a router can’t advertise it’s learnt routes from a ibgp peer to another ibgp peer. This is the rule of iBGP to avoid split horizon. You can learn more about iBGP rules from ciscopress.

If we have a full mesh design, then this issue will not occur. However, full mesh is not always feasible and it’s nightmare for larger networks. To solve it, we can use Route Reflectors or Confederations.

We will discuss and implement them later. Here, you just need to know that, we need to configure ibgp session with all the routers. To form a bgp session, we need reachability with peers. But here, we do not have reachability from R1 to R3.

R1#ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R1#

We do not have any physical connection from R1 to R3, so we need to configure a IGP protocol (OSPF, EIGRP etc.) in this network to have reachability.

R1:
R1#configure terminal
R1(config)#router ospf 1
R1(config-router)#network 1.1.1.0 0.0.0.3 area 0
R1(config-router)#^Z
R1#

R2:
R2#configure terminal
R2(config)#router ospf 1
R2(config-router)# network 1.1.1.0 0.0.0.3 area 0
R2(config-router)# network 2.2.2.0 0.0.0.3 area 0
R2(config-router)#^Z
R2#

R3:
R3#configure terminal
R3(config)#router ospf 1
R3(config-router)# network 2.2.2.0 0.0.0.3 area 0
R3(config-router)#^Z
R3#

At this point, we have reachability from R1 to R3. Let’s configure ibgp from R1 to R3.

Advertisements
R1#ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/4/7 ms
R1#
R1:
R1#configure terminal
R1(config)#router bgp 100
R1(config-router)# neighbor 2.2.2.2 remote-as 100
R1(config-router)#^Z
R1#

R3:
R3#configure terminal
R3(config)#router bgp 100
R3(config-router)# neighbor 1.1.1.1 remote-as 100
R3(config-router)#^Z
R3#

Our BGP session is now up and we are receiving routes.

R1#show ip bgp summary
BGP router identifier 10.1.1.1, local AS number 100
BGP table version is 6, main routing table version 6
2 network entries using 288 bytes of memory
2 path entries using 160 bytes of memory
2/2 BGP path/bestpath attribute entries using 304 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 752 total bytes of memory
BGP activity 2/0 prefixes, 2/0 paths, scan interval 60 secs

Neighbor        V        AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.2           4       100       350          349         6        0      0       05:14:22        0
2.2.2.2           4       100       26            25           6        0      0       00:17:00        1
R1#

If we check our bgp routes from R1, then we will be able to see 10.2.2.0/24 in our routing table, which are learnt from ibgp peer.

R1#sh ip bgp
BGP table version is 6, local router ID is 10.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  10.1.1.0/24      0.0.0.0                  0         32768 i
 *>i 10.2.2.0/24      2.2.2.2                  0    100      0 i
R1#

Finally, lets ping from R1 LAN (10.1.1.10) to R3 LAN (10.2.2.10).

R1#ping 10.2.2.10
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/10/26 ms
R1#

The above result proves that we successfully completed our iBGP configuration.

Leave a Comment

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

Scroll to Top