You are on page 1of 19

BGP Connection Basics

External BGP

Unlike most other routing protocols, Border Gateway Protocol (BGP) does not automatically discover
neighbors and then send updates. It must be manually configured with information regarding what devices
to peer with and what information to advertise to those peers. Security is the main driver behind this
method.

So when configuring a Cisco router to advertise using BGP, the first step is to establish peering between the
BGP devices and verify that the BGP devices have peered. It is important to stop and verify connectivity.
Nothing will work if the underlying connection is not made, so you should verify connectivity while things are
simple.

This document is about establishing this basic connectivity, and covers external BGP peering. Internal BGP
is covered in a later document.

Generally, but not always, External BGP (EBGP) peers are directly connected. This document covers basic
connectivity step by step, using the following scenario:

AS 65001 AS 65002
Lo0 Lo0
172.16.255.1/32 172.16.255.2/32
Router C Router D

S0/0/1 S0/0/1
192.168.1.1/24 192.168.1.2/24

As shown in the example, the BGP devices are directly connected using ports S0/0/1, and IP addresses
192.168.1.1 & 192.168.1.2.

1 BGP Connection Basics: External BGP © 2009 Cisco Systems, Inc.

Current configuration : 882 bytes Current configuration : 1319 bytes ! ! version 12.cisco.. Processor board ID FTX1013A1DJ Processor board ID FTX1107A6A1 2 FastEthernet interfaces 2 FastEthernet interfaces 2 Serial(sync/async) interfaces 2 Serial(sync/async) interfaces 1 Virtual Private Network (VPN) Module 1 Virtual Private Network (VPN) Module DRAM configuration is 64 bits wide with DRAM configuration is 64 bits wide with parity enabled. RELEASE SOFTWARE (fc1) (fc1) Technical Support: Technical Support: http://www. Inc.4(13r)T.com/techsupport http://www.bin" ~ ~ ~ (<-.124-12. 2800 Software Cisco IOS Software.output omitted) ~ ~ ~ (<-.51) with Cisco 2811 (revision 53. Building configuration. Inc.output omitted) 2 BGP Connection Basics: External BGP © 2009 Cisco Systems.output omitted) ~ ~ ~ (<-.output omitted) System image file is "flash:c2800nm.output omitted) ~ ~ ~ (<-.4(1r) ROM: System Bootstrap. Version 12. . Copyright (c) 1986-2006 by Cisco Systems. Version [hqluong 1r]. 239K bytes of non-volatile configuration 239K bytes of non-volatile configuration memory..51) with 249856K/12288K bytes of memory.cisco. parity enabled. Compiled Fri 17-Nov-06 12:02 by Compiled Fri 17-Nov-06 12:02 by prod_rel_team prod_rel_team ROM: System Bootstrap. RELEASE SOFTWARE 12. 249856K/12288K bytes of memory.4 version 12.com/techsupport Copyright (c) 1986-2006 by Cisco Systems. memory.4(12).bin" advipservicesk9-mz. along with initial configurations: Router C Router D Version information: Version information: MikeC#s ver MikeD#s ver Cisco IOS Software.. RELEASE SOFTWARE (fc1) ~ ~ ~ (<-.Here is the version information. Version 12. Inc. Version (C2800NM-ADVIPSERVICESK9-M). 2800 Software (C2800NM-ADVIPSERVICESK9-M). 62720K bytes of ATA CompactFlash 62720K bytes of ATA CompactFlash (Read/Write) (Read/Write) Configuration register is 0x2101 Configuration register is 0x2102 MikeC# MikeD# Starting Configuration Starting Configuration MikeC# MikeD# MikeC#show run MikeD#show run Building configuration..4(12).124-12.output omitted) Cisco 2811 (revision 53. System image file is "flash:c2800nm- advipservicesk9-mz.4 ~ ~ ~ (<-. RELEASE SOFTWARE (fc1) 12.

168.1.255 ! ! interface FastEthernet0/0 interface FastEthernet0/0 no ip address no ip address shutdown shutdown duplex auto duplex auto speed auto speed auto ! ! interface FastEthernet0/1 interface FastEthernet0/1 no ip address no ip address shutdown shutdown duplex auto duplex auto speed auto speed auto ! ! interface Serial0/0/0 interface Serial0/0/0 no ip address no ip address shutdown shutdown ! ! interface Serial0/0/1 interface Serial0/0/1 ip address 192.255.255 ip address 172. as shown by the following: MikeC#s ip bgp summary % BGP not active MikeC# 3 BGP Connection Basics: External BGP © 2009 Cisco Systems.16.255.1 255.255.255.! ! interface Loopback0 interface Loopback0 ip address 172.255.255. .168.0 ip address 192.1 255.2 255.255.output omitted) ~ ~ ~ (<-.255.255.255.output omitted) MikeD# MikeC# At this point.1.16. BGP is not active. Inc.2 255.0 clock rate 2000000 ! ! ! ! ip http server ip http server no ip http secure-server no ip http secure-server ! ! ~ ~ ~ (<-.

28% jitter) *Oct 1 19:27:55. MikeC(config)#router bgp 65001 MikeC(config-router)#nei 192. Side note: If you exit configuration mode at this point and do a show running-config..2 open active delayed 34461ms (35000ms max.2 open failed: Connection refused by remote Notice that the BGP state went from Idle to Active. Inc.168.1.1. At this point. Active is not an operational state.2 went from Idle to Active *Oct 1 19:27:21. the router tries to establish a TCP connection with the neighboring device. local address 192. End with CNTL/Z. and allocate resources.1 *Oct 1 19:27:55. This command gives the ip address of the device.output omitted) ! router bgp 65001 no synchronization bgp log-neighbor-changes no auto-summary ! ~ ~ ~ (<-.168. one per line.2 remote-as 65002 Manually specify the BGP neighbor to peer with.168.output omitted) (2) MikeC(config-router)#nei 192.014: BGP: 192. End with CNTL/Z. MikeD(config)#router bgp 65002 MikeD(config-router)#nei 192.168.1 remote-as 65001 MikeD(config-router)#^Z MikeD# 4 BGP Connection Basics: External BGP © 2009 Cisco Systems. so you get the following output: *Oct 1 19:27:21.1.478: BGP: 192. Now it is time to enable BGP on Router D.1.168.168.2 open active. you will see the following in this IOS version: MikeC#s run Building configuration. which is the same as on Router C except for the neighbor’s IP address and AS number: MikeD#conf t Enter configuration commands. Router D has not been configured yet. one per line. ~ ~ ~ (<-.014: BGP: 192. and the autonomous system number that it belongs to.168.1.1.1. .168.478: BGP: 192. which will be discussed in more detail later..2 remote-as 65002 MikeC(config-router)#^Z MikeC# Now take a look at both configuration statements so that you can see what is happening: (1) MikeC(config)#router bgp 65001 Start the BGP process.1.Basic BGP Connectivity Now you will configure basic BGP connectivity: MikeC#conf t Enter configuration commands.

2 rcvd OPEN w/ optional parameter type 2 (Capability) len 2 *Oct 1 19:33:31.1 rcv OPEN.1.1 went from Idle to Active Oct 1 11:39:42.2 rcv OPEN w/ OPTION parameter len: 16 *Oct 1 19:33:31.955: BGP: 192.2 rcvd OPEN w/ optional parameter type 2 (Capability) len 6 *Oct 1 19:33:31.168. length 0 Oct 1 11:39:51.168.1.1. version 4.1.2 Oct 1 11:39:51.1.168.922: BGP: 192.2 open active.168.811: BGP: 192.168.168.2 send message type 1.926: BGP: 192. (Please note before you study the output in detail that only the last line is important. 28% jitter) Oct 1 11:39:51.1.1.1.168.168.955: BGP: 192.168. header) 26 Oct 1 11:39:51.1.955: BGP: 192. length 4 *Oct 1 19:33:31.1 passive open to 192.1.1. version 4.922: BGP: 192.2 went from OpenSent to OpenConfirm *Oct 1 19:33:31. header) 26 *Oct 1 19:33:31. holdtime 180 seconds Oct 1 11:39:51.168.2 rcv message type 1.926: BGP: 192.168.955: BGP: 192.168.1.2 rcvd OPEN w/ remote AS 65002 *Oct 1 19:33:31.168. On Router C: *Oct 1 19:33:31.1 sending OPEN. length 0 *Oct 1 19:33:31.1. holdtime 180 seconds *Oct 1 19:33:31.1 went from Active to Idle Oct 1 11:39:51.2 OPEN has MP_EXT CAP for afi/safi: 1/1 *Oct 1 19:33:31.1 rcv message type 1. my as: 65002.926: BGP: 192.1 OPEN has MP_EXT CAP for afi/safi: 1/1 Oct 1 11:39:51. my as: 65001.168.168.168.1.1.926: BGP: 192.168.168.1.922: BGP: 192.959: BGP: 192.1.1 OPEN has ROUTE-REFRESH capability(old) for all address-families Oct 1 11:39:51.168.168. holdtime 180 seconds *Oct 1 19:33:31. local address 192.168.168.1.1 open active delayed 30636ms (35000ms max.168.2 sending OPEN. length 4 Oct 1 11:39:51.955: BGP: 192.168. Inc.926: BGP: 192.1.1.1 went from Connect to OpenSent Oct 1 11:39:51.1.926: BGP: 192.1.811: BGP: 192.2 OPEN has CAPABILITY code: 128.955: BGP: 192.955: BGP: 192.1 rcvd OPEN w/ optional parameter type 2 (Capability) len 2 5 BGP Connection Basics: External BGP © 2009 Cisco Systems.1.168. length 0 *Oct 1 19:33:31.168.955: BGP: 192. length (incl.168. that is what they do. version 4.2 went from OpenConfirm to Established *Oct 1 19:33:31.1 rcv OPEN w/ OPTION parameter len: 16 Oct 1 11:39:51.1.1.918: BGP: 192.168. .168.2 OPEN has CAPABILITY code: 2.168.1.914: BGP: 192. header) 45 *Oct 1 19:33:31.168.926: %BGP-5-ADJCHANGE: neighbor 192.2 rcvd OPEN w/ optional parameter type 2 (Capability) len 2 *Oct 1 19:33:31.1.1.1.1 went from Idle to Connect Oct 1 11:39:51.1.1.1.926: BGP: 192.959: BGP: 192.168.2 rcv OPEN.914: BGP: 192.2 OPEN has ROUTE-REFRESH capability(new) for all address-families BGP: 192. length (excl.168. length (excl.168.2 OPEN has CAPABILITY code: 1.955: BGP: 192.168.1.959: BGP: 192.168.1 rcvd OPEN w/ optional parameter type 2 (Capability) len 6 Oct 1 11:39:51.1.168.2 OPEN has ROUTE-REFRESH capability(old) for all address-families *Oct 1 19:33:31.1.926: BGP: 192.1.1 rcvd OPEN w/ optional parameter type 2 (Capability) len 2 Oct 1 11:39:51. the rest shows just the progression in getting there).1.168.926: BGP: 192.1 OPEN has CAPABILITY code: 1.1 *Oct 1 19:33:31.926: BGP: 192.1 OPEN has CAPABILITY code: 128. holdtime 180 seconds Oct 1 11:39:51.1.1.955: BGP: 192.2 Up The same on Router D: Oct 1 11:39:42.926: BGP: 192.914: BGP: 192. version 4.955: BGP: 192.Now that the neighbors have been configured to peer with each other.2 went from Active to OpenSent *Oct 1 19:33:31.959: BGP: 192.168.

1.963: BGP: 192. length 0 Oct 1 11:39:51.959: BGP: 192.255.2. (Remember that for security purposes. a digit greater than 0 means that the state is established. since you have not yet configured the ability to advertise. Inc. This situation is acceptable. the State/PfxRcd field is reporting 0.168. . length (incl. external link BGP version 4.168.168.1 Up The preceding output shows that BGP connectivity between the peers is up and operational. use the show ip bgp neighbors command: MikeC#s ip bgp nei BGP neighbor is 192. main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 192.1.1 OPEN has CAPABILITY code: 2. the devices have not been configured to do so yet.2 BGP state = Established. If you really need to see that the state is Established. remote AS 65002.16.168. 6 BGP Connection Basics: External BGP © 2009 Cisco Systems.1 rcvd OPEN w/ remote AS 65001 Oct 1 11:39:51. last write 00:00:12. local AS number 65001 BGP table version is 1. and in this case. The last line says that the state went from OpenConfirm to Established.16.1. you can use the following show commands to determine the state of the BGP peers: MikeC#s ip bgp sum BGP router identifier 172.168.1 send message type 1.1.959: BGP: 192. no prefixes have been received.1 went from OpenSent to OpenConfirm Oct 1 11:39:51. Once the state is Established. not established.255. Oct 1 11:39:51.963: %BGP-5-ADJCHANGE: neighbor 192.1.168. keepalive interval is 60 seconds Neighbor capabilities: Route refresh: advertised and received(old & new) Address family IPv4 Unicast: advertised and received ~ ~ ~ (<-. the BGP devices have peered and can now pass network information—except that in the example here. up for 00:03:12 Last read 00:00:12.1 went from OpenConfirm to Established Oct 1 11:39:51. If you want to really get into the preceding details.1. If you missed the preceding output or are checking on BGP at a later time. there is more information on the BGP states later in this document.2 4 65002 6 6 1 0 0 00:02:52 0 Note that when using the show ip bgp summary command.1 OPEN has ROUTE-REFRESH capability(new) for all address-families BGP: 192.1.168. The omitted output is counters that become significant after BGP has begun to advertise.959: BGP: 192.168.output omitted) The BGP state is given as Established.1.168. header) 45 Oct 1 11:39:51.959: BGP: 192. and you have not told BGP to do that yet).1. you have to manually tell BGP to advertise prefixes. remote router ID 172.1. hold time is 180.

you have a more serious problem and it is not a BGP problem. BGP has not been configured on this device. . 2) The show ip bgp summary command gives the following output: MikeC#s ip bgp sum MikeC# No output at all—fairly ambiguous. and you still cannot get to the Established state. Please note that many times you have access to only one of the BGP peers. Your colleague insists that BGP is configured on the router. If you are sure that your configuration is correct. what will be the output of the show ip bgp summary command? The following output came from Router C when it was configured for BGP but Router D was not: MikeC#s ip bgp sum BGP router identifier 172. But make sure that you have thoroughly checked your end first.If the state is not Established. you will have to contact the administrator of the other autonomous system and have them verify their configuration. and it is usually a configuration problem.16.255.168. local AS number 65001 BGP table version is 1. what can go wrong? More than you might think. this means that.1. the other peer may belong to another autonomous system that you cannot access. The show running-config command can verify this situation.2 4 65002 0 0 0 0 0 never Active MikeC# You can see that the State/PfxRcd field says Active instead of showing a digit. main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 192. What does the show ip bgp neighbors command have to say? MikeC#s ip bgp nei MikeC# 7 BGP Connection Basics: External BGP © 2009 Cisco Systems. If you see BGP configured and you are getting this output. or you may have done it yourself. for whatever reason. What Can Go Wrong? In its simplicity. Inc. but for whatever reason BGP is not there.1. 1) You execute the show ip bgp summary command and receive the following: MikeC#s ip bgp sum % BGP not active MikeC# As shown here.

Is something stopping traffic to or from TCP port 179 (BGP uses TCP port 179)? That is also a possibility.0.2. remote router ID 0. If it is not.16. external link BGP version 4.0 BGP state = Idle Last read 00:00:00. you should ensure that you have a good reason for doing so.  Check out the following output from the show ip bgp summary and show ip bgp neighbors commands: MikeC#s ip bgp sum BGP router identifier 172. last write 00:00:00.output omitted) The BGP process has been configured. main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 192. but no neighbor has been specified. keepalive interval is 60 seconds Message statistics: InQ depth is 0 OutQ depth is 0 Sent Rcvd Opens: 0 0 Notifications: 0 0 Updates: 0 0 Keepalives: 0 0 Route Refresh: 0 0 Total: 0 0 Default minimum time between advertisement runs is 30 seconds 8 BGP Connection Basics: External BGP © 2009 Cisco Systems. .  Is the neighbor directly connected? This means that the neighbor address that you are using needs to be the IP address of the neighboring device’s directly connected interface. A quick look at show running-config tells you what you need to know: MikeC#s run ~ ~ ~ (<-. but it is a little more involved. Can you ping the neighbor’s IP address? If not. but it is just not working.255. It is equally silent on the subject.168. you can still peer with a nondirectly connected interface.  Since you are building a TCP connection. there must be connectivity between the devices. local AS number 65001 BGP table version is 1.output omitted) ! router bgp 65001 no synchronization bgp log-neighbor-changes no auto-summary ! ~ ~ ~ (<-.2. before peering with an interface that is not directly connected. A more detailed explanation will follow. Inc. you must first troubleshoot the connectivity problem. hold time is 180.2. remote AS 65002.1. 3) The configuration is there.0. However.168. There are several things that can cause this issue.2 4 65002 0 0 0 0 0 never Idle MikeC#s ip bgp nei BGP neighbor is 192.

------- Total: 0 0 Number of NLRIs in the update sent: max 0.0.168. min 0 Connections established 0.1. hold time is 180. ---- Prefixes Current: 0 0 Prefixes Total: 0 0 Implicit Withdraw: 0 0 Explicit Withdraw: 0 0 Used as bestpath: n/a 0 Used as multipath: n/a 0 Outbound Inbound Local Policy Denied Prefixes: -------.2.168.0. last write 00:00:11. No active TCP connection MikeC# Note that the show ip bgp summary command shows the state as Idle and that the show ip bgp neighbors command also shows the state as Idle and specifies at the end that there is no active TCP connection.2.2. MikeC#s ip bgp nei BGP neighbor is 192.168.1. remote router ID 0.1.0. main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 192.0  How about this output from the show ip bgp summary and show ip bgp neighbors commands: MikeC#s ip bgp sum BGP router identifier 172. Can you find a reason for this? Look more carefully at the neighbor that is specified.1. Inc. For address family: IPv4 Unicast BGP table version 1.16.0 BGP state = Active Last read 00:00:11. external link BGP version 4. The neighbor is 192. local AS number 65001 BGP table version is 1. remote router ID 0. not 192. remote AS 65022.168.2. Mask 0x2 1 update-group member Sent Rcvd Prefix activity: ---.0. dropped 0 Last reset never External BGP neighbor not directly connected.168. Offset 0.255.2 4 65022 2 2 0 0 0 never Active MikeC#s ip bgp nei BGP neighbor is 192. . but not close enough. external link BGP version 4.2. keepalive interval is 60 seconds Message statistics: InQ depth is 0 OutQ depth is 0 Sent Rcvd Opens: 2 2 9 BGP Connection Basics: External BGP © 2009 Cisco Systems.2. It is easy to miss the fact that it is not the IP address of the neighbor—close. neighbor version 0/0 Output queue size : 0 Index 1. remote AS 65002.

The wrong AS number will give the preceding output. that is not always the case. remote router ID 0. MikeC#s ip bgp nei BGP neighbor is 192. and AS 65022 was input. dropped 0 Last reset never No active TCP connection MikeC# Review the neighbor’s autonomous system (AS) number. It may be a typo. you are peering with AS 65002. Offset 0. ------- Total: 0 0 Number of NLRIs in the update sent: max 0.1. note that in the example. neighbor version 0/0 Output queue size : 0 Index 1.0. shows peering between the loopback interfaces instead of between the directly connected interfaces. Inc. . ---- Prefixes Current: 0 0 Prefixes Total: 0 0 Implicit Withdraw: 0 0 Explicit Withdraw: 0 0 Used as bestpath: n/a 0 Used as multipath: n/a 0 Outbound Inbound Local Policy Denied Prefixes: -------.0.2. The following example. Cisco routers have the ability to EBGP peer with devices that are not directly connected.168. Mask 0x2 1 update-group member Sent Rcvd Prefix activity: ---. remote AS 65022. 10 BGP Connection Basics: External BGP © 2009 Cisco Systems.0 Peering with Nondirectly Connected Interfaces While in most instances you will be peering with directly connected BGP devices. Notifications: 2 0 Updates: 0 0 Keepalives: 0 0 Route Refresh: 0 0 Total: 2 2 Default minimum time between advertisement runs is 30 seconds For address family: IPv4 Unicast BGP table version 1. or it may be that the number you were given is incorrect. external link BGP version 4. min 0 Connections established 0.

2/24 By default.2 remote-as 65002 MikeC(config-router)#nei 172. but that is usually not necessary.793: BGP: 172.1.2 ebgp-multihop MikeC# *Oct 2 00:02:52. or you can let it default to 255. 28% jitter) *Oct 2 00:03:22.168.255.255. In the previous example. The peering was built between the directly connected interfaces. Router C was told to peer with Router D IP address 192. The example shows peering using loopback interfaces. where the devices peered with the directly connected interfaces.2.16.2 update-source loopback 0 MikeC(config-router)#nei 172.255. AS 65001 AS 65002 Lo0 Lo0 172. This command tells the router that the BGP peer is not directly connected but is multiple hops away.To repeat.16. one per line.2 went from Idle to Active *Oct 2 00:02:52.16. Here is the configuration: Router C MikeC#conf t Enter configuration commands.117: BGP: 172. The example here shows a connection using the loopback 0 interfaces. you must add the neighbor <ip address> ebgp- multihop {ttl} command.2 open active delayed 30673ms (35000ms max. To peer with an interface that is not directly connected. the router does not find its peer by way of another path. The Time to Live (TTL) field allows you to specify the number of hops (security again). Router D was told to peer with Router C IP address 192.255. The same is true for Router D. Inc. then you use the neighbor <ip address> update-source <interface> command.2/32 Router C Router D S0/0/1 S0/0/1 192. Router C was not told to build the peering using the IP address of the serial interface.1/32 172.117: BGP: 172. MikeC(config)#router bgp 65001 MikeC(config-router)#nei 172.168.2 active open failed . there is only one path. However.255.255. If you want your router to peer using the IP address of an interface that is not the one directly connected to its BGP neighbor (such as a loopback interface address). it did it by default.16. and if the link goes down.255.168. . Cisco routers use the IP address of the outgoing interface to peer with its BGP neighbor.1. You must also ensure that the peer uses that IP address in its neighbor statements. open active delayed 33707ms (35000ms max.1. if you are going to do this.255.1.168.16. 28% jitter) 11 BGP Connection Basics: External BGP © 2009 Cisco Systems.16.no route to peer. End with CNTL/Z. peering using loopback interfaces is a valid way to connect and loadshare when there are multiple links between the two peering routers.16.1/24 192.16. make sure that you have a good reason.1. Generally.

MikeD(config)#router bgp 65002 MikeD(config-router)#nei 172. MikeC(config)#ip route 172. The address is not in your autonomous system and is therefore not in your routing table.16. 12 BGP Connection Basics: External BGP © 2009 Cisco Systems. a hop count has not been specified. Inc. Router D MikeD#conf t Enter configuration commands. MikeD(config)#ip route 172.2 MikeC(config)#^z MikeC(config)# MikeD#conf t Enter configuration commands. 28% jitter) Looking at the show ip bgp summary and show ip bgp neighbors commands.16.16. You need a way to route to the peering IP address.255.1 remote-as 65001 MikeD(config-router)#nei 172.729: BGP: 172. or both.255.255. You will save yourself time if you remember this important point. .1 update-source loopback 0 MikeC(config-router)#nei 172. a lot of troubleshooting time is spent tracking down connectivity problems that turn out to be simply that the ebgp-multihop or the update- source commands have not been configured.  The ebgp-multihop command lets the router know that the TTL field must be set higher than 1 to allow the neighbor to be multiple hops away. and it is certainly not sharing its information with you. Think about it. one per line.255. This is a very common mistake when configuring non–directly connected BGP connectivity. so many people forget that it is needed for EBGP.255. open active delayed 26811ms (35000ms max.193: BGP: 172. Along with the problems mentioned in the “What Can Go Wrong?” section. If the router at the other end is configured correctly.255. You are not sharing internal network information with your neighboring autonomous system. though.255.193: BGP: 172.1 active open failed . 28% jitter) Oct 1 16:11:43.1.1 ebgp-multihop MikeD# Oct 1 16:11:09.255. End with CNTL/Z.2 MikeD(config)#^z MikeD(config)# Watch the output after you have configured your router.16.16.255. one per line. In this case.1 went from Idle to Active Oct 1 16:11:09.  The update-source loopback 0 command states that you will be peering using the loopback 0 interface.16. and therefore the neighbor could be up to 255 hops away.255 192. you see that the BGP state is Active and that no TCP session has been established. The terminal output when we configured BGP tells you that there is no route to the peer. End with CNTL/Z. End with CNTL/Z. your state will go to Enabled.16. but the router does not know how to get there.2 255.255. You have specified the neighbor IP address.1 255. How about a static route? MikeC#conf t Enter configuration commands.no route to peer.1 open active delayed 34535ms (35000ms max.168.16. one per line. IBGP does not need a multihop command to peer with non–directly connected peers.

13 BGP Connection Basics: External BGP © 2009 Cisco Systems. It does not stay in this state long. it goes to Active. which defines the states and actions. If you would like to know exactly what each BGP state is and does. Watson Research Center.J. 6) Established: BGP has connected with its neighbor. BGP Finite State machine. This section specifies BGP operation in terms of a Finite State Machine (FSM). but should be sufficiently large to allow TCP initialization. 2) Connect: The router has decided to connect to its peer. or to OpenSent if the TCP connection is made. A condensed version of the BGP FSM is found in Appendix 1.” from March 1995. Obsoletes: 1654 T.output omitted) 8. BGP is performing its handshaking. are given here.BGP States Here is a quick summary of the BGP states: 1) Idle: The BGP peers are not connected. 3) Active: If your BGP neighbor is in this state it means that there is a problem (see information above). the following information is copied from RFC 1771. In response to the Start event (initiated by either system or operator) the local system initializes all BGP resources. while listening for connection that may be initiated by the remote BGP peer. Section 8. and the router is not even thinking about trying to do so. Li Category: Standards Track cisco Systems Editors March 1995 A Border Gateway Protocol 4 (BGP-4) ~~~ (<-. Initially BGP is in the Idle state. Network Working Group Y. and Appendix 1. Following is a brief summary and overview of BGP operations by state as determined by this FSM. titled “A Border Gateway Protocol 4 (BGP-4). initiates a transport connection to other BGP peer. Inc. No resources are allocated to the peer. 4) OpenSent: The TCP session is active. . with transitions and actions. starts the ConnectRetry timer. Idle state: In this state BGP refuses all incoming BGP connections. 5) OpenConfirm: BGP is still performing its handshaking. You will rarely see this using a show command. IBM Corp. and changes its state to Connect. Rekhter Request for Comments: 1771 T. The exact value of the ConnectRetry timer is a local matter. or back to Idle.

and changes its state to OpenSent. A Hold Timer value of 4 minutes is suggested. If the transport protocol connection succeeds. The time shall be doubled for each consecutive retry. the local system clears the ConnectRetry timer. sets its Hold Timer to a large value. and stays in the Connect state. completes initialization. Any other event received in the Idle state is ignored. Active state: In this state BGP is trying to acquire a peer by initiating a transport protocol connection. the local system restarts the ConnectRetry timer. If the transport protocol connection succeeds. and changes its state to OpenSent. if such events are generated automatically. The value of the initial timer shall be 60 seconds. If such an event is generated automatically. shall exponentially increase. retransmission timeout). the local system clears the ConnectRetry timer. Inc. In response to the ConnectRetry timer expired event. the local system restarts the ConnectRetry timer. the local system restarts the ConnectRetry timer. completes initialization. the local system releases all BGP resources associated with this connection and changes its state to Idle. and changes its state to Connect. In response to the ConnectRetry timer expired event. 14 BGP Connection Basics: External BGP © 2009 Cisco Systems. Start event is ignored in the Active state. initiates a transport connection to other BGP peer. continues to listen for a connection that may be initiated by the remote BGP peer. Getting out of the Idle state requires generation of the Start event. and changes its state to Active state. If a BGP speaker detects an error. .. sends an OPEN message to its peer. then persistent BGP errors may result in persistent flapping of the speaker. To avoid such a condition it is recommended that Start events should not be generated immediately for a peer that was previously transitioned to Idle due to an error. it shuts down the connection and changes its state to Idle. the time between consecutive generation of Start events. In response to any other event (initiated by either system or operator). If the transport protocol connect fails (e. sends an OPEN message to its peer. Connect state: In this state BGP is waiting for the transport protocol connection to be completed.g. For a peer that was previously transitioned to Idle due to an error. initiates a transport connection to other BGP peer. continues to listen for a connection that may be initiated by the remote BGP peer. continues to listen for a connection that may be initiated by the remote BGP peer.

In response to any other event (initiated by either system or operator). Start event is ignored in the OpenSent state. the local system sends NOTIFICATION message with error code Hold Timer Expired and changes its state to Idle.) Finally.2). 15 BGP Connection Basics: External BGP © 2009 Cisco Systems. In response to the Stop event (initiated by either system or operator) the local system sends NOTIFICATION message with Error Code Cease and changes its state to Idle. If there are no errors in the OPEN message. If a disconnect notification is received from the underlying transport protocol. . which was originally set to a large value (see above). rejects the attempted connection. If the value of the Autonomous System field is the same as the local Autonomous System number. restarts the ConnectRetry timer. Inc. is replaced with the negotiated Hold Time value (see section 4. When an OPEN message is received. BGP sends a KEEPALIVE message and sets a KeepAlive timer. If the negotiated Hold Time value is zero. then the connection is an "internal" connection. the state is changed to OpenConfirm. The Hold Timer. while continue listening for connection that may be initiated by the remote BGP peer. and stays in the Active state. it is "external". and the IP address of the remote peer is not an expected one. Start event is ignored in the Active state. If the local system detects that a remote peer is trying to establish BGP connection to it. all fields are checked for correctness. (This will effect UPDATE processing as described below. the local system closes the BGP connection.2). OpenSent state: In this state BGP waits for an OPEN message from its peer. otherwise. the local system restarts the ConnectRetry timer. If the BGP message header checking or OPEN message checking detects an error (see Section 6. it closes the BGP (and transport-level) connection and releases all resources associated with that connection. continues to listen for a connection that may be initiated by the remote BGP peer. Whenever BGP changes its state from OpenSent to Idle. and goes into the Active state. In response to any other event the local system sends NOTIFICATION message with Error Code Finite State Machine Error and changes its state to Idle. or a connection collision (see Section 6.8) the local system sends a NOTIFICATION message and changes its state to Idle. the local system releases all BGP resources associated with this connection and changes its state to Idle. then the Hold Time timer and KeepAlive timers are not started. If the Hold Timer expires.

it changes its state to Idle. In response to any other event the local system sends NOTIFICATION message with Error Code Finite State Machine Error and changes its state to Idle. Whenever BGP changes its state from OpenConfirm to Idle. the local system sends NOTIFICATION message with error code Hold Timer Expired and changes its state to Idle. If the KeepAlive timer expires. If the local system receives a NOTIFICATION message. Start event is ignored in the OpenConfirm state. . If the local system receives a KEEPALIVE message. Inc. it closes the BGP (and transport-level) connection and releases all resources associated with that connection. it restarts its Hold Timer. the local system changes its state to Idle.3) detects an error. In response to the Stop event (initiated by either system or operator) the local system sends NOTIFICATION message with Error Code Cease and changes its state to Idle. and KEEPALIVE messages with its peer. the local system sends a KEEPALIVE message and restarts its KeepAlive timer. If the local system receives a NOTIFICATION message. If a disconnect notification is received from the underlying transport protocol. the local system sends a NOTIFICATION message and changes its state to Idle. If the Hold Timer expires before a KEEPALIVE message is received. it changes its state to Idle. it changes its state to Established. the local system sends a NOTIFICATION message with Error Code Hold Timer Expired and changes its state to Idle. NOTIFICATION. 16 BGP Connection Basics: External BGP © 2009 Cisco Systems. If a disconnect notification is received from the underlying transport protocol. the local system changes its state to Idle. if the negotiated Hold Time value is non-zero. If the Hold Timer expires. If the local system receives an UPDATE or KEEPALIVE message. If the local system receives an UPDATE message and the UPDATE message error handling procedure (see Section 6. Established state: In the Established state BGP can exchange UPDATE. OpenConfirm state: In this state BGP waits for a KEEPALIVE or NOTIFICATION message.

BGP Stop 3 . This Appendix discusses the transitions between states in the BGP FSM in response to BGP events. Active 4 . ConnectRetry timer expired 8 . BGP Transport fatal error 7 . Connect 3 . In response to the Stop event (initiated by either system or operator). Receive NOTIFICATION message 17 BGP Connection Basics: External BGP © 2009 Cisco Systems. Each time the local system sends a KEEPALIVE or UPDATE message. it closes the BGP (and transport-level) connection. and deletes all routes derived from that connection. Receive UPDATE messages 13 . .output omitted) Rekhter & Li [Page 47] RFC 1771 BGP-4 March 1995 Appendix 1. BGP Start 2 . OpenSent 5 . the local system sends a NOTIFICATION message with Error Code Cease and changes its state to Idle. BGP Transport connection closed 5 . BGP FSM State Transitions and Actions. unless the negotiated Hold Time value is zero. Idle 2 . releases all resources associated with that connection. If the KeepAlive timer expires. In response to any other event. Start event is ignored in the Established state. OpenConfirm 6 . BGP Transport connection open failed 6 . Hold Timer expired 9 . KeepAlive timer expired 10 . the local system sends NOTIFICATION message with Error Code Finite State Machine Error and changes its state to Idle. Receive OPEN message 11 . BGP States: 1 . the local system sends a KEEPALIVE message and restarts its KeepAlive timer. it restarts its KeepAlive timer. Established BGP Events: 1 . Inc. Receive KEEPALIVE message 12 . Whenever BGP changes its state from Established to Idle. The following is the list of these states and events when the negotiated Hold Time value is non-zero. ~~~ (<-. BGP Transport connection open 4 .

. The following table describes the state transitions of the BGP FSM and the actions triggered by these transitions. Event Actions Message Sent Next State -------------------------------------------------------------------- Idle (1) 1 Initialize resources none 2 Start ConnectRetry timer Initiate a transport connection others none none 1 Connect(2) 1 none none 2 3 Complete initialization OPEN 4 Clear ConnectRetry timer 5 Restart ConnectRetry timer none 3 7 Restart ConnectRetry timer none 2 Initiate a transport connection others Release resources none 1 Active (3) 1 none none 3 3 Complete initialization OPEN 4 Clear ConnectRetry timer 5 Close connection 3 Restart ConnectRetry timer 7 Restart ConnectRetry timer none 2 Initiate a transport connection others Release resources none 1 OpenSent(4) 1 none none 4 4 Close transport connection none 3 Restart ConnectRetry timer 6 Release resources none 1 10 Process OPEN is OK KEEPALIVE 5 Process OPEN failed NOTIFICATION 1 others Close transport connection NOTIFICATION 1 Release resources OpenConfirm (5) 1 none none 5 4 Release resources none 1 6 Release resources none 1 9 Restart KeepAlive timer KEEPALIVE 5 11 Complete initialization none 6 Restart Hold Timer 13 Close transport connection 1 Release resources others Close transport connection NOTIFICATION 1 Release resources 18 BGP Connection Basics: External BGP © 2009 Cisco Systems. Inc.

. Inc. Established (6) 1 none none 6 4 Release resources none 1 6 Release resources none 1 9 Restart KeepAlive timer KEEPALIVE 6 11 Restart Hold Timer KEEPALIVE 6 12 Process UPDATE is OK UPDATE 6 Process UPDATE failed NOTIFICATION 1 13 Close transport connection 1 Release resources others Close transport connection NOTIFICATION 1 Release resources --------------------------------------------------------------------- The following is a condensed version of the above state transition table. Events| Idle | Connect | Active | OpenSent | OpenConfirm | Estab | (1) | (2) | (3) | (4) | (5) | (6) |-------------------------------------------------------------- 1 | 2 | 2 | 3 | 4 | 5 | 6 | | | | | | 2 | 1 | 1 | 1 | 1 | 1 | 1 | | | | | | 3 | 1 | 4 | 4 | 1 | 1 | 1 | | | | | | 4 | 1 | 1 | 1 | 3 | 1 | 1 | | | | | | 5 | 1 | 3 | 3 | 1 | 1 | 1 | | | | | | 6 | 1 | 1 | 1 | 1 | 1 | 1 | | | | | | 7 | 1 | 2 | 2 | 1 | 1 | 1 | | | | | | 8 | 1 | 1 | 1 | 1 | 1 | 1 | | | | | | 9 | 1 | 1 | 1 | 1 | 5 | 6 | | | | | | 10 | 1 | 1 | 1 | 1 or 5 | 1 | 1 | | | | | | 11 | 1 | 1 | 1 | 1 | 6 | 6 | | | | | | 12 | 1 | 1 | 1 | 1 | 1 | 1 or 6 | | | | | | 13 | 1 | 1 | 1 | 1 | 1 | 1 | | | | | | --------------------------------------------------------------- 19 BGP Connection Basics: External BGP © 2009 Cisco Systems.