소개
이 문서에서는 BGP(Border Gateway Protocol) 트러블슈팅을 수행하는 절차와 Nexus의 기본 출력에 대한 이해를 설명합니다.
사전 요구 사항
요구 사항
다음 주제에 대한 지식을 보유하고 있으면 유용합니다.
사용되는 구성 요소
이 문서는 특정 소프트웨어 및 하드웨어 버전으로 한정되지 않습니다.
이 문서의 정보는 특정 랩 환경의 디바이스를 토대로 작성되었습니다. 이 문서에 사용된 모든 디바이스는 초기화된(기본) 컨피그레이션으로 시작되었습니다. 현재 네트워크가 작동 중인 경우 모든 명령의 잠재적인 영향을 미리 숙지하시기 바랍니다.
배경 정보
BGP는 AS(Autonomous System) 간 라우팅 및 연결 정보의 교환을 지원하기 위해 대규모 네트워크에서 사용되는 외부 게이트웨이 프로토콜입니다. 인터넷 글로벌 라우팅 시스템을 구동하는 핵심 라우팅 프로토콜입니다.
BGP 피어에 대해 구현된 컨피그레이션 확인
Nexus 9300에서 BGP 기능이 활성화되었는지 확인합니다.
BGP 프로세스의 컨피그레이션을 식별하고 이해합니다.
switch# show running-config bgp
!Command: show running-config bgp
!Running configuration last done at: Tue Jul 18 19:45:05 2023
!Time: Tue Jul 18 19:45:44 2023
version 10.2(4) Bios:version 05.47
feature bgp
router bgp 64512 -> The AS number of the local BGP speaker.
router-id 172.17.255.255 -> BGP speaker identifier.
address-family ipv4 unicast -> Global address family configuration.
network 10.100.1.0/24 -> Specifies a network as local to this autonomous system and adds it to the BGP routing table.
redistribute direct route-map permit_all -> Routes redistribution from other routing protocols (OSPF, EIGRP, IS-IS, Static)
neighbor 10.1.1.1 -> IP address of the remote BGP peer.
remote-as 64512 -> The AS number of the remote BGP peer.*
address-family ipv4 unicast -> Local address family configuration.
prefix-list allow_in in -> Prefix-list applied at the inbound of the BGP peer. **
prefix-list allow_out out -> Prefix-list applied at the outbound of the BGP peer. **
soft-reconfiguration inbound always -> Store the inbound BGP route updates.
neighbor 172.18.255.255
remote-as 65535
update-source loopback10 -> Interface used to source BGP updates.
ebgp-multihop 3 -> Maximum hops to reach peer IP address, it modifies the TTL of the BGP packets
address-family ipv4 unicast
route-map block_route in -> Route-map applied at the inbound of the BGP peer. **
route-map no_local out -> Route-map applied at the outbound of the BGP peer. **
soft-reconfiguration inbound always
참고: 로컬과 원격에 구성된 동일한 ASN은 iBGP 세션을 식별하고, 구성된 다른 ASN은 eBGP 세션을 식별합니다.
경로 맵의 계층 구조 값이 동일한 피어에 적용된 접두사 목록보다 높습니다.
기본 BGP 출력을 이해하는 방법
BGP 피어 상태
switch# show ip bgp summary
BGP summary information for VRF default, address family IPv4 Unicast
BGP router identifier 172.17.255.255, local AS number 64512 -> Local BGP ID and ASN
BGP table version is 67, IPv4 Unicast config peers 2, capable peers 2
20 network entries and 19 paths using 5424 bytes of memory
BGP attribute entries [6/2112], BGP AS path entries [2/20]
BGP community entries [0/0], BGP clusterlist entries [0/0]
13 received paths for inbound soft reconfiguration
12 identical, 0 modified, 1 filtered received paths using 96 bytes
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.1.1.1 4 64512 346 334 67 0 0 05:25:12 8 -> BGP peer IP address, remote ASN, Time session has been established or down, amount of prefixes received.
172.18.255.255 4 65535 334 327 67 0 0 05:18:00 8
참고: Up/Down 섹션에는 BGP 피어 세션이 작동 또는 중단된 시간이 표시됩니다.
State/PfxRcd 섹션에는 세션이 현재 설정되어 있는 BGP 상태가 표시됩니다. 상태가 설정될 때 피어에서 학습된 접두사 수를 표시합니다.
BGP 상태 |
유휴 |
BGP가 "start event"를 기다리는 첫 번째 상태입니다. 누군가가 새 BGP 인접 디바이스를 구성하거나 설정된 BGP 피어링을 재설정할 때 시작 이벤트가 발생합니다. |
연결 |
BGP가 TCP 3-way 핸드셰이크가 완료되기를 기다리고 있습니다. 성공하면 OpenSent 상태가 계속됩니다. 실패할 경우 Active(활성) 상태로 계속 진행합니다. |
활성 |
BGP는 다른 TCP 3-way 핸드셰이크를 시도하여 원격 BGP 인접 디바이스와의 연결을 설정합니다. 성공하면 OpenSent 상태로 이동합니다. ConnectRetry 타이머가 만료되면 Connect 상태로 돌아갑니다. |
열린보냄 |
이 상태에서 BGP는 원격 BGP 인접 디바이스의 Open 메시지를 기다립니다. |
열기확인 |
BGP는 원격 BGP 인접 디바이스의 keepalive 메시지를 기다립니다. |
설정됨 |
BGP 네이버 인접성이 완료되었으며 BGP 라우터가 라우팅 정보를 교환하기 위해 업데이트 패킷을 전송합니다. |
BGP 피어 정보를 이해합니다.
switch# show ip bgp neighbors 10.1.1.1
BGP neighbor is 10.1.1.1, remote AS 64512, ibgp link, Peer index 3 -> Peer IP address, remote ASN, type of bgp peering.
BGP version 4, remote router ID 172.16.255.255 -> BGP version, Peer Router ID
Neighbor previous state = OpenConfirm -> Previous BGP state
BGP state = Established, up for 00:05:29 -> Current BGP state and amount of time on it
Neighbor vrf: default -> VRF used for the peering.
Peer is directly attached, interface Ethernet1/49 -> Interface used to source the updates
Last read 00:00:28, hold time = 180, keepalive interval is 60 seconds -> Amount of time from last keepalive received and BGP timers (default)
Last written 00:00:28, keepalive timer expiry due 00:00:31 -> Amount of time from last keepalive sent
Received 363 messages, 0 notifications, 0 bytes in queue
Sent 354 messages, 1 notifications, 0(0) bytes in queue
Enhanced error processing: On
0 discarded attributes
Connections established 2, dropped 1 -> Counters informing the amount of times the BGP seesion has gone up/down
Last update recd 00:05:28, Last update sent = 00:05:28 -> Timer of the last major bgp table update sent and received.
Last reset by us 00:06:21, due to holdtimer expired error -> Last reset timer and reset reason.
Last error length sent: 0
Reset error value sent: 0
Reset error sent major: 4 minor: 0
Notification data sent:
Last reset by peer never, due to No error
Last error length received: 0
Reset error value received 0
Reset error received major: 0 minor: 0
Notification data received:
Neighbor capabilities:
Dynamic capability: advertised (mp, refresh, gr) received (mp, refresh, gr)
Dynamic capability (old): advertised received
Route refresh capability (new): advertised received
Route refresh capability (old): advertised received
4-Byte AS capability: advertised received
Address family IPv4 Unicast: advertised received
Graceful Restart capability: advertised received
Graceful Restart Parameters:
Address families advertised to peer:
IPv4 Unicast
Address families received from peer:
IPv4 Unicast
Forwarding state preserved by peer for:
Restart time advertised to peer: 120 seconds
Stale time for routes advertised by peer: 300 seconds
Restart time advertised by peer: 120 seconds
Extended Next Hop Encoding Capability: advertised received
Receive IPv6 next hop encoding Capability for AF:
IPv4 Unicast VPNv4 Unicast
Message statistics:
Sent Rcvd
Opens: 2 2
Notifications: 1 0
Updates: 22 20
Keepalives: 340 339
Route Refresh: 1 0
Capability: 2 2
Total: 354 363
Total bytes: 7949 7524
Bytes in queue: 0 0
For address family: IPv4 Unicast
BGP table version 88, neighbor version 88
8 accepted prefixes (8 paths), consuming 2176 bytes of memory
0 received prefixes treated as withdrawn
11 sent prefixes (11 paths) -> Amount of prefixes advertises to peer.
Inbound soft reconfiguration allowed(always)
Third-party Nexthop will not be computed.
Inbound ip prefix-list configured is allow_in, handle obtained
Outbound ip prefix-list configured is allow_out, handle obtained
Last End-of-RIB received 00:00:01 after session start
Last End-of-RIB sent 00:00:01 after session start
First convergence 00:00:01 after session start with 11 routes sent
Local host: 10.1.1.2, Local port: 28262
Foreign host: 10.1.1.1, Foreign port: 179
fd = 73
BGP 테이블 이해
이 출력은 BGP 테이블에서 학습된 모든 접두사의 상태, next hop, metric, local preference, weight 및 AS-path를 표시합니다.
switch# show ip bgp
BGP routing table information for VRF default, address family IPv4 Unicast
BGP table version is 88, Local Router ID is 172.17.255.255
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-injected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup, 2 - best2
Network Next Hop Metric LocPrf Weight Path
*>r10.1.1.0/30 0.0.0.0 0 100 32768 ?
*>i10.100.1.0/24 10.1.1.1 100 0 i
*>i10.100.2.0/24 10.1.1.1 100 0 i
*>i10.100.3.0/24 10.1.1.1 150 0 i
*>i10.100.4.0/24 10.1.1.1 0 100 0 ?
*>i10.100.5.0/24 10.1.1.1 0 100 0 ?
*>i10.100.6.0/24 10.1.1.1 0 100 0 ?
*>i10.100.7.0/24 10.1.1.1 0 100 0 ?
*>i10.100.8.0/24 10.1.1.1 0 100 0 ?
*>r172.17.255.255/32 0.0.0.0 0 100 32768 ?
*>e172.30.1.0/24 172.18.255.255 0 0 65535 ?
*>e172.30.2.0/24 172.18.255.255 0 0 65535 ?
*>e172.30.3.0/24 172.18.255.255 0 0 65535 ?
*>e172.30.4.0/24 172.18.255.255 0 0 65535 ?
*>e172.30.5.0/24 172.18.255.255 0 0 65535 65534 65533 ?
*>e172.30.6.0/24 172.18.255.255 0 0 65535 65534 65533 ?
*>e172.30.7.0/24 172.18.255.255 0 0 65535 65534 65533 ?
*>e172.30.8.0/24 172.18.255.255 0 0 65535 65534 65533 ?
*>r192.168.1.0/30 0.0.0.0 0 100 32768 ?
접두사는 특정 BGP 인접 디바이스에 광고됩니다.
switch# show ip bgp neighbors 172.18.255.255 advertised-routes
Peer 172.18.255.255 routes for address family IPv4 Unicast:
BGP table version is 88, Local Router ID is 172.17.255.255
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-injected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup, 2 - best2
Network Next Hop Metric LocPrf Weight Path
*>i10.100.1.0/24 10.1.1.1 100 0 i
*>i10.100.2.0/24 10.1.1.1 100 0 i
*>i10.100.3.0/24 10.1.1.1 150 0 i
*>i10.100.4.0/24 10.1.1.1 0 100 0 ?
*>i10.100.5.0/24 10.1.1.1 0 100 0 ?
*>i10.100.6.0/24 10.1.1.1 0 100 0 ?
*>i10.100.7.0/24 10.1.1.1 0 100 0 ?
*>i10.100.8.0/24 10.1.1.1 0 100 0 ?
필터(접두사 목록 및/또는 경로 맵) 이전의 BGP 피어에서 수신된 접두사*
switch# show ip bgp neighbors 172.18.255.255 received-routes
Peer 172.18.255.255 routes for address family IPv4 Unicast:
BGP table version is 88, Local Router ID is 172.17.255.255
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-injected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup, 2 - best2
Network Next Hop Metric LocPrf Weight Path
* e172.18.255.255/32 172.18.255.255 0 0 65535 ?
*>e172.30.1.0/24 172.18.255.255 0 0 65535 ?
*>e172.30.2.0/24 172.18.255.255 0 0 65535 ?
*>e172.30.3.0/24 172.18.255.255 0 0 65535 ?
*>e172.30.4.0/24 172.18.255.255 0 0 65535 ?
*>e172.30.5.0/24 172.18.255.255 0 0 65535 65534 65533 ?
*>e172.30.6.0/24 172.18.255.255 0 0 65535 65534 65533 ?
*>e172.30.7.0/24 172.18.255.255 0 0 65535 65534 65533 ?
*>e172.30.8.0/24 172.18.255.255 0 0 65535 65534 65533 ?
메모
소프트 리컨피그레이션 인바운드는 네이버에 구성해야 합니다.
필터(prefix-list 및/또는 route-map) 이후 BGP 피어로부터 수신된 접두사
switch# show ip bgp neighbors 172.18.255.255 routes
Peer 172.18.255.255 routes for address family IPv4 Unicast:
BGP table version is 88, Local Router ID is 172.17.255.255
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-injected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup, 2 - best2
Network Next Hop Metric LocPrf Weight Path
*>e172.30.1.0/24 172.18.255.255 0 0 65535 ?
*>e172.30.2.0/24 172.18.255.255 0 0 65535 ?
*>e172.30.3.0/24 172.18.255.255 0 0 65535 ?
*>e172.30.4.0/24 172.18.255.255 0 0 65535 ?
*>e172.30.5.0/24 172.18.255.255 0 0 65535 65534 65533 ?
*>e172.30.6.0/24 172.18.255.255 0 0 65535 65534 65533 ?
*>e172.30.7.0/24 172.18.255.255 0 0 65535 65534 65533 ?
*>e172.30.8.0/24 172.18.255.255 0 0 65535 65534 65533 ?
특정 접두사에 대한 세부 경로 정보입니다.
switch# show ip bgp 172.30.6.0
BGP routing table information for VRF default, address family IPv4 Unicast
BGP routing table entry for 172.30.6.0/24, version 28 -> Prefix and mask
Paths: (3 available, best #3) -> Number of possible paths and which one is selected as best option
Flags: (0x8000001a) (high32 00000000) on xmit-list, is in urib, is best urib route, is in HW
Path type: external, path is valid, not best reason: Router Id, no labeled nexthop
AS-Path: 65535 65534 65533 , path sourced external to AS -> As Path to reach the prefix*
172.20.255.255 (metric 0) from 172.20.255.255 (172.20.255.255) -> Next hop towards the prefix
Origin incomplete, MED 0, localpref 100, weight 0
Path type: external, path is valid, not best reason: newer EBGP path, no labeled nexthop
AS-Path: 65535 65534 65533 , path sourced external to AS
172.19.255.255 (metric 0) from 172.19.255.255 (172.19.255.255)
Origin incomplete, MED 0, localpref 100, weight 0
Advertised path-id 1
Path type: external, path is valid, is best path, no labeled nexthop, in rib -> Path selection motive
AS-Path: 65535 65534 65533 , path sourced external to AS
172.18.255.255 (metric 0) from 172.18.255.255 (172.18.255.255)
Origin incomplete, MED 0, localpref 100, weight 0
Path-id 1 advertised to peers: -> BGP peers were the prefix is advertised
10.1.1.2
참고: *AS-Path는 접두사가 시작된 위치에 도달하기 위해 통과된 ASN을 나타냅니다.
**AS-Path는 오른쪽에서 왼쪽으로 읽습니다.
BGP의 최적 경로 선택 프로세스를 검토하려면 BGP 최적 경로 선택을 참조하십시오.
관련 정보