이 문서에서는 BGP(Border Gateway Protocol) 최적 경로 알고리즘의 기능을 설명합니다.
BGP 라우터는 대개 동일한 대상에 대한 여러 경로를 수신합니다. BGP 최적 경로 알고리즘은 IP 라우팅 테이블에서 설치하고 트래픽 포워딩에 사용하기에 가장 좋은 경로가 어느 것인지를 확인합니다.
라우터가 특정 접두사에 대해 수신하는 모든 경로가 목록으로 정리되어 있다고 가정합니다. 이 목록은 show ip bgp longer-prefixes 명령의 출력과 유사합니다. 이와 같은 경우 일부 경로는 최적 경로의 후보로 간주되지 않습니다. 그러한 경로는 대개 show ip bgp longer-prefixes 명령의 출력에서 유효한 플래그가 없습니다. 이러한 상황에서는 라우터가 경로를 무시합니다.
show ip bgp longer-prefixes 출력에서 not synchronized 로 표시된 경로.
BGP 동기화가 활성화된 경우, IP 라우팅 테이블에 접두사에 대해 일치하는 항목이 있어야 iBGP(internal BGP) 경로를 유효한 경로로 간주할 수 있습니다. 원래 BGP 동기화는 Cisco IOS® Software에서 기본적으로 활성화되었습니다. OSPF(Open Shortest Path First) 인접 라우터로부터 일치하는 경로를 학습할 경우, 해당 OSPF 라우터 ID가 iBGP 인접 라우터의 BGP 라우터 ID와 일치해야 합니다. 사용자 대부분은 no synchronization BGP 하위 명령 사용 시 동기화 비활성화를 선호합니다.
NEXT_HOP이 액세스 불가한 경로.
이 경로와 연결되는 NEXT_HOP에 대한 IGP(Interior Gateway Protocol) 경로가 있음을 확인합니다.
로컬 AS(Autonomous System)가 AS_PATH에 나타나는 경우, eBGP(external BGP) 인접 라우터로부터의 경로.
그러한 경로는 라우터에 대한 인그레스에서 거부되며, BGP RIB(Routing Information Base)에 설치되지도 않습니다. 인접 라우터에 대해 neighbor soft-reconfiguration inbound를 설정하지 않는 한, 액세스, 접두사, AS_PATH 또는 커뮤니티 목록을 통해 구현된 라우팅 정책에 따라 거부되는 모든 경로에도 동일한 원칙이 적용됩니다.
bgp enforce-first-as를 활성화했고, UPDATE에서 인접 라우터의 AS를 AS_SEQUENCE의 첫 번째 AS 번호로 포함하지 않은 경우.
이와 같은 경우에는 라우터가 알림을 보내고 세션을 종료합니다.
출력에서 (received-only)로 표시되는 경로show ip bgp longer-prefixes
정책에 따라 이 경로를 거부했습니다. 그러나 경로를 보내는 인접 라우터에 대해 을(를) 설정했기 때문에 라우터에서 경로를 저장했습니다.soft-reconfiguration inbound
BGP는 첫 번째 유효한 경로를 현재 최적 경로로 지정합니다. 그런 다음 BGP는 유효 경로 목록의 끝에 도달할 때까지 최적 경로를 목록의 다음 경로와 비교합니다. 이 목록은 최적 경로를 결정하는 데 적용할 규칙을 제공합니다.
최고 WEIGHT의 경로를 선호합니다.
최고 LOCAL_PREF의 경로를 선호합니다.
network 또는 aggregate BGP 하위 명령을 통해 아니면 IGP에서 재배포되는 방식으로 로컬에서 생성된 경로를 선호합니다.
network 또는 redistribute 명령에 의해 소싱된 로컬 경로를 aggregate-address 명령에 의해 소싱된 로컬 집계보다 선호합니다.
가장 짧은 AS_PATH의 경로를 선호합니다.
원본 유형이 가장 낮은 경로를 선호합니다.
MED(multi-exit discriminator)가 가장 낮은 경로를 선호합니다.
iBGP 경로보다 eBGP 경로를 선호합니다.
최적 경로가 선택된 경우 9단계(다중 경로)로 진행합니다.
BGP Next Hop에 대한 IGP 메트릭이 가장 낮은 경로를 선호합니다.
최적 경로가 이미 선택되었더라도 계속합니다.
BGP 다중 경로를 위해 여러 경로가 라우팅 테이블에서 설치되어야 하는지를 확인합니다.
최적 경로가 아직 선택되지 않았다면 계속합니다.
두 경로 모두 외부인 경우 먼저 수신된 경로(오래된 경로)가 우선합니다.
다음 결정 기준(11단계, 12단계, 13단계)에 따라 새 경로가 선호 경로이더라도, 이 단계에서는 새 경로가 기존 경로를 대체하지 않으므로 경로 플랩을 최소화합니다.
다음 중 하나라도 해당될 경우 이 단계를 건너뜁니다.
bgp best path compare-routerid 명령을 활성화했습니다.
같은 라우터에서 경로를 수신했기 때문에 다중 경로의 라우터 ID가 같습니다.
현재 최적 경로가 없습니다.
경로를 제공하는 인접 라우터가 중단되는 등의 상황에서는 현재 최적 경로가 사라질 수 있습니다.
BGP 라우터에서 제공하고, 라우터 ID가 가장 낮은 경로를 선호합니다.
수동으로 구성하지 않으면 라우터 ID가 루프백 인터페이스에서 가장 높은 IP 주소로 선택됩니다. 루프백 인터페이스가 없는 경우 활성 물리적 인터페이스에서 가장 높은 IP 주소로 선택됩니다. bgp router-id 명령을 사용하여 라우터 ID를 수동으로 설정할 수 있습니다.
여러 경로의 발신자 또는 라우터 ID가 동일할 경우 클러스터 목록 길이가 가장 짧은 경로가 우선합니다.
이는 BGP RR 환경에만 있습니다. 클라이언트가 RR과 또는 다른 클러스터의 클라이언트와 피어링하는 것을 허용합니다. 이 시나리오에서 클라이언트는 RR 관련 BGP 속성을 알고 있어야 합니다.
가장 낮은 네이버 주소에서 시작하는 경로가 우선합니다.
이 주소는 BGP 설정에 사용된 IP 주소입니다.neighbor 이 주소는 로컬 라우터와의 TCP 연결에 쓰인 원격 피어에 해당합니다.
이 예에서는 네트워크 10.30.116.0/23에 대해 9개의 경로를 사용할 수 있습니다. show ip bgp network 명령은 지정된 네트워크에 대한 BGP 라우팅 테이블의 항목을 표시합니다.
Router R1#show ip bgp vpnv4 rd 1100:1001 10.30.116.0/23
BGP routing table entry for 1100:1001:10.30.116.0/23, version 26765275
Paths: (9 available, best #6, no table)
Advertised to update-groups:
1 2 3
(65001 64955 65003) 65089, (Received from a RR-client)
172.16.254.226 (metric 20645) from 172.16.224.236 (172.16.224.236)
Origin IGP, metric 0, localpref 100, valid, confed-internal
Extended Community: RT:1100:1001
mpls labels in/out nolabel/362
(65008 64955 65003) 65089
172.16.254.226 (metric 20645) from 10.131.123.71 (10.131.123.71)
Origin IGP, metric 0, localpref 100, valid, confed-external
Extended Community: RT:1100:1001
mpls labels in/out nolabel/362
(65001 64955 65003) 65089
172.16.254.226 (metric 20645) from 172.16.216.253 (172.16.216.253)
Origin IGP, metric 0, localpref 100, valid, confed-external
Extended Community: RT:1100:1001
mpls labels in/out nolabel/362
(65001 64955 65003) 65089
172.16.254.226 (metric 20645) from 172.16.216.252 (172.16.216.252)
Origin IGP, metric 0, localpref 100, valid, confed-external
Extended Community: RT:1100:1001
mpls labels in/out nolabel/362
(64955 65003) 65089
172.16.254.226 (metric 20645) from 10.77.255.57 (10.77.255.57)
Origin IGP, metric 0, localpref 100, valid, confed-external
Extended Community: RT:1100:1001
mpls labels in/out nolabel/362
(64955 65003) 65089
172.16.254.226 (metric 20645) from 10.57.255.11 (10.57.255.11)
Origin IGP, metric 0, localpref 100, valid, confed-external, best
Extended Community: RT:1100:1001
mpls labels in/out nolabel/362
!--- BGP selects this as the Best Path on comparing
!--- with all the other routes and selected based on lower router ID.
(64955 65003) 65089
172.16.254.226 (metric 20645) from 172.16.224.253 (172.16.224.253)
Origin IGP, metric 0, localpref 100, valid, confed-internal
Extended Community: RT:1100:1001
mpls labels in/out nolabel/362
(65003) 65089
172.16.254.226 (metric 20645) from 172.16.254.234 (172.16.254.234)
Origin IGP, metric 0, localpref 100, valid, confed-external
Extended Community: RT:1100:1001
mpls labels in/out nolabel/362
65089, (Received from a RR-client)
172.16.228.226 (metric 20645) from 172.16.228.226 (172.16.228.226)
Origin IGP, metric 0, localpref 100, valid, confed-internal
Extended Community: RT:1100:1001
mpls labels in/out nolabel/278
BGP는 이 문서에서 설명한 여러 속성을 고려하여 이 9개 경로 중 최적 경로를 선택합니다. 여기 표시된 출력에서 BGP는 사용 가능한 경로를 비교하고, 더 낮은 라우터 ID를 기준으로 삼아 경로 6번을 최적 경로로 선택합니다.
Comparing path 1 with path 2: Both paths have reachable next hops Both paths have a WEIGHT of 0 Both paths have a LOCAL_PREF of 100 Both paths are learned Both paths have AS_PATH length 1 Both paths are of origin IGP The paths have different neighbor AS's so ignoring MED Both paths are internal (no distinction is made between confed-internal and confed-external) Both paths have an IGP metric to the NEXT_HOP of 20645 Path 2 is better than path 1 because it has a lower Router-ID. Comparing path 2 with path 3: Both paths have reachable next hops Both paths have a WEIGHT of 0 Both paths have a LOCAL_PREF of 100 Both paths are learned Both paths have AS_PATH length 1 Both paths are of origin IGP Both paths have the same neighbor AS, 65089, so comparing MED. Both paths have a MED of 0 Both paths are confed-external Both paths have an IGP metric to the NEXT_HOP of 20645 Path 2 is better than path 3 because it has a lower Router-ID. Comparing path 2 with path 4: Both paths have reachable next hops Both paths have a WEIGHT of 0 Both paths have a LOCAL_PREF of 100 Both paths are learned Both paths have AS_PATH length 1 Both paths are of origin IGP Both paths have the same neighbor AS, 65089, so comparing MED. Both paths have a MED of 0 Both paths are confed-external Both paths have an IGP metric to the NEXT_HOP of 20645 Path 2 is better than path 4 because it has a lower Router-ID. Comparing path 2 with path 5: Both paths have reachable next hops Both paths have a WEIGHT of 0 Both paths have a LOCAL_PREF of 100 Both paths are learned Both paths have AS_PATH length 1 Both paths are of origin IGP Both paths have the same neighbor AS, 65089, so comparing MED. Both paths have a MED of 0 Both paths are confed-external Both paths have an IGP metric to the NEXT_HOP of 20645 Path 5 is better than path 2 because it has a lower Router-ID. Comparing path 5 with path 6: Both paths have reachable next hops Both paths have a WEIGHT of 0 Both paths have a LOCAL_PREF of 100 Both paths are learned Both paths have AS_PATH length 1 Both paths are of origin IGP Both paths have the same neighbor AS, 65089, so comparing MED. Both paths have a MED of 0 Both paths are confed-external Both paths have an IGP metric to the NEXT_HOP of 20645 Path 6 is better than path 5 because it has a lower Router-ID. Comparing path 6 with path 7: Both paths have reachable next hops Both paths have a WEIGHT of 0 Both paths have a LOCAL_PREF of 100 Both paths are learned Both paths have AS_PATH length 1 Both paths are of origin IGP Both paths have the same neighbor AS, 65089, so comparing MED. Both paths have a MED of 0 Both paths are internal (no distinction is made between confed-internal and confed-external) Both paths have an IGP metric to the NEXT_HOP of 20645 Path 6 is better than path 7 because it has a lower Router-ID. Comparing path 6 with path 8: Both paths have reachable next hops Both paths have a WEIGHT of 0 Both paths have a LOCAL_PREF of 100 Both paths are learned Both paths have AS_PATH length 1 Both paths are of origin IGP Both paths have the same neighbor AS, 65089, so comparing MED. Both paths have a MED of 0 Both paths are confed-external Both paths have an IGP metric to the NEXT_HOP of 20645 Path 6 is better than path 8 because it has a lower Router-ID. Comparing path 6 with path 9: Both paths have reachable next hops Both paths have a WEIGHT of 0 Both paths have a LOCAL_PREF of 100 Both paths are learned Both paths have AS_PATH length 1 Both paths are of origin IGP The paths have different neighbor AS's so ignoring MED Both paths are internal (no distinction is made between confed-internal and confed-external) Both paths have an IGP metric to the NEXT_HOP of 20645 Path 6 is better than path 9 because it has a lower Router-ID. The best path is #6
BGP Cost Community라고 하는 확장 커뮤니티 속성이 최적 경로 선택 프로세스를 사용자 지정하는 방법을 제공합니다. 최적 경로 알고리즘 작동 방식 섹션에서 설명하는 알고리즘에 비용 커뮤니티 비교 단계가 추가됩니다. 이 단계는 알고리즘의 필수 단계(삽입 지점) 다음에 옵니다. 비용 값이 가장 낮은 경로를 선호합니다.
BGP 다중 경로를 사용하면 동일한 대상에 대한 여러 BGP 경로의 IP 라우팅 테이블에 설치할 수 있습니다. 이러한 경로는 로드 공유에 최적 경로와 함께 테이블에 설치됩니다. BGP 다중 경로는 최적 경로를 선택할 때는 영향을 주지 않습니다. 예를 들어, 라우터는 알고리즘에 따라 경로 중 하나를 계속해서 최적 경로로 지정하고 인접 라우터에 이 최적 경로를 알립니다.
다음은 BGP 다중 경로 기능입니다.
eBGP 다중 경로 - maximum-paths n
iBGP 다중 경로 - maximum-paths ibgp n
eiBGP 다중 경로 - maximum-paths eibgp
다중 경로의 후보가 되려면 동일한 대상에 대한 경로에 최적의 경로 특성과 동일한 다음 특성이 있어야 합니다.
무게
로컬 기본 설정
AS-PATH 길이
근원
MED
다음 중 하나입니다.
인접 라우터 AS 또는 하위 AS(eiBGP 다중 경로 기능 추가 전)
AS-PATH(eiBGP 다중 경로 기능 추가 후)
일부 BGP 다중 경로 기능은 다중 경로 후보에게 다음과 같은 추가 요구 사항을 제시합니다.
다음은 eBGP 다중 경로에 대한 추가 요구 사항입니다.
경로는 외부 또는 연합-외부 인접 라우터(eBGP)에서 확인되어야 합니다.
BGP next hop에 대한 IGP 메트릭은 최적의 경로 IGP 메트릭과 동일해야 합니다.
다음은 iBGP 다중 경로에 대한 추가 요구 사항입니다.
경로는 내부 인접 라우터(iBGP)에서 확인되어야 합니다.
라우터가 동일하지 않은 비용의 iBGP 다중 경로에 대해 구성되지 않은 경우 BGP next hop에 대한 IGP 메트릭은 최적의 경로 IGP 메트릭과 동일해야 합니다.
BGP는 IP 라우팅 테이블에 다중 경로 후보로부터 최근에 수신한 경로를 n개까지 추가합니다. n의 최대값은 플랫폼 및 소프트웨어 버전에 따라 다릅니다. 기존 플랫폼은 최소 6개의 경로를 지원하는 반면, 최신 플랫폼은 16개, 32개 이상을 지원할 수 있습니다. 다중 경로가 비활성화된 경우 기본값은 1입니다.
비용이 동일하지 않은 로드 밸런싱에 BGP 링크 대역폭을 사용할 수도 있습니다.
| 개정 | 게시 날짜 | 의견 |
|---|---|---|
6.0 |
28-Apr-2026
|
서식 지정 |
5.0 |
02-Dec-2024
|
서식 및 링크가 수정되었습니다. |
4.0 |
11-Jul-2023
|
제목, 소개 및 서식 업데이트
배경 정보를 추가했습니다. |
3.0 |
22-Jun-2022
|
기계 번역 지침으로 업데이트되었습니다. |
1.0 |
10-Dec-2001
|
최초 릴리스 |