You are on page 1of 8

Cisco - Sample Configuration for iBGP and eBGP With or Without a Loopback Address

Page 1 of 8

Sample Configuration for iBGP and eBGP With or Without a Loopback Address
Author: Syed Faraz Shamim

TAC Notice: What's C han g i n g o n T A C We b

H el p u s h el p y ou .
j k l m n Excellent j k l m nG
Please rate this d o c u m en t. o o d

Contents
Introduction Prerequisites Requirements Components Used Conventions Configure Network Diagram iBGP Configuration eBGP Configuration iBGP Configuration with a Loopback Address eBGP Configuration with a Loopback Address Verify Verify iBGP Configuration Verify eBGP Configuration Verify iBGP Configuration with a Loopback Address Verify eBGP Configuration with a Loopback Address Troubleshoot Related Information

j k l m n

j k l m nF j k l m nP

A v er a g e a ir o o r

j k l m nY j k l m n j k l m nJ

T his d o c u m en t so lv ed m y p ro b lem . es N o u s t b r o w s i ng

S u g g estio n s f o r im p ro v em en t:

( 2 5 6 ch a r a cter li m i t)

Send

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

http://kbase/paws/servlet/ViewFile/13751/23.xml?convertPaths=1

8/24/2005

Cisco . In addition to that. Note: You can use these configurations for establishing neighbor relationship.2(24a). ensure that you meet this requirement: Knowledge of BGP protocols Components Used This document is not restricted to specific software and hardware versions. use the Command Lookup Tool ( registered customers only) . which would otherwise result in tearing down the BGP session if the physical interface used for establishing the session goes down. Configure This section contains the following configuration examples: iBGP Configuration eBGP Configuration iBGP Configuration with a Loopback Address eBGP Configuration with a Loopback Address In this section. refer to Cisco Technical Tips Conventions. Conventions For more information on document conventions. both with and without a loopback addresses. Refer to Using the Border Gateway Protocol for Interdomain Routing for more complex configurations. Prerequisites Requirements Before you attempt this configuration. you are presented with the information to configure the features described in this document.Sample Configuration for iBGP and eBGP With or Without a Loopback Address Page 2 of 8 multiple paths between the BGP peers. Network Diagram This document uses this network setup: http://kbase/paws/servlet/ViewFile/13751/23. Note: To find additional information on the commands used in this document.xml?convertPaths=1 8/24/2005 . The sample configurations in this document are for iBGP and eBGP. it also allows the routers running BGP with multiple links between them to load balance over the available paths. The command outputs shown in this document were taken from the 2500 Series Routers running IOS® version 12.

eBGP Configuration R1-AGS Current configuration: !-.255. Current configuration: interface Serial1 ip address 10.10. end R6-2500 In the configuration above.Specifies a neighbor 10.Output suppressed.Output suppressed.10.255. router bgp 400 neighbor 10. ! router bgp 400 interface Serial0 ip address 10.2 remote-as 400 !-.this an iBGP connection.255.1 remote-as 300 R6-2500 http://kbase/paws/servlet/ViewFile/13751/23. making end !--.10.Output suppressed.in the remote AS 400.2 255.255. both routers are in AS number 400.10.10.Enables BGP for the autonomous ! !--.10.255.10.0 !-.Cisco .10.system 400.0 ! router bgp 400 neighbor 10.Sample Configuration for iBGP and eBGP With or Without a Loopback Address Page 3 of 8 iBGP Configuration R1-AGS Current configuration: !-.1 255.xml?convertPaths=1 8/24/2005 .10. !--.10.Enables BGP for the autonomous !--. neighbor 10.10.2 !--.2 remote-as 400 interface Serial0 ip address 10.10.10.10.Output suppressed interface Serial1 ip address 10. !-.255.10.2 255. !--.255.255.1 remote-as 400 neighbor 10.Output suppressed.Output suppressed.10.1 255.10.0 !--.10.0 Current configuration: ! router bgp 300 !-.system 300.

255.2 remote-as 300 neighbor 2. !--.2 !--.remote peer address used for peering !--.255 ! interface Serial0 ip address 10.1.10.This command specifies that the TCP router bgp 300 !--.connection with the specified external neighbor 1.1.Output suppressed. end end eBGP Configuration with a Loopback Address You can also configure eBGP using a loopback address (or any other operational interface) as shown in this section.10.255. interface Loopback0 ip address 2.2 255.1 255.255.address on the loopback interface.1 update-source Loopback0 !--.2.2 255.1 255.10.Output suppressed.1.255.2.10.1 remote-as 300 !--.255.Output suppressed.Output suppressed. 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 http://kbase/paws/servlet/ViewFile/13751/23.this an eBGP connection.2 !-. end Peers must be directly connected when using eBGP.1. the neighbor ebgpmultihop ( 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.1. ! ip route 1. In the configuration above.2 update-source Loopback0 Current configuration: !-.10.255.xml?convertPaths=1 8/24/2005 . making !-.This static route ensures that the !--. R1AGS router belongs to AS 300 while R6-2500 router belongs to AS 400.255. interface Loopback0 ip address 1. end !-.255.Output suppressed.Output suppressed.Sample Configuration for iBGP and eBGP With or Without a Loopback Address Page 4 of 8 !--.2.2.is reachable.peer should be established using the neighbor 1.10.255 10.10.255.255 ! interface Serial1 ip address 10.0 ! !--.10.1 255. If they are not directly connected.1 ! ip route 2.10.255 10. !-.2 255.255.2.1.1. iBGP Configuration with a Loopback Address You can configure iBGP using a loopback address (or any other operational interface) as shown in this section.255.Specifies a neighbor 10.0 ! router bgp 300 neighbor 2.1. !--.2.2.255.in the remote AS 400.Cisco . R1-AGS Current configuration: R6-2500 !-.2.10.

255.2.1.10.is reachable.255. router bgp 400 neighbor 1.2.10.2 ebgp-multihop 2 Current configuration: !-.10.connected or is using an interface other ! !--.2. end Verify These sections provide information you can use to confirm your configurations are working properly.2.2 255. R1-AGS Current configuration: R6-2500 !-.255.Output suppressed.2 update-source Loopback0 neighbor 1.2.1.2.0 !--.Cisco .Sample Configuration for iBGP and eBGP With or Without a Loopback Address Page 5 of 8 BGP in Single and Multihomed Environments: Sample Configurations. The output of the show http://kbase/paws/servlet/ViewFile/13751/23.0 ! router bgp 300 neighbor 2. Verify iBGP Configuration 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. ip route 2.1.10.255.255. ! !-.255.255 10.2.This command changes the ttl value in ! !--. interface Loopback0 ip address 1.This static route ensures that the !--.255.1 remote-as 300 neighbor 2.address on the loopback interface.order to allow the packet to reach the interface Serial0 !--.10.10.255.2 255.10.connection with the external BGP ip route 1.10.external BGP peer which is not directly ip address 10.1.255.1 update-source Loopback0 !--.1 ebgp-multihop 2 neighbor 1.255 10.255 ! interface Serial1 ip address 10.Output suppressed.2. Certain show commands are supported by the Output Interpreter Tool .1 !--.2 !--.1.This command specifies that the TCP ! !--.1.1.2 255. interface Loopback0 ip address 2.peer should be established using the !--. which allows you to view an analysis of show command output.1.255 !--.2 remote-as 400 neighbor 2.1.1. end !-.1 255.1 255.2.xml?convertPaths=1 8/24/2005 .255.Output suppressed.Output suppressed.than the directly connected interface.2.remote peer address used for peering !--.1 255.255.255.

http://kbase/paws/servlet/ViewFile/13751/23.1.2. R1-AGS# show ip bgp neighbors | include BGP BGP neighbor is 10.2.10. which indicates that the BGP peer relationship has been established successfully.2. This makes the output more readable by filtering the the command output and displaying the relevant parts only.xml?convertPaths=1 8/24/2005 . The output of the show ip bgp neighbors command below shows the BGP state as 'Established'.2. which indicates that the BGP peer relationship has been established successfully. external link BGP version 4. R1-AGS(9)# show ip bgp summary BGP router identifier 10. which indicates that the BGP peer relationship has been established successfully.10.10. R1-AGS(9)# show ip bgp summary BGP router identifier 10.2. local AS number 400 BGP table version is 1. the show ip bgp summary ( registered customers only) command can also be used to display the status of all BGP connections. the show ip bgp summary ( registered customers only) command can also be used to display the status of all BGP connections.2 V 4 AS MsgRcvd MsgSent 400 3 3 TblVer 1 InQ OutQ Up/Down State/PfxRcd 0 0 00:00:26 0 Verify iBGP Configuration with a Loopback Address 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. internal link BGP version 4. as shown below. main routing table version 1 Neighbor 10.2 V 4 AS MsgRcvd MsgSent 400 3 3 TblVer 1 InQ OutQ Up/Down State/PfxRcd 0 0 00:00:26 0 Verify eBGP Configuration 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.10.1.2 BGP state = Established. up for 00:00:17 BGP table version 1.10.Cisco .2. up for 00:04:20 BGP table version 1.2 BGP state = Established.10. In addition. as shown below. remote router ID 2.10.2.1. local AS number 300 BGP table version is 1. neighbor version 1 In addition.10. The output of the show ip bgp neighbors command below shows the BGP state as 'Established'. R1-AGS# show ip bgp neighbors | include BGP BGP neighbor is 10.Sample Configuration for iBGP and eBGP With or Without a Loopback Address Page 6 of 8 ip bgp neighbors command below shows the BGP state as 'Established'. remote AS 400. neighbor version 1 R1-AGS# The show ip bgp neighbors command has been used above with the modifier | include BGP.10. main routing table version 1 Neighbor 10. remote router ID 2. remote AS 400.10.

neighbor version 1 R1-AGS# In addition.2.1. R1-AGS(9)# show ip bgp summary BGP table version is 1.2 BGP state = Established. which indicates that the BGP peer relationship has been established successfully. main routing table version 1 Neighbor 2. R1-AGS(9)# show ip bgp summary BGP router identifier 1.1.2.2.2 BGP state = Established. and Active States? and Troubleshooting BGP for troubleshooting information. remote router ID 2.Cisco . neighbor version 1 External BGP neighbor may be up to 2 hops away.2.2. the show ip bgp summary ( registered customers only) command can also be used to display the status of all BGP connections.2.2. R1-AGS# show ip bgp neighbors | include BGP BGP neighbor is 2. up for 00:00:28 BGP table version 1.xml?convertPaths=1 8/24/2005 . Connect. The output of the show ip bgp neighbors command below shows the BGP state as 'Established'.2 V 4 AS MsgRcvd MsgSent 400 3 3 TblVer 1 InQ OutQ Up/Down State/PfxRcd 0 0 00:00:26 0 Verify eBGP Configuration with a Loopback Address 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.2. local AS number 300 BGP table version is 1. up for 00:00:16 BGP table version 1.2. internal link BGP version 4. Related Information EBGP Multihop and the update-source Command Load Sharing with BGP in Single and Multihomed Environments: Sample Configurations BGP Support Page http://kbase/paws/servlet/ViewFile/13751/23. as shown below. as shown below.2.Sample Configuration for iBGP and eBGP With or Without a Loopback Address Page 7 of 8 R1-AGS# show ip bgp neighbors | include BGP BGP neighbor is 2. remote router ID 2.2.1. main routing table version 1 Neighbor 2.2. the show ip bgp summary ( registered customers only) command can also be used to display the status of all BGP connections. external link BGP version 4.2 V 4 AS MsgRcvd MsgSent 400 3 3 TblVer 1 InQ OutQ Up/Down State/PfxRcd 0 0 00:00:26 0 Troubleshoot Refer to Why Do BGP Neighbors Toggle Between Idle. remote AS 300. In addition.2. remote AS 400.2.

http://kbase/paws/servlet/ViewFile/13751/23. Inc.Cisco Systems All contents are Copyright © 1992-2005 Cisco Systems.xml?convertPaths=1 8/24/2005 . Important Notices and Privacy Statement.Cisco .Sample Configuration for iBGP and eBGP With or Without a Loopback Address Page 8 of 8 Technical Support . All rights reserved.