iBGP and eBGP With or Without A Loopback Address
iBGP and eBGP With or Without A Loopback Address
Introduction
BGP is an exterior gateway protocol (EGP), used to perform interdomain routing in TCP/IP networks. A BGP
router needs to establish a connection (on TCP port 179) to each of it's BGP peers before BGP updates can be
exchanged. The BGP session between two BGP peers is said to be an external BGP (eBGP) session if the BGP
peers are in different autonomous systems (AS) . A BGP session between two BGP peers is said to be an internal
BGP (iBGP) session if the BGP peers are in the same autonomous systems.
By default, the peer relationship is established using the IP address of the interface closest to the peer router.
However, using the neighbor update-source (registered customers only) command, any operational interface,
including the loopback interface, can be specified to be used for establishing TCP connections. This method of
peering using a loopback interface is useful since it will not bring down the BGP session when there are multiple
paths between the BGP peers, which would otherwise result in tearing down the BGP session if the physical
interface used for establishing the session goes down. In addition to that, it also allows the routers running BGP
with multiple links between them to load balance over the available paths.
The sample configurations in this document are for iBGP and eBGP, both with and without a loopback addresses.
Note: You can use these configurations for establishing neighbor relationship. Refer to Using the Border Gateway
Protocol for Interdomain Routing for more complex configurations.
Prerequisites
Requirements
Before you attempt this configuration, ensure that you meet this requirement:
This document is not restricted to specific software and hardware versions. The command outputs shown in this
document were taken from the 2500 Series Routers running IOS® version 12.2(24a).
Conventions
For more information on document conventions, refer to Cisco Technical Tips Conventions.
Configure
This section contains the following configuration examples:
iBGP Configuration
eBGP Configuration
In this section, you are presented with the information to configure the features described in this document.
Note: To find additional information on the commands used in this document, use the Command Lookup Tool
(registered customers only) .
Network Diagram
iBGP Configuration
R1-AGS R6-2500
Current configuration:
end
eBGP Configuration
In this configuration, the router R1-AGS is in AS 300 and Router R6-2500 is in AS 400.
R1-AGS R6-2500
Current configuration:
interface Serial1
Current configuration:
ip address 10.10.10.1 255.255.255.0
!
!-- Output suppressed.
router bgp 300
interface Serial0
!--- Enables BGP for the autonomous
ip address 10.10.10.2 255.255.255.0
!--- system 300.
!
router bgp 400
neighbor 10.10.10.2 remote-as 400
neighbor 10.10.10.1 remote-as 300
!--- Specifies a neighbor 10.10.10.2
!-- Output suppressed.
!--- in the remote AS 400, making
!--- this an eBGP connection.
end
end
Peers must be directly connected when using eBGP. If they are not directly connected, the neighbor ebgp-
multihop (registered customers only) command must be used and a path through an IGP or static route to reach
the peer must exist in order for the routers to establish neighbor relationship. In the configuration above, R1-AGS
router belongs to AS 300 while R6-2500 router belongs to AS 400.
You can configure iBGP using a loopback address (or any other operational interface) as shown in this section.
R1-AGS R6-2500
Current configuration:
end
You can also configure eBGP using a loopback address (or any other operational interface) as shown in this section.
Loopback interfaces are used in this manner to guarantee reachability in networks with multiple paths as shown in
the Load Sharing Using the Loopback Address as a BGP Neighbor section of Load Sharing with BGP in Single and
Multihomed Environments: Sample Configurations.
R1-AGS R6-2500
Current configuration:
Current configuration:
interface Loopback0
ip address 1.1.1.1 255.255.255.255
! !-- Output suppressed.
interface Serial1
ip address 10.10.10.1 255.255.255.0
! interface Loopback0
router bgp 300 ip address 2.2.2.2 255.255.255.255
neighbor 2.2.2.2 remote-as 400 !
neighbor 2.2.2.2 ebgp-multihop 2 interface Serial0
ip address 10.10.10.2 255.255.255.0
!--- This command changes the ttl value in !
!--- order to allow the packet to reach the router bgp 400
!--- external BGP peer which is not directly neighbor 1.1.1.1 remote-as 300
!--- connected or is using an interface other neighbor 1.1.1.1 ebgp-multihop 2
!--- than the directly connected interface. neighbor 1.1.1.1 update-source Loopback0
!
neighbor 2.2.2.2 update-source Loopback0 ip route 1.1.1.1 255.255.255.255 10.10.10.1
end
Verify
These sections provide information you can use to confirm your configurations are working properly. Certain show
commands are supported by the Output Interpreter Tool , which allows you to view an analysis of show command
output.
Use the show ip bgp neighbors (registered customers only) command to display information about the TCP and
Border Gateway Protocol (BGP) connections and verify if the BGP peer is established. The output of the show ip
bgp neighbors command below shows the BGP state as 'Established', which indicates that the BGP peer
relationship has been established successfully.
The show ip bgp neighbors command has been used above with the modifier | include BGP. This makes the output
more readable by filtering the the command output and displaying the relevant parts only.
In addition, the show ip bgp summary (registered customers only) command can also be used to display the
status of all BGP connections, as shown below.
Use the show ip bgp neighbors (registered customers only) command to display information about the TCP and
Border Gateway Protocol (BGP) connections and verify if the BGP peer is established. The output of the show ip
bgp neighbors command below shows the BGP state as 'Established', which indicates that the BGP peer
relationship has been established successfully.
In addition, the show ip bgp summary (registered customers only) command can also be used to display the
status of all BGP connections, as shown below.
Use the show ip bgp neighbors (registered customers only) command to display information about the TCP and
Border Gateway Protocol (BGP) connections and verify if the BGP peer is established. The output of the show ip
bgp neighbors command below shows the BGP state as 'Established', which indicates that the BGP peer
relationship has been established successfully.
In addition, the show ip bgp summary (registered customers only) command can also be used to display the
status of all BGP connections, as shown below.
Use the show ip bgp neighbors (registered customers only) command to display information about the TCP and
Border Gateway Protocol (BGP) connections and verify if the BGP peer is established. The output of the show ip
bgp neighbors command below shows the BGP state as 'Established', which indicates that the BGP peer
relationship has been established successfully.
In addition, the show ip bgp summary (registered customers only) command can also be used to display the
status of all BGP connections, as shown below.
Troubleshoot
Refer to Why Do BGP Neighbors Toggle Between Idle, Connect, and Active States? and Troubleshooting BGP for
troubleshooting information.
Related Information
EBGP Multihop and the update-source Command
Load Sharing with BGP in Single and Multihomed Environments: Sample Configurations
BGP Support Page
Technical Support - Cisco Systems