CCIE RS Workbook | CCIE Security Workbook | CCIE SP Workbook | CCIE Voice Workbook
16-17 debug ip bgp updates access-list-number out
< Free Open Study >
Syntax Description:
Purpose: To debug BGP updates. The IP access list number can be in the range 1 to 199 or 1300 to 2699.
Cisco IOS Software Release: 10.0
Example 1: Debug All BGP Updates
In Figure 16-4 , Router A is advertising four prefixes to Router B, and Router B is advertising four prefixes to Router A. Debug all the updates on Router B.
Figure 16-4. Debug All Updates from a Neighbor
Router A
interface loopback 1
ip address 199.172.1.1 255.255.255.0
!
interface loopback 2
ip address 199.172.2.1 255.255.255.0
!
interface loopback 3
ip address 199.172.3.1 255.255.255.0
!
interface loopback 4
ip address 199.172.4.1 255.255.255.0
!
router bgp 1
network 199.172.1.0
network 199.172.2.0
network 199.172.3.0
network 199.172.4.0
neighbor 172.17.1.1 remote-as 2
___________________________________________________________________________
Router B
interface loopback 1
ip address 200.1.1.1 255.255.255.0
!
interface loopback 2
ip address 200.1.2.1 255.255.255.0
!
interface loopback 3
ip address 200.1.3.1 255.255.255.0
!
interface loopback 4
ip address 200.1.4.1 255.255.255.0
!
router bgp 2
network 200.1.1.0
network 200.1.2.0
network 200.1.3.0
network 200.1.4.0
neighbor 172.17.1.2 remote-as 1
rtrB#debug ip bgp updates
BGP updates debugging is on
rtrB#clear ip bgp *
2d03h: BGP(0): 172.17.1.2 send UPDATE (format) 200.1.1.0/24, next 172.17.1.1,
metric 0, path
2d03h: BGP(0): 172.17.1.2 send UPDATE (prepend, chgflags: 0x208) 200.1.2.0/24,
next 172.17.1.1, metric 0, path
2d03h: BGP(0): 172.17.1.2 send UPDATE (prepend, chgflags: 0x208) 200.1.3.0/24,
next 172.17.1.1, metric 0, path
2d03h: BGP(0): 172.17.1.2 send UPDATE (prepend, chgflags: 0x208) 200.1.4.0/24,
next 172.17.1.1, metric 0, path
2d03h: BGP(0): 172.17.1.2 1 updates enqueued (average=64, maximum=64)
2d03h: BGP(0): 172.17.1.2 update run completed, afi 0, ran for 0ms, neighbor
version 0, start version 5, throttled to 5
2d03h: BGP(0): 172.17.1.2 rcvd UPDATE w/ attr: nexthop 172.17.1.2, origin i,
metric 0, path 1
2d03h: BGP(0): 172.17.1.2 rcvd 199.172.1.0/24
2d03h: BGP(0): 172.17.1.2 rcvd 199.172.2.0/24
2d03h: BGP(0): 172.17.1.2 rcvd 199.172.3.0/24
2d03h: BGP(0): 172.17.1.2 rcvd 199.172.4.0/24
Example 2: Debug Input Updates
Debug BGP updates on Router B for routes received from Router A.
rtrB#debug ip bgp updates in
BGP updates debugging is on (inbound)
rtrb#clear ip bgp *
2d03h: BGP(0): 172.17.1.2 rcvd UPDATE w/ attr: nexthop 172.17.1.2, origin i,
metric 0, path 1
2d03h: BGP(0): 172.17.1.2 rcvd 199.172.1.0/24
2d03h: BGP(0): 172.17.1.2 rcvd 199.172.2.0/24
2d03h: BGP(0): 172.17.1.2 rcvd 199.172.3.0/24
2d03h: BGP(0): 172.17.1.2 rcvd 199.172.4.0/24
Example 3: Debug Output Updates for Specific Prefixes Sent to All BGP Neighbors
Debug BGP updates on Router B for local prefixes 200.1.2.0 and 200.1.3.2:
Router B
access-list 1 permit 200.1.2.0 0.0.1.255
rtrB#debug ip bgp updates 1 out
BGP updates debugging is on for access list 1 (outbound)
rtrB#clear ip bgp *
2d03h: BGP(0): nettable_walker 200.1.2.0/24 route sourced locally
2d03h: BGP(0): nettable_walker 200.1.3.0/24 route sourced locally
2d03h: BGP(0): 172.17.1.2 send UPDATE (prepend, chgflags: 0x208) 200.1.2.0/24,
next 172.17.1.1, metric 0, path
2d03h: BGP(0): 172.17.1.2 send UPDATE (prepend, chgflags: 0x208) 200.1.3.0/24,
next 172.17.1.1, metric 0, path
Example 4: Debug Input Updates for Specific Prefixes Received from a Specific BGP Neighbor
Debug updates for prefixes 199.172.2.0 and 199.172.3.0 received from Router A:
Router B
access-list 2 permit 199.172.2.0 0.0.1.255
rtrB#debug ip bgp in 172.17.1.2 updates 2
BGP updates debugging is on for access list 2 for neighbor 172.17.1.2 (inbound)
rtrB#clear ip bgp *
p2#
2d03h: BGP(0): 172.17.1.2 rcvd UPDATE w/ attr: nexthop 172.17.1.2, origin i,
metric 0, path 1
2d03h: BGP(0): 172.17.1.2 rcvd 199.172.2.0/24
2d03h: BGP(0): 172.17.1.2 rcvd 199.172.3.0/24
< Free Open Study >
16-7 debug ip bgp keepalives
< Free Open Study >
Syntax Description: This command has no arguments.
Purpose: To debug keepalive messages sent between BGP neighbors. To configure the keepalive internal, see sections 8-31 and 13-1 .
Cisco IOS Software Release: 10.0
Example: Debug BGP Keepalive Messages
Enable BGP keepalive message debugging between any two BGP neighbors:
rtrB#debug ip bgp keepalives
BGP keepalives debugging is on
rtrB#
1d06h: BGP: 172.17.1.2 sending KEEPALIVE
1d06h: BGP: 172.17.1.2 KEEPALIVE rcvd
< Free Open Study >
16-6 debug ip bgp events
< Free Open Study >
Syntax Description: This command has no arguments.
Purpose: To debug events relating to the BGP neighbor relationship.
Cisco IOS Software Release: 10.0
Example: Debug the Formation of the Neighbor Relationship
Enable BGP event debugging, and then clear the connection between the BGP neighbors:
rtrA#debug ip bgp events
BGP events debugging is on
rtrA#clear ip bgp *
rtrA#
1w3d: BGP: reset all neighbors due to User reset
1w3d: BGP: 172.17.1.1 went from Active to Idle
1w3d: BGP: 172.17.1.1 went from Idle to Active
1w3d: BGP: scanning routing tables
1w3d: BGP: 172.17.1.1 went from Active to Idle
1w3d: BGP: 172.17.1.1 went from Idle to Connect
1w3d: BGP: 172.17.1.1 went from Connect to OpenSent
1w3d: BGP: 172.17.1.1 went from OpenSent to OpenConfirm
1w3d: BGP: 172.17.1.1 went from OpenConfirm to Established
1w3d: BGP: 172.17.1.1 computing updates, neighbor version 0, table version 5,
starting at 0.0.0.0
1w3d: BGP: 172.17.1.1 update run completed, ran for 0ms, neighbor version 0,
start version 5, throttled to 5, check point net 0.0.0.0
< Free Open Study >
16-5 debug ip bgp dampening access-list-number
< Free Open Study >
Syntax Description:
Purpose: To debug BGP events associated with dampening. The first form debugs all dampening events. The second form debugs only dampening events associated with routes identified by the IP access list. The IP access list number can be in the range from 1 to 199 or 1300 to 2699. Although it isn’t necessary, use logging to store the results so that you can review them later.
Cisco IOS Software Release: 10.0
Example: Debug All BGP Dampening Events
In Figure 16-3 , Router A is advertising network 199.172.2.0/24 via BGP to Router B. Dampening is enabled on Router B, and the 199.172.2.0/24 network on Router A is flapped by alternately bringing the interface up and down.
Figure 16-3. Scenario for Debugging BGP Dampening
Router A
interface loopback 1
ip address 199.172.2.0 255.255.255.0
router bgp 1
neighbor 172.17.1.1 remote-as 2
___________________________________________________________________________
Router B
router bgp 2
bgp dampening
neighbor 172.17.1.2 remote-as 1
After Routers A and B have established a neighbor relationship, enable BGP dampening debugging on Router B, and flap the loopback interface on Router A:
Router B
logging buffered
rtrB#debug ip bgp dampening
rtrB#show logging
Syslog logging: enabled (0 messages dropped, 0 flushes, 0 overruns)
Console logging: level debugging, 297 messages logged
Monitor logging: level debugging, 0 messages logged
Buffer logging: level debugging, 63 messages logged
Trap logging: level informational, 52 message lines logged
Log Buffer (4096 bytes):
03:26:07: BGP(0): Created dampening structures with halflife time 15,
reuse/suppress 750/2000
03:26:43: BGP(0): charge penalty for 199.172.2.0/24 path 1 with halflife-time 15
reuse/suppress 750/2000
03:26:43: BGP(0): flapped 1 times since 00:00:00. New penalty is 1000
03:27:39: BGP(0): charge penalty for 199.172.2.0/24 path 1 with halflife-time 15
reuse/suppress 750/2000
03:27:39: BGP(0): flapped 2 times since 00:00:56. New penalty is 1961
03:28:32: BGP(0): charge penalty for 199.172.2.0/24 path 1 with halflife-time 15
reuse/suppress 750/2000
03:28:32: BGP(0): flapped 3 times since 00:01:49. New penalty is 2886
03:29:05: BGP(0): suppress 199.172.2.0/24 path 1 for 00:28:40 (penalty 2819)
03:29:05: halflife-time 15, reuse/suppress 750/2000
03:57:52: BGP(0): Unsuppressed 199.172.2.0/24, path 1
If you want debugging information for a particular prefix, use the second form of this command. For example, to debug dampening for prefix 199.172.2.0/24, use the following configuration:
Router B
access-list 1 permit 199.172.2.0 0.0.0.255
rtrB#debug ip bgp dampening 1
< Free Open Study >
16-3 debug ip bgp neighbor-ip-address updates access-list-number
< Free Open Study >
Syntax Description:
Purpose: To debug BGP updates from a particular neighbor. The first form debugs all updates from the neighbor. The second form can be used to debug specific updates from the neighbor. The IP access list number can be in the range 1 to 199 or 1300 to 2699.
Cisco IOS Software Release: 10.0
Example 1: Debug All Updates to and from a Particular Neighbor
In Figure 16-2 , Router A is advertising four prefixes to Router B, and Router B is advertising four prefixes to Router A. Debug all the updates received from and sent to Router A.
Figure 16-2. Debug All Updates from a Neighbor
Router A
interface loopback 1
ip address 199.172.1.1 255.255.255.0
!
interface loopback 2
ip address 199.172.2.1 255.255.255.0
!
interface loopback 3
ip address 199.172.3.1 255.255.255.0
!
interface loopback 4
ip address 199.172.4.1 255.255.255.0
!
router bgp 1
network 199.172.1.0
network 199.172.2.0
network 199.172.3.0
network 199.172.4.0
neighbor 172.17.1.1 remote-as 2
___________________________________________________________________________
Router B
interface loopback 1
ip address 200.1.1.1 255.255.255.0
!
interface loopback 2
ip address 200.1.2.1 255.255.255.0
!
interface loopback 3
ip address 200.1.3.1 255.255.255.0
!
interface loopback 4
ip address 200.1.4.1 255.255.255.0
!
router bgp 2
network 200.1.1.0
network 200.1.2.0
network 200.1.3.0
network 200.1.4.0
neighbor 172.17.1.2 remote-as 1
Verify that Routers A and B have formed a BGP neighbor relationship, and then debug BGP updates on Router B:
rtrB#debug ip bgp 172.17.1.2 updates
BGP updates debugging is on for neighbor 172.17.1.2
clear ip bgp 172.17.1.2
rtrB#
01:58:38: BGP(0): 172.17.1.2 computing updates, afi 0, neighbor version 0, table
version 1, starting at 0.0.0.0
01:58:38: BGP(0): 172.17.1.2 update run completed, afi 0, ran for 0ms, neighbor
version 0, start version 1, throttled to 1
01:58:39: BGP(0): 172.17.1.2 rcvd UPDATE w/ attr: nexthop 172.17.1.2, origin i,
metric 0, path 1
01:58:39: BGP(0): 172.17.1.2 rcvd 199.172.1.0/24
01:58:39: BGP(0): 172.17.1.2 rcvd 199.172.2.0/24
01:58:39: BGP(0): 172.17.1.2 rcvd 199.172.3.0/24
01:58:39: BGP(0): 172.17.1.2 rcvd 199.172.4.0/24
01:59:09: BGP(0): 172.17.1.2 computing updates, afi 0, neighbor version 1, table
version 9, starting at 0.0.0.0
01:59:09: BGP(0): 172.17.1.2 send UPDATE (format) 200.1.1.0/24, next 172.17.1.1,
metric 0, path
01:59:09: BGP(0): 172.17.1.2 send UPDATE (prepend, chgflags: 0x208) 200.1.2.0/24,
next 172.17.1.1, metric 0, path
01:59:09: BGP(0): 172.17.1.2 send UPDATE (prepend, chgflags: 0x208) 200.1.3.0/24,
next 172.17.1.1, metric 0, path
01:59:09: BGP(0): 172.17.1.2 send UPDATE (prepend, chgflags: 0x208) 200.1.4.0/24,
next 172.17.1.1, metric 0, path
01:59:09: BGP(0): 172.17.1.2 1 updates enqueued (average=64, maximum=64)
01:59:09: BGP(0): 172.17.1.2 update run completed, afi 0, ran for 0ms, neighbor
version 1, start version 9, throttled to 9
Example 2: Debug Specific Updates to and/or from a Particular Neighbor
For this example, debug only updates from Router A regarding network 199.172.3.0. Also debug the prefix 200.1.2.0 from Router B to Router A:
Router B
access-list 1300 permit 199.172.3.0 0.0.0.255
access-list 1300 permit 200.1.2.0 0.0.0.255
rtrB#debug ip bgp 172.17.1.2 updates 1300
BGP updates debugging is on for access list 1300 for neighbor 172.17.1.2
rtrB#clear ip bgp *
02:08:59: BGP(0): 172.17.1.2 rcvd UPDATE w/ attr: nexthop 172.17.1.2, origin i,
metric 0, path 1
02:08:59: BGP(0): 172.17.1.2 rcvd 199.172.2.0/24
02:09:25: BGP(0): 172.17.1.2 send UPDATE (prepend, chgflags: 0x208) 200.1.2.0/24,
next 172.17.1.1, metric 0, path
< Free Open Study >
16-1 debug ip bgp
< Free Open Study >
Syntax Description: This command has no arguments.
Purpose: Use to debug the formation of the BGP neighbor relationship.
Cisco IOS Software Release: 10.0
Configuration Example
In Figure 16-1 , Router B has been configured with the wrong AS number for Router A.
Figure 16-1. Use debug ip bgp to Determine Configuration Errors
Router A
router bgp 1
neighbor 172.17.1.1 remote-as 2
___________________________________________________________________________
Router B
router bgp 2
neighbor 172.17.1.2 remote-as 1
Use debug ip bgp to identify the problem with the formation of the neighbor relationship between Routers A and B:
rtrB#debug ip bgp
rtrB#clear ip bgp *
1d03h: BGP: 172.17.1.2 went from Idle to Active
1d03h: BGP: 172.17.1.2 open active, delay 5492ms
1d03h: BGP: 172.17.1.2 open active, local address 172.17.1.1
1d03h: BGP: 172.17.1.2 went from Active to OpenSent
1d03h: BGP: 172.17.1.2 sending OPEN, version 4, my as: 2
1d03h: BGP: 172.17.1.2 send message type 1, length (incl. header) 41
1d03h: BGP: 172.17.1.2 rcv message type 1, length (excl. header) 10
1d03h: BGP: 172.17.1.2 rcv OPEN, version 4
1d03h: BGP: 172.17.1.2 rcv OPEN w/ OPTION parameter len: 0
1d03h: BGP: 172.17.1.2 bad OPEN, remote AS is 1, expected 2
1d03h: BGP: 172.17.1.2 went from OpenSent to Closing
1d03h: BGP: 172.17.1.2 sending NOTIFICATION 2/2 (peer in wrong AS) 2 bytes 0001
1d03h: BGP: 172.17.1.2 local error close, erroneous BGP update received
1d03h: BGP: 172.17.1.2 went from Closing to Idle
1d03h: BGP: 172.17.1.2 closing
Correct the remote AS number in the neighbor statement on Router B, but use an incorrect IP address for Router A:
Router B
router bgp 2
neighbor 172.17.1.3 remote-as 1
Clear the connection and observe the debug output:
rtrB#debug ip bgp
rtrB#clear ip bgp *
1d04h: BGP: 172.17.1.3 open active, local address 172.17.1.1
1d04h: BGP: 172.17.1.3 open failed: Connection timed out; remote host not responding
< Free Open Study >
15-27 clear ip bgp neighbor-ip-address flap-statistics
< Free Open Study >
Syntax Description:
prefix— Prefix of the dampened route to clear.
mask— Mask of the dampened route to clear.
list-number— Number of the IP access list used to identify prefixes to be cleared.
regular-expression— Clear statistics for routes matching the regular expression.
neighbor-ip-address— Clear flap statistics of routes received from the neighbor.
Purpose: To clear the flap statistics for all routes or for specific routes. See section 3-9 through 3-12 regarding the configuration of BGP dampening.
Cisco IOS Software Release: 11.0
< Free Open Study >
15-22 clear ip bgp dampening prefix mask
< Free Open Study >
Syntax Description:
Purpose: To clear dampening information for all dampened routes or for a specific dampened route. Suppressed routes will be unsuppressed.
Cisco IOS Software Release: 11.0
< Free Open Study >
15-20 clear ip bgp peer-group peer-group-name soft in out
< Free Open Study >
Syntax Description:
AS-number— Resets all neighbors in the specified autonomous system.
neighbor-ip-address— Resets the specified BGP neighbor.
peer-group-name— Resets all neighbors in the specified peer group.
Purpose: To reset a BGP connection. BGP neighbor connections can be reset based on the neighbor’s IP address, the neighbor’s autonomous system number, or the peer group name. You must reset a BGP connection when any of the following have been modified or added to:
Clearing a BGP connection without the soft keyword causes the neighbor relationship to transition from Established to Idle. The neighbor relationship is then reestablished, and the new routing policie s take effect. If the soft keyword is used, the session is not reset, and all routing updates are resent. When you use the soft in option, the local BGP configuration should include the neighbor soft-reconfiguration command (see section 8-30 ). Using the soft in option is memory-intensive. Using soft out for outbound reconfiguration does not incur additional memory overhead. Using soft in out is equivalent to using just soft.
Cisco IOS Software Release: 10.0
< Free Open Study >
14-114 show ip bgp summary | include line
< Free Open Study >
Syntax Description:
Purpose: To display the status of BGP connections.
Cisco IOS Software Release: 10.0. The PfxRcd and Admin fields were added in version 12.0.
Example: Display a Summary for All BGP Connections
Display the entire BGP table:
rtrA#show ip bgp summary
BGP router identifier 200.1.4.1, local AS number 2
BGP table version is 14, main routing table version 14
7 network entries and 7 paths using 931 bytes of memory
3 BGP path attribute entries using 156 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP activity 193/657 prefixes, 193/186 paths, scan interval 15 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.1.1.2 4 2 7584 7590 14 0 0 5d06h 0
172.17.1.2 4 1 13359 13353 14 0 0 1w1d 3
The following list explains some of the fields that appear in the preceding output from the show ip bgp summary command.
BGP router identifier— ID of the neighbor router.
BGP table version-Version— number of the internal BGP database.
main routing table version— Last version of the BGP database that was injected into the main routing table.
Neighbor— BGP neighbor’s IP address.
V— BGP version number that the neighbors are using.
AS— Neighbor’s autonomous system number.
MsgRcvd— Number of BGP messages received from the neighbor.
MsgSent— Number of BGP messages sent to the neighbor.
TblVer— Last version of the BGP database that was sent to that neighbor.
InQ— Number of messages from that neighbor waiting to be processed.
OutQ— Number of messages waiting to be sent to that neighbor.
Up/Down— The length of time that the BGP session has been in the Established state, or the current state if it is not Established.
State/PfxRcd— Current state of the BGP session/the number of prefixes the router has received from a neighbor or peer group. When the maximum number (as set by the neighbor maximum-prefix command; see sections 8-13 through 8-16 ) is reached, the string "PfxRcd" appears in the entry, the neighbor is shut down, and the connection is Idle. An (Admin) entry with Idle status indicates that the connection has been shut down using the neighbor shutdown command (see section 8-29 ).
< Free Open Study >
Free cisco study workbook download.