Basic BGP Configuration and Verification

The following components are necessary for BGP configuration:

  • BGP Session Parameters – settings for establishing remote BGP neighbor communication, which includes the BGP peer ASN, authentication, and keepalive timers.
  • Address Family Initialization – done under BGP router configuration mode. Network advertisement and summarization take place within the address family.
  • Address Family Activation on the BGP Peer – an address family for a neighbor should be activated for a session to initiate. After adding the router’s IP address to the neighbor table, BGP attempts to either create or accept BGP sessions initiated by BGP peers.


BGP Configuration Example

The network topology below will be used for configuring BGP. There are two BGP routers, Router1 and Router2, with as loopback addresses for Router1 and for Router2.

BGP Configuration

First, configure the physical and the loopback interfaces on both routers.

Router1(config)#interface Loopback 0
Router1(config-if)#ip address
Router1(config)#interface GigabitEthernet0/0
Router1(config-if)#ip address


Router2(config)#interface Loopback 0
Router2(config-if)#ip address
Router2(config)#interface GigabitEthernet0/0
Router2(config-if)#ip address


To configure BGP, initialize the BGP routing process using the command ‘router bgp <as-number>’. Optionally, a BGP router ID (RID) can be manually configured using the ‘bgp router-id <router-id>’ command. If not, the RID dynamically uses the highest loopback address. If there’s no active loopback interface, then the highest IP address will be used as the RID.

Next, specify the IP address and the AS number of the BGP neighbor using the ‘neighbor <ip-address> remote-as <as-number>’ command under the BGP router configuration mode. MD5 authentication can also be enabled using the ‘neighbor <ip-address> password <apassword>’ command.

Router1(config)#router bgp 1
Router1(config-router)#neighbor remote-as 2
Router1(config-router)#neighbor password STUDY-CCNP


Router2(config)#router bgp 2
Router2(config-router)#neighbor remote-as 1
Router2(config-router)#neighbor password STUDY-CCNP


BGP Verification

To verify the BGP configuration, the following commands can be used:

Router1#show bgp ipv4 unicast summary
BGP router identifier, local AS number 1
BGP table version is 2, main routing table version 2
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 4 2 0 0 0 0 0 never Active


Router1#show ip bgp summary
BGP router identifier, local AS number 1
BGP table version is 2, main routing table version 2
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 4 2 0 0 0 0 0 never Active


You can see on the results above that the RID used is the loopback address since the RID is not manually specified. The BGP table summary fields stand for:

  • Neighbor: BGP peer IP address
  • V: BGP peer BGP version
  • AS: BGP peer AS number
  • MsgRcvd: Number of messages received from the BGP peer
  • MsgSent: Number of messages sent to the BGP peer
  • TblVer: BGP database latest version sent to the BGP peer
  • InQ: Number of messages queued to be processed by the BGP peer
  • OutQ: Number of messages queued to be sent to the BGP peer
  • Up/Down: Length of BGP session time or the current status if not established
  • State/PfxRcd: BGP peer current state or the number of prefixes from the BGP peer


For detailed information showing the BGP neighbor session state, timers, etc., the IP address of the neighbor can be specified:

Router1#show bgp ipv4 unicast neighbors
BGP neighbor is, remote AS 2, external link
BGP version 4, remote router ID
BGP state = Active
Last read 00:08:00, last write 00:08:00, hold time is 180, 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
For address family: IPv4 Unicast
BGP table version 2, neighbor version 0/0
Output queue size : 0
Index 1, Offset 0, Mask 0x2
1 update-group member

Sent Rcvd
Prefix activity: ---- ----
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: -------- -------
Total: 0 0
Number of NLRIs in the update sent: max 0, min 0
Connections established 0; dropped 0
Last reset never
No active TCP connection

Download our Free CCNA Study Guide PDF for complete notes on all the CCNA 200-301 exam topics in one book.

We recommend the Cisco CCNA Gold Bootcamp as your main CCNA training course. It’s the highest rated Cisco course online with an average rating of 4.8 from over 30,000 public reviews and is the gold standard in CCNA training: