BGP

LAB TOPOLOGY:

INITIAL CONFIGS:

R1:

interface Serial1/0
 ip address 1.1.1.1 255.255.255.252
 serial restart-delay 0
 clock rate 64000
 !
!
interface Serial1/1
 ip address 14.1.1.1 255.255.255.252
 serial restart-delay 0
 !
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
 !
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
 !
!
!
router bgp 1
 bgp log-neighbor-changes
 neighbor 1.1.1.2 remote-as 2
 neighbor 14.1.1.2 remote-as 1
 !
 address-family ipv4
  no synchronization
  network 1.1.1.0 mask 255.255.255.252
  network 14.1.1.0 mask 255.255.255.252
  neighbor 1.1.1.2 activate
  neighbor 14.1.1.2 activate
  neighbor 14.1.1.2 next-hop-self
  no auto-summary
 exit-address-family

R2:
interface Serial1/0
 ip address 1.1.1.2 255.255.255.252
 serial restart-delay 0
 !
!
interface Serial1/1
 ip address 2.2.2.2 255.255.255.252
 serial restart-delay 0
 clock rate 64000
 !
!
interface Serial1/2
 ip address 42.1.1.2 255.255.255.252
 serial restart-delay 0
 !
!
interface Serial1/3
 ip address 26.1.1.2 255.255.255.252
 serial restart-delay 0
 clock rate 64000
 !
!
!
router bgp 2
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 1
 neighbor 2.2.2.1 remote-as 3
 neighbor 26.1.1.1 remote-as 6
 neighbor 42.1.1.1 remote-as 1
 !
 address-family ipv4
  no synchronization
  network 1.1.1.0 mask 255.255.255.252
  network 2.2.2.0 mask 255.255.255.252
  network 26.1.1.0 mask 255.255.255.252
  network 42.1.1.0 mask 255.255.255.252
  neighbor 1.1.1.1 activate
  neighbor 2.2.2.1 activate
  neighbor 26.1.1.1 activate
  neighbor 42.1.1.1 activate
  no auto-summary
 exit-address-family

R3:
interface Loopback0
 ip address 192.168.0.1 255.255.255.0
 !
!
interface Loopback1
 ip address 192.168.1.1 255.255.255.0
 !
!
interface Loopback2
 ip address 192.168.2.1 255.255.255.0
 !
!
interface Loopback3
 ip address 192.168.3.1 255.255.255.0
 !
!
interface Loopback4
 ip address 192.168.4.1 255.255.255.0
 !
!
interface Loopback5
 ip address 192.168.5.1 255.255.255.0
 !
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
 !
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
 !
!
interface Serial1/0
 ip address 2.2.2.1 255.255.255.252
 no fair-queue
 serial restart-delay 0
 clock rate 64000
 !
!
interface Serial1/1
 ip address 36.1.1.1 255.255.255.252
 serial restart-delay 0
 clock rate 64000
 !
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
 !
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
 !
!
!
router bgp 3
 bgp log-neighbor-changes
 neighbor 2.2.2.2 remote-as 2
 neighbor 36.1.1.2 remote-as 6
 !
 address-family ipv4
  no synchronization
  network 2.2.2.0 mask 255.255.255.252
  network 36.1.1.0 mask 255.255.255.252
  network 192.168.0.0
  network 192.168.1.0
  network 192.168.2.0
  network 192.168.3.0
  network 192.168.4.0
  neighbor 2.2.2.2 activate
  neighbor 36.1.1.2 activate
  no auto-summary
 exit-address-family

R4:

interface Serial1/0
 description LINK-TO-R1
 ip address 14.1.1.2 255.255.255.252
 serial restart-delay 0
 !
!
interface Serial1/1
 ip address 45.1.1.1 255.255.255.252
 serial restart-delay 0
 clock rate 64000
 !
!
interface Serial1/2
 description LINK-TO-R2
 ip address 42.1.1.1 255.255.255.252
 serial restart-delay 0
 clock rate 64000
 !
router bgp 1
 bgp log-neighbor-changes
 neighbor 14.1.1.1 remote-as 1
 neighbor 42.1.1.2 remote-as 2
 neighbor 45.1.1.2 remote-as 5
 !
 address-family ipv4
  no synchronization
  network 14.1.1.0 mask 255.255.255.252
  network 42.1.1.0 mask 255.255.255.252
  network 45.1.1.0 mask 255.255.255.252
  neighbor 14.1.1.1 activate
  neighbor 14.1.1.1 next-hop-self
  neighbor 42.1.1.2 activate
  neighbor 45.1.1.2 activate
  no auto-summary
 exit-address-family
!

R5:

interface Serial1/0
 ip address slarp retry 3
 serial restart-delay 0
 !
!
interface Serial1/1
 ip address slarp retry 2
 serial restart-delay 0
 !


!
router bgp 5
 bgp log-neighbor-changes
 neighbor 45.1.1.1 remote-as 1
 neighbor 65.1.1.1 remote-as 6
 !
 address-family ipv4
  no synchronization
  network 45.1.1.0 mask 255.255.255.252
  network 65.1.1.0 mask 255.255.255.252
  neighbor 45.1.1.1 activate
  neighbor 65.1.1.1 activate
  no auto-summary
 exit-address-family

R6:

!
interface Serial1/0
 ip address 65.1.1.1 255.255.255.252
 no fair-queue
 serial restart-delay 0
 !
!
interface Serial1/1
 ip address slarp retry 3
 serial restart-delay 0
 !
!
interface Serial1/2
 ip address 26.1.1.1 255.255.255.252
 serial restart-delay 0
!
router bgp 6
 bgp log-neighbor-changes
 neighbor 26.1.1.2 remote-as 2
 neighbor 36.1.1.1 remote-as 3
 neighbor 65.1.1.2 remote-as 5
 !
 address-family ipv4
  no synchronization
  network 26.1.1.0 mask 255.255.255.252
  network 36.1.1.0 mask 255.255.255.252
  network 65.1.1.0 mask 255.255.255.252
  neighbor 26.1.1.2 activate
  neighbor 36.1.1.1 activate
  neighbor 65.1.1.2 activate
  no auto-summary
 exit-address-family

Debug to look at BGP Finite State Machine:

int s1/2
R4(config-if)#shutdown
R4(config-if)#
*Apr  2 13:32:33.371: BGP: 42.1.1.2 resetting - interface Serial1/2 down
*Apr  2 13:32:33.371: BGP: ses global 42.1.1.2 (0x673E9818:1) Reset (Interface flap).
*Apr  2 13:32:33.399: BGP: nbr_topo global 42.1.1.2 IPv4 Unicast:base (0x673E9818:1) NSF delete stale NSF not active
*Apr  2 13:32:33.403: BGP: nbr_topo global 42.1.1.2 IPv4 Unicast:base (0x673E9818:1) NSF no stale paths state is NSF not active
*Apr  2 13:32:33.403: BGP: nbr_topo global 42.1.1.2 IPv4 Unicast:base (0x673E9818:1) Resetting ALL counters.
*Apr  2 13:32:33.407: BGP: 42.1.1.2 closing
*Apr  2 13:32:33.411: BGP: nbr_topo global 42.1.1.2 IPv4 Unicast:base (0x673E9818:1) Resetting ALL counters.
*Apr  2 13:32:33.415: BGP: 42.1.1.2 went from Established to Idle
*Apr  2 13:32:33.415: %BGP-5-ADJCHANGE: neighbor 42.1.1.2 Down Interface flap
*Apr  2 13:32:33.419: %BGP_SESSION-5-ADJCHANGE: neighbor 42.1.1.2 IPv4 Unicast topology base removed from session  Interface flap
R4(config-if)#d
*Apr  2 13:32:33.423: BGP: ses global 42.1.1.2 (0x673E9818:1) Removed topology IPv4 Unicast:base
*Apr  2 13:32:33.423: BGP: ses global 42.1.1.2 (0x673E9818:1) Removed last topology
*Apr  2 13:32:33.427: BGP: nbr global 42.1.1.2 Open active delayed 8192ms (35000ms max, 60% jitter)
*Apr  2 13:32:33.431: BGP: nbr global 42.1.1.2 Active open failed - open timer running
*Apr  2 13:36:04.047: BGP: 42.1.1.2 Active open failed - update-source NULL is not available, open active delayed 13312ms (35000ms max, 60% jitter)
R4#


***************************************************
enabling the inteface logs              *
***************************************************

R4(config-if)#
*Apr  2 13:37:42.251: %LINK-3-UPDOWN: Interface Serial1/2, changed state to up
*Apr  2 13:37:43.267: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/2, changed state to up
R4(config-if)#end
*Apr  2 13:37:43.279: BGP: 42.1.1.2 restarting - interface Serial1/2 up
*Apr  2 13:37:43.283: BGP: nbr global 42.1.1.2 Active open failed - open timer running
*Apr  2 13:37:43.315: BGP: nbr global 42.1.1.2 Active open failed - open timer running
*Apr  2 13:37:43.327: BGP: Applying map to find origin for 42.1.1.0/30
*Apr  2 13:37:43.343: BGP: Applying map to find origin for 42.1.1.0/30
*Apr  2 13:37:43.347: BGP: Applying map to find origin for 42.1.1.0/30
R4(config-if)#end
R4#u all
*Apr  2 13:37:44.563: %SYS-5-CONFIG_I: Configured from console by console
R4#u all
*Apr  2 13:37:49.563: BGP: 42.1.1.2 active went from Idle to Active
*Apr  2 13:37:49.567: BGP: 42.1.1.2 open active, local address 42.1.1.1
*Apr  2 13:37:49.807: BGP: 42.1.1.2 open failed: Connection refused by remote host
*Apr  2 13:37:49.811: BGP: 42.1.1.2 Active open failed - tcb is not available, open active delayed 8192ms (35000ms max, 60% jitter)
*Apr  2 13:37:49.811: BGP: ses global 42.1.1.2 (0x687F7E58:0) act Reset (Active open failed).
*Apr  2 13:37:49.823: BGP: 42.1.1.2 active went from Active to Idle
*Apr  2 13:37:49.827: BGP: nbr global 42.1.1.2 Active open failed - open timer running
R4#u all
*Apr  2 13:37:49.831: BGP: nbr global 42.1.1.2 Active open failed - open timer running
R4#u all
*Apr  2 13:37:57.739: BGP: 42.1.1.2 active went from Idle to Active
*Apr  2 13:37:57.739: BGP: 42.1.1.2 open active, local address 42.1.1.1
*Apr  2 13:37:57.839: BGP: ses global 42.1.1.2 (0x687F7E58:0) act Adding topology IPv4 Unicast:base
*Apr  2 13:37:57.843: BGP: ses global 42.1.1.2 (0x687F7E58:0) act Send OPEN
*Apr  2 13:37:57.847: BGP: 42.1.1.2 active went from Active to OpenSent
*Apr  2 13:37:57.851: BGP: 42.1.1.2 active sending OPEN, version 4, my as: 1, holdtime 180 seconds, ID 2D010101
*Apr  2 13:37:58.071: BGP: 42.1.1.2 active rcv message type 1, length (excl. header) 39
*Apr  2 13:37:58.075: BGP: ses global 42.1.1.2 (0x687F7E58:0) act Receive OPEN
*Apr  2 13:37:58.075: BGP: 42.1.1.2 active rcv OPEN, version 4, holdtime 180 seconds
*Apr  2 13:37:58.079: BGP: 42.1.1.2 active rcv OPEN w/ OPTION parameter len: 29
*Apr  2 13:37:58.083: BGP: 42.1.1.2 active rcvd OPEN w/ optional parameter type 2 (Capability) len 6
*Apr  2 13:37:58.083: BGP: 42.1.1.2 active OPEN has C
R4#u all APABILITY code: 1, length 4
*Apr  2 13:37:58.087: BGP: 42.1.1.2 active OPEN has MP_EXT CAP for afi/safi: 1/1
*Apr  2 13:37:58.087: BGP: 42.1.1.2 active rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Apr  2 13:37:58.087: BGP: 42.1.1.2 active OPEN has CAPABILITY code: 128, length 0
*Apr  2 13:37:58.087: BGP: 42.1.1.2 active OPEN has ROUTE-REFRESH capability(old) for all address-families
*Apr  2 13:37:58.087: BGP: 42.1.1.2 active rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Apr  2 13:37:58.087: BGP: 42.1.1.2 active OPEN has CAPABILITY code: 2, length 0
*Apr  2 13:37:58.087: BGP: 42.1.1.2 active OPEN has ROUTE-REFRESH capability(new) for all address-families
*Apr  2 13:37:58.087: BGP: 42.1.1.2 active rcvd OPEN w/ optional parameter type 2 (Capability) len 3
*Apr  2 13:37:58.087: BGP: 42.1.1.2 active OPEN has CAPABILITY code: 131, length 1
*Apr  2 13:37:58.087: BGP: 42.1.1.2 active OPEN has MULTISESSION capability, without grouping
*Apr  2 13:37:58.087:
R4#u all  BGP: 42.1.1.2 active rcvd OPEN w/ optional parameter type 2 (Capability) len 6
*Apr  2 13:37:58.087: BGP: 42.1.1.2 active OPEN has CAPABILITY code: 65, length 4
*Apr  2 13:37:58.087: BGP: 42.1.1.2 active OPEN has 4-byte ASN CAP for: 2
*Apr  2 13:37:58.087: BGP: nbr global 42.1.1.2 neighbor does not have IPv4 MDT topology activated
*Apr  2 13:37:58.087: BGP: 42.1.1.2 active rcvd OPEN w/ remote AS 2, 4-byte remote AS 2
*Apr  2 13:37:58.087: BGP: 42.1.1.2 active went from OpenSent to OpenConfirm
*Apr  2 13:37:58.091: BGP: 42.1.1.2 active went from OpenConfirm to Established
*Apr  2 13:37:58.091: BGP: ses global 42.1.1.2 (0x687F7E58:1) act Assigned ID
*Apr  2 13:37:58.095: BGP: ses global 42.1.1.2 (0x687F7E58:1) Up
*Apr  2 13:37:58.099: %BGP-5-ADJCHANGE: neighbor 42.1.1.2 Up
*Apr  2 13:37:58.111: BGP: ses global 42.1.1.2 (0x687F7E58:1) read request no-op
R4#u all
*Apr  2 13:38:07.751: BGP: topo global:IPv4 Unicast:base Scanning routing tables
*Apr  2 13:38:07.751: BGP: topo global:IPv4 Multicast:base Scanning routing tables
R4#u all
All possible debugging has been turned off
R4#