BGP show Commands

This section briefly reviews some show commands that you can use with BGP. For the CCIE written exam, know how to read the fields in the output of these commands.

The first command is show ip bgp neighbors, as shown in Example 9-17. Use this command to check if a TCP connection has been established with the neighbor. The BGP neighbor is the IP address of the peer. The remote AS number is provided. The remote RID is the BGP RID of the peer. The BGP state is Established. Notifications are the number of error messages sent or received from the peer. NLRI means Network Layer Reachability Information, which are destination IP networks. The local router IP address and port is 1.1.1.1 and 11007. The remote IP address is 1.1.1.2 and the TCP port is 179 (for BGP).

Example 9-17 show ip bgp neighbors Command

R9#show ip bgp neighbors 1.1.1.2

BGP neighbor is 1.1.1.2, remote AS 200, external link BGP version 4, remote router ID 10.10.10.10 BGP state = Established, up for 00:00:22

Last read 00:00:21, hold time is 180, keepalive interval is 60 seconds Neighbor capabilities:

Route refresh: advertised and received(new)

Example 9-17 show ip bgp neighbors Command (Continued)

Address family IPv4 Unicast: advertised and received Received 3 messages, 0 notifications, 0 in queue Sent 3 messages, 0 notifications, 0 in queue Route refresh request: received 0, sent 0

Default minimum time between advertisement runs is 30 seconds

For address family: IPv4 Unicast BGP table version 1, neighbor version 1 Index 1, Offset 0, Mask 0x2 0 accepted prefixes consume 0 bytes Prefix advertised 0, suppressed 0, withdrawn 0 Number of NLRIs in the update sent: max 0, min 0

Connections established 1; dropped 0 Last reset never Connection state is ESTAB, I/O status: 1, unread input bytes: 0 Local host: 1.1.1.1, Local port: 11007 Foreign host: 1.1.1.2, Foreign port: 179

The command show ip bgp lists the networks in the BGP table, as shown in Example 9-18. The next hop, metric, preference, weight, AS path, and origin attributes are listed in this command's output. The status codes are on the left; origin codes are on the right.

Status codes are as follows:

• s indicates suppressed routes; the route is suppressed when its penalty exceeds the limit.

• d indicates dampened routes; the route has flapped so often that the router does not advertise this route to BGP neighbors.

• h indicates a history state; after a route flaps once, it is assigned a penalty and put into history state, meaning the router does not have the best path, based on historical information.

• i indicates an internal route. Origin codes are as follows:

• i indicates entry originated from an IGP advertised with the network command.

• e indicates entry originated from EGP.

• ? indicates origin is unknown, usually from redistribution.

Example 9-18 show ip bgp Command

R7#show ip bgp

BGP table version

is 14, local router

ID is 7.7

.7.7

Status codes: s suppressed, d damped,

h history

, * valid,

> best,

i

internal

Origin codes: i -

IGP, e - EGP, ? - incomplete

Network

Next Hop

Metric

LocPrf Weight

Path

*> 18.88.88.0/24

78.1.1.8

0

0

128

i

* i

172.16.64.1

100

0

128

i

*>i79.7.7.0/24

9.9.9.9

0

100

0

i

*>i109.1.1.0/24

10.10.10.10

0

100

0

i

*>i155.55.55.0/24

172.16.64.1

100

0

128

i

*> 172.16.1.0/24

78.1.1.8

0

128

i

* i

172.16.64.1

0

100

0

128

i

*>i199.99.99.0

9.9.9.9

0

100

0

i

*>i222.222.222.0

172.16.64.1

You can use several keywords to clear BGP sessions. Example 9-19 shows the possible keywords. To reset all of BGP, use clear ip bgp *. To clear peers within an AS, use clear ip bgp as-number. To clear a BGP neighbor, use clear ip bgp ip-address. To clear all BGP external peers, use clear ip bgp external.

Example 9-19 Clearing the BGP Table

R7#clear ip bgp ?

*

Clear all peers

<1-65535>

Clear peers with the AS number

A.B.C.D

BGP neighbor address to clear

dampening

Clear route flap dampening information

external

Clear all external peers

flap-statistics

Clear route flap statistics

ipv4

Address family

peer-group

Clear all members of peer-group

vpnv4

Address family

The router enters BGP table entries into the routing table. To verify BGP routes, use the show ip routes command, as shown in Example 9-20. By default, eBGP routes have an administrative distance of 20, and iBGP routes have an administrative distance of 200. In the example, network 222.222.222.0/24 was learned from BGP with an administrative distance of 200 (iBGP). Network 18.88.88.0/24 is an eBGP route, and the next hop is 78.1.1.8. Network 172.16.1.0/24 was learned from an external BGP peer because its administrative distance is 20. Network 199.99.99.0/24 was learned from an internal BGP peer because the administrative distance is 200.

Example 9-20 BGP Routes Marked in the Routing Table

R7#sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route

Gateway of last resort is not set

155.55.0.0/24 is subnetted, 1 subnets B 155.55.55.0 [200/0] via 172.16.64.1, 1d03h

18.0.0.0/24 is subnetted, 1 subnets B 18.88.88.0 [20/0] via 78.1.1.8, 1d22h

172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks B 172.16.1.0/24 [20/0] via 78.1.1.8, 1d22h

R 172.16.64.0/25 [120/2] via 79.7.7.9, 00:00:01, Ethernet0

7.0.0.0/32 is subnetted, 1 subnets C 78.1.1.0 is directly connected, Serial1

109.0.0.0/24 is subnetted, 1 subnets R 109.1.1.0 [120/1] via 79.7.7.9, 00:00:04, Ethernet0

79.0.0.0/24 is subnetted, 1 subnets C 79.7.7.0 is directly connected, Ethernet0

0 0

Post a comment