IBGP Peering using loopbacks Interfaces
- Malik Zaib
- Oct 17, 2023
- 7 min read

R1(config)#router bgp 500
R1(config-router)#neighbor 12.1.1.1 remote-as 500
R1(config-router)#neighbor 13.1.1.1 remote-as 500
R1(config-router)#neighbor 14.1.1.1 remote-as 500
R1 (config-router)#network 10.0.0.0
R1 (config-router)#exit
R1 (config)#
Issues with IBGP peering using Loopbacks:
Loopbacks must be Reachable:
To send unicast BGP open messages.
Advertise Loopback interface inside IGP (OSPF/EIGRP/RIP)
Problem with Source:
Default Source will be exit interface
Change source address to loopback address
BGP Active State Troubleshooting:
Active State:
The router has sent an open packet and is waiting for a response.
The state may cycle between active and idle.
The neighbor may not know how to get back to this router because of the following reasons:
Neighbor is peering with the wrong address.
Neighbor does not have a neighbor statement for this router.
AS number is misconfiguration.
Neighbor does not have a route to the source IP address of the BGP open packet generated by this router.
Any extra command missing.(update source)
Configuration Tasks:
1. Configure IBGP AS 500 as per the diagram using direct loopback Interfaces.
2. Make sure that the IBGP neighbor relationship should not be affected by the physical status of the link.
3. Make sure that all the routers should be able to see the routes from other routers in the BGP table.

Configuration of all Routers R1, R2, R3 and R4 in given scenario:
R1:
Rl(config)#router bgp 500
Rl(config-router)#neighbor 12.1.1.1 remote-as 500
Rl(config-router)#neighbor 13.1.1.1 remote-as 500
Rl(config-router)#neighbor 14.1.1.1 remote-as 500
Rl(config-router)#network 10.0.0.0
Rl(config-router)#no auto-summary
Rl(config-router)#no sync
Rl (config-router)#exit
R2(config)#router bgp 500
R2(config-router)#neighbor 11.1.1.1 remote-as 500
R2(config-router)#neighbor 13.1.1.1 remote-as 500
R2(config-router)#neighbor 14.1.1.1 remote-as 500
R2(config-router)#network 20.0.0.0
R2(config-router)#no auto-summary
R2(config-router)#no sync
R2 (config-router)#exit
R3(config)#router bgp 500
R3(config-router)#neighbor 12.1.1.1 remote-as 500
R3(config-router)#neighbor 11.1.1.1 remote-as 500
R3(config-router)#neighbor 14.1.1.1 remote-as 500
R3(config-router)#network 30.0.0.0
R3(config-router)#no auto-summary
R3(config-router)#no sync
R3 (config-router)#exit
R4(config)#router bgp 500
R4(config-router)#neighbor 12.1.1.1 remote-as 500
R4(config-router)#neighbor 13.1.1.1 remote-as 500
R4(config-router)#neighbor 11.1.1.1 remote-as 500
R4(config-router)#network 40.0.0.0
R4(config-router)#no auto-summary
R4(config-router)#no sync
R4(config-router)#exit
R1#sh ip bgp summary
Neighbor V AS MsgRcvd MsgSent TbIVer InQ OutQ Up/Down State/PfxRcd
12.1.1.1 4 500 0 0 0 0 0 never Active
13.1.1.1 4 500 0 0 0 0 0 never Active
14.1.1.1 4 500 0 0 0 0 0 never Active
R2#sh ip bgp summary
Neighbor V AS MsgRcvd MsgSent TbIVer InQ OutQ Up/Down State/PfxRcd
11.1.1.1 4 500 0 0 0 0 0 never Active
13.1.1.1 4 500 0 0 0 0 0 never Active
14.1.1.1 4 500 0 0 0 0 0 never Active
R3#sh ip bgp summary
Neighbor V AS MsgRcvd MsgSent TbIVer InQ OutQ Up/Down State/PfxRcd
11.1.1.1 4 500 0 0 0 0 0 never Active
12.1.1.1 4 500 0 0 0 0 0 never Active
14.1.1.1 4 500 0 0 0 0 0 never Active
R4#sh ip bgp summary
Neighbor V AS MsgRcvd MsgSent TbIVer InQ OutQ Up/Down State/PfxRcd
11.1.1.1 4 500 0 0 0 0 0 never Active
12.1.1.1 4 500 0 0 0 0 0 never Active
13.1.1.1 4 500 0 0 0 0 0 never Active
What is Active State?
It’s actively trying to establish the neighborship (still trying).
BGP Active State Troubleshooting:
Active:
The router has sent an open packet and is waiting for a response. The state may cycle between active and idle. The neighbor may not know how to get back to this router because of the following reasons:
1. Neighbor is peering with the wrong address.
2. Neighbor does not have a neighbor statement for this router.
3. AS number is misconfiguration.
4. Neighbor does not have a route to the source IP address of the BGP open packet generated by this router.
5. Any extra command missing.
To troubleshoot BGP neighborship
First step: Make sure that there is connectivity to the neighbor
Second Step: The other issue can be a problem with the source address.
R1#ping 12.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.1.1.1, timeout is 2 seconds:
Success rate is 0 percent (0/5)
R1#sh ip route
Gateway of last resort is not set
C 1.0.0.0/8 is directly connected, Seriall/0
C 4.0.0.0/8 is directly connected, Seriall/1
C 10.0.0.0/8 is directly connected, FastEthemet0/0
11.0.0.0/24 is subnetted, 4 subnets
C 11.0.3.0 is directly connected, Loopback3
C 11.0.2.0 is directly connected, Loopback2
C 11.0.1.0 is directly connected, Loopback1
C 11.0.0.0 is directly connected, Loopback0
NOTE: No entry of the neighbor address (12.1.1.1, 13.1.1.1, 14.1.1.1)
Issues may be:
Here the router R1 don’t know how to reach neighbor address (12.1.1.1 ,13.1.1.1 , 14.1.1.1 )
To learn about those neighbors BGP relies on IGP protocol (RIP/EIGRP/OSPF) running inside the AS.
In our case, the problem is in routing. So, configure any of the routing protocols and make sure that you must advertise the loopback interface used for IBGP peering.
R1(config)#router ospf 10
R1(config-router)#net 10.0.0.0 0.255.255.255 area 0
R1(config-router)#net 1.0.0.0 0.255.255.255 area 0
R1(config-router)#net 4.0.0.0 0.255.255.255 area 0
R1(config-router)#net 11.0.0.0 0.255.255.255 area 0
R1 (config-router)#exit
R2(config)#router ospf 10
R2(config-router)#network 20.0.0.0 0.255.255.255 area 0
R2(config-router)#network 2.0.0.0 0.255.255.255 area 0
R2(config-router)#network 12.0.0.0 0.255.255.255 area 0
R2(config-router)#network 1.0.0.0 0.255.255.255 area 0
R2 (config-router)#end
R3(config)#router ospf 10
R3(config-router)#network 30.0.0.0 0.255.255.255 area 0
R3(config-router)#network 3.0.0.0 0.255.255.255 area 0
R3(config-router)#network 13.0.0.0 0.255.255.255 area 0
R3(config-router)#network 2.0.0.0 0.255.255.255 area 0
R3 (config-router)#end
R4(config)#router ospf 10
R4(config-router)#network 40.0.0.0 0.255.255.255 area 0
R4(config-router)#network 4.0.0.0 0.255.255.255 area 0
R4(config-router)#network 3.0.0.0 0.255.255.255 area 0
R4(config-router)#network 14.0.0.0 0.255.255.255 area 0
R4(config-router)#end
R1#sh ip bgp summary
Neighbor V AS MsgRcvd MsgSent TbIVer InQ OutQ Up/Down State/PfxRcd
12.1.1.1 4 500 0 0 0 0 0 never Active
13.1.1.1 4 500 0 0 0 0 0 never Active
14.1.1.1 4 500 0 0 0 0 0 never Active
Make sure that there is connectivity between neighbors
R1#ping 12.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/56/80 ms
Second Step:
The other issue can be Problem with source address.
BGP Issues with Source IP Address
When creating a BGP packet, the neighbor statement defines the destination IP address and the outbound interface defines the source IP address.
When a BGP packet is received for a new BGP session, the source address of the packet is compared to the list of neighbor statements:
If a match is found, a relationship is established.
If no match is found, the packet is ignored.
Make sure that the source IP address matches the address that the other router has in its neighbor statement.

To establish the IBGP session between router A and router D, which neighbor addresses should be used?
What IP address should Router R1 What IP address should Router R2
use for peering with router D? use for peering with router A?
2.2.2.2 1.1.1.1
3.3.3.1 4.4.4.2
30.1.1.1 10.1.1.1
Update-source command allows the BGP process to use the IP address of a specified interface as the source IP address of all BGP updates to that neighbor.
A loopback interface is usually used, because it will be available as long as the router is operational.
The IP address used in the neighbor command on the other router will be the destination IP address of all BGP updates and should be the loopback interface of this router.
The neighbor update-source command is normally used only with IBGP neighbors.
The address of an EBGP neighbor must be directly connected by default; the loopback of an EBGP neighbor is not directly connected.
CONFIGURATION:
R1(config)#Router bgp 500
R1(config-router)#Neighbor 12.1.1.1 update-source loopback 0
R1(config-router)#Neighbor 13.1.1.1 update-source loop 0
R1(config-router)#Neighbor 14.1.1.1 update-source loop 0
R1(config-router)#end
R2(config)#Router bgp 500
R2(config-router)#Neighbor 11.1.1.1 update-source loop 0
R2(config-router)#Neighbor 13.1.1.1 update-source loop 0
R2(config-router)#Neighbor 14.1.1.1 update-source loop 0
R3(config)#Router bgp 500
R3(config-router)#Neighbor 12.1.1.1 update-source loop 0
R3(config-router)#Neighbor 11.1.1.1 update-source loop 0
R3(config-router)#Neighbor 14.1.1.1 update-source loop 0
R3(config-router)#end
R4(config)#Router bgp 500
R4(config-router)#Neighbor 12.1.1.1 update-source loop 0
R4(config-router)#Neighbor 13.1.1.1 update-source loop 0
R4(config-router)#Neighbor 11.1.1.1 update-source loop 0
R4(config-router)#end
R1#sh ip bgp summary
Neighbor V AS MsgRcvd MsgSent TbIVer InQ OutQ Up/Down State/PfxRcd
12.1.1.1 4 500 7 7 8 0 0 00:02:54 1
13.1.1.1 4 500 6 6 8 0 0 00:01:19 1
14.1.1.1 4 500 6 6 8 0 0 00:00:52 1
R2#sh ip bgp summary
Neighbor V AS MsgRcvd MsgSent TbIVer InQ OutQ Up/Down State/PfxRcd
11.1.1.1 4 500 7 7 8 0 0 00:00:54 1
13.1.1.1 4 500 6 6 8 0 0 00:00:19 1
14.1.1.1 4 500 6 6 8 0 0 00:00:12 1
R3#sh ip bgp summary
Neighbor V AS MsgRcvd MsgSent TbIVer InQ OutQ Up/Down State/PfxRcd
11.1.1.1 4 500 7 7 8 0 0 00:01:54 1
12.1.1.1 4 500 6 6 8 0 0 00:01:14
14.1.1.1 4 500 6 6 8 0 0 00:00:55 1
R4#sh ip bgp summary
Neighbor V AS MsgRcvd MsgSent TbIVer InQ OutQ Up/Down State/PfxRcd
11.1.1.1 4 500 7 7 8 0 0 00:01:54 1
12.1.1.1 4 500 6 6 8 0 0 00:01:59 1
13.1.1.1 4 500 6 6 8 0 0 00:00:25 1
R1#sh ip route ospf
O 2.0.0.0/8 [110/128] via 1.1.1.2, 00:14:46, Seriall/0
O 3.0.0.0/8 [110/128] via 4.4.4.1, 00:14:46, Seriall/1
O 20.0.0.0/8 [110/65] via 1.1.1.2, 00:14:46, Seriall/0
O 40.0.0.0/8 [110/65] via 4.4.4.1, 00:14:46, Seriall/1
12.0.0.0/32 is subnetted, 4 subnets
O 12.0.1.1 [110/65] via 1.1.1.2, 00:14:46, Seriall/0
O 12.1.1.1 [110/65] via 1.1.1.2, 00:14:46, Seriall/0
O 12.0.3.1 [110/65] via 1.1.1.2, 00:14:46, Seriall/0
O 12.0.2.1 [110/65] via 1.1.1.2, 00:14:46, Seriall/0
13.0.0.0/32 is subnetted, 4 subnets
O 13.1.1.1 [110/129] via 4.4.4.1, 00:14:46, Seriall/1
[110/129] via 1.1.1.2, 00:14:46, Seriall/0
O 13.0.1.1 [110/129] via 4.4.4.1, 00:14:46, Seriall/1
[110/129] via 1.1.1.2, 00:14:46, Seriall/0
O 13.0.2.1 [110/129] via 4.4.4.1, 00:14:46, Seriall/1
[110/129] via 1.1.1.2, 00:14:46, Seriall/0
O 13.0.3.1 [110/129] via 4.4.4.1, 00:14:46, Seriall/1
[110/129] via 1.1.1.2, 00:14:46, Seriall/0
14.0.0.0/32 is subnetted, 4 subnets
O 14.0.3.1 [110/65] via 4.4.4.1, 00:14:47, Seriall/1
O 14.0.2.1 [110/65] via 4.4.4.1, 00:14:47, Seriall/1
O 14.0.1.1 [110/65] via 4.4.4.1, 00:14:47, Seriall/1
O 14.1.1.1 [110/65] via 4.4.4.1, 00:14:47, Seriall/1
O 30.0.0.0/8 [110/129] via 4.4.4.1, 00:14:47, Seriall/1
[110/129] via 1.1.1.2, 00:14:47, Seriall/0
If you will disable physical interface, neigborship will be maintained.
Rl(config)#int sl/0
R1(config-if)#shutdown
R1#sh ip bgp summary
Neighbor V AS MsgRcvd MsgSent TbIVer InQ OutQ Up/Down State/PfxRcd
12.1.1.1 4 500 7 7 8 0 0 00:02:54 1
13.1.1.1 4 500 6 6 8 0 0 00:01:19 1
14.1.1.1 4 500 6 6 8 0 0 00:00:52 1
R1#sh ip int brief
Interface IP-Address OK? Method Status Protocol
FastEthemet0/0 10.1.1.1 YES NVRAM up up
FastEthernet0/1 unassigned YES NVRAM administratively down down
Seriall/0 1.1.1.1 YES NVRAM administratively down down
Seriall/1 4.4.4.2 YES NVRAM up up
Seriall/2 unassigned YES NVRAM administratively down down
Seriall/3 unassigned YES NVRAM administratively down down
LoopbackO 11.1.1.1 YES NVRAM up up
Loopback! 11.0.1.1 YES NVRAM up up
Loopback2 11.0.2.1 YES NVRAM up up
Loopback3 11.0.3.1 YES NVRAM up up
R1(config)#int sl/0
R1(config-if)#no shutdown
BGP Authentication:
Make sure that the authentication is established between all the peers and they should use password as cisco12.
The peering should establish only if both the routers run BGP v4.
R1(config)# router bgp 500
Rl(config-router)# neighbor 12.1.1.1 password cisco12
Rl(config-router)# neighbor 13.1.1.1 password cisco12
Rl(config-router)# neighbor 14.1.1.1 password cisco12
Rl(config-router)# neighbor 12.1.1.1 version 4
Rl(config-router)# neighbor 13.1.1.1 version 4
Rl(config-router)# neighbor 14.1.1.1 version 4
R2(config)# router bgp 500
R2(config-router)# neighbor 11.1.1.1 password ciscol23
R2(config-router)# neighbor 13.1.1.1 password ciscol23
R2(config-router)# neighbor 14.1.1.1 password ciscol23
R2(config-router)# neighbor 11.1.1.1 version 4
R2(config-router)# neighbor 13.1.1.1 version 4
R2(config-router)# neighbor 14.1.1.1 version 4
R2(config-router)# end
R3(config)# router bgp 500
R3(config-router)# neighbor 12.1.1.1 password ciscol23
R3(config-router)# neighbor 11.1.1.1 password cisco!23
R3(config-router)# neighbor 14.1.1.1 password ciscol23
R3(config-router)# neighbor 12.1.1.1 version 4
R3(config-router)# neighbor 11.1.1.1 version 4
R3(config-router)# neighbor 14.1.1.1 version 4
R3(config-router)# end
R4(config)# router bgp 500
R4(config-router)# neighbor 12.1.1.1 password ciscol23
R4(config-router)# neighbor 13.1.1.1 password ciscol23
R4(config-router)# neighbor 11.1.1.1 password ciscol23
R4(config-router)# neighbor 12.1.1.1 version 4
R4(config-router)# neighbor 13.1.1.1 version 4
R4(config-router)# neighbor 11.1.1.1 version 4
R4(config-router)# end
R1#sh ip bgp summary
Neighbor V AS MsgRcvd MsgSent TbIVer InQ OutQ Up/Down State/PfxRcd
11.1.1.1 4 500 5 6 8 0 0 00:00:21 1
13.1.1.1 4 500 5 5 8 0 0 00:00:40 1
14.1.1.1 4 500 5 5 8 0 0 00:00:33 1







Comments