BGP(Border Gateway Protocol) 조건부 알림 기능은 BGP 테이블에 다른 접두사가 있을 경우 경로 광고를 추가로 제어합니다.
이 컨피그레이션을 시도하기 전에 다음에 대해 잘 알고 있는지 확인하십시오.
이 문서에 설명된 BGP 조건부 광고 기능은 Cisco IOS® Software Release 11.1CC 및 11.2에 소개되었으며 이후 릴리스에서 사용할 수 있습니다.
이 문서의 정보는 다음 소프트웨어 및 하드웨어 버전을 기반으로 합니다.
Cisco IOS® 소프트웨어 릴리스 12.2(13)T13
Cisco 2500 Series 라우터
이 문서의 정보는 특정 랩 환경의 디바이스를 토대로 작성되었습니다. 이 문서에 사용된 모든 디바이스는 초기화된(기본) 컨피그레이션으로 시작되었습니다. 현재 네트워크가 작동 중인 경우, 모든 명령어의 잠재적인 영향을 미리 숙지하시기 바랍니다.
일반적으로 경로는 다른 경로의 존재 여부에 관계없이 전파됩니다. BGP 조건부 알림 기능은 경로 접두사를 기준으로 경로를 추적하기 위해 neighbor advertise-map 및 advertise-map 명령의 advertise-map 키워드를 사용합니다. non-exist-map 명령의 출력에 경로 접두사가 없는 경우 advertise-map 명령에 의해 지정된 경로가 발표됩니다. 이 기능은 다른 공급자의 정보가 없는 경우에만 일부 접두사가 공급자 중 하나에 광고되는 멀티홈 네트워크에 유용합니다(이것은 피어링 세션의 실패나 부분 연결 가능성을 나타냅니다).
BGP 라우터가 피어에 전송하는 일반 공지 외에 조건부 BGP 공지가 전송됩니다.
문서 규칙에 대한 자세한 내용은 Cisco 기술 팁 표기 규칙을 참조하십시오.
이 섹션에는 이 문서에서 설명하는 기능을 구성하기 위한 정보가 표시됩니다.
참고: 이 문서에서 사용되는 명령에 대한 추가 정보를 찾으려면 IOS 명령 조회 도구를 사용하십시오.
이 문서에서는 이 다이어그램에 표시된 네트워크 설정을 사용합니다.
여기에서 R103의 루프백 인터페이스는 R102에 192.168.50.0/24을 알리는 데 사용됩니다. R102에는 기본적으로 eBGP(External BGP) 피어 R101과 R103에 모두 발표된 128.16.16.0/24의 BGP 네트워크가 있습니다.
BGP 조건부 광고 기능을 사용하여 R102에서 다음 작업을 수행할 수 있습니다.
192.168.50.0/24이 R102의 BGP 테이블에 있는 경우 128.16.16.0/24 네트워크를 R101에 광고하지 마십시오.
192.168.50.0/24이 R102의 BGP 테이블에 없는 경우 128.16.16.0/24 네트워크를 R101에 알립니다.
Cisco IOS® 12.2T 이상 버전에서는 exist-map 키워드를 사용하여 이러한 작업을 수행할 수도 있습니다.
192.168.50.0/24이 R102의 BGP 테이블에 있는 경우 128.16.16.0/24 네트워크를 R101에 광고합니다.
192.168.50.0/24이 R102의 BGP 테이블에 없는 경우 128.16.16.0/24 네트워크를 R101에 광고하지 마십시오.
이 문서에서는 다음 구성을 사용합니다.
참고: 이 예에서는 non-exist-map 키워드에 대해 설명합니다. exist-map 키워드의 사용법은 이와 유사합니다.
R102 |
---|
hostname R102 ! interface Loopback0 ip address 128.16.16.1 255.255.255.0 ! interface Serial8/0 ip address 10.10.10.2 255.255.255.0 ! interface Serial9/0 ip address 10.10.20.2 255.255.255.0 ! router bgp 2 bgp log-neighbor-changes network 128.16.16.0 mask 255.255.255.0 network 130.130.0.0 neighbor 10.10.10.1 remote-as 1 neighbor 10.10.10.1 advertise-map ADVERTISE non-exist-map NON-EXIST !--- Advertises the routes matched in the route-map ADVERTISE (128.16.16.0/24) !--- only if the routes matched in route-map NON-EXIST (192.168.50.0/24) !--- do not exist in the BGP table. neighbor 10.10.20.3 remote-as 3 ! ip route 130.130.0.0 255.255.0.0 Null0 ! access-list 60 permit 128.16.16.0 0.0.0.255 access-list 65 permit 192.168.50.0 0.0.0.255 ! route-map NON-EXIST permit 10 match ip address 65 ! route-map ADVERTISE permit 10 match ip address 60 ! |
R103 |
---|
hostname R103 ! interface Loopback0 ip address 192.168.50.1 255.255.255.0 ! interface Serial9/0 ip address 10.10.20.3 255.255.255.0 ! router bgp 3 bgp log-neighbor-changes network 192.168.50.0 neighbor 10.10.20.2 remote-as 2 ! |
R101 |
---|
hostname R101 ! interface Loopback0 ip address 200.200.200.1 255.255.255.0 ! interface Serial8/0 ip address 10.10.10.1 255.255.255.0 ! router bgp 1 bgp log-neighbor-changes network 200.200.200.0 neighbor 10.10.10.2 remote-as 2 ! |
다음 예에서는 192.168.50.0/24이 R102의 BGP 테이블에 있는 경우 BGP의 모양을 확인합니다.
먼저 R102의 BGP 테이블에 192.168.50.0/24이 있는지 확인합니다.
R102# show ip bgp BGP table version is 6, local router ID is 128.16.16.1 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 *> 128.16.16.0/24 0.0.0.0 0 32768 i *> 130.130.0.0 0.0.0.0 0 32768 i *> 192.168.50.0 10.10.20.3 0 0 3 i *> 200.200.200.0 10.10.10.1 0 0 1 i
192.168.50.0/24이 R102의 BGP 테이블에 있으므로 R102는 128.16.16/24을 R101에 광고하지 않아야 합니다.
R102# show ip bgp neighbors 10.10.10.1 advertised-routes BGP table version is 6, local router ID is 128.16.16.1 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 *> 130.130.0.0 0.0.0.0 0 32768 i *> 192.168.50.0 10.10.20.3 0 0 3 i !--- Note 128.16.16.0/24 is not advertised to neighbor 10.10.10.1. R102# show ip bgp 128.16.16.0 BGP routing table entry for 128.16.16.0/24, version 6 Paths: (1 available, best #1, table Default-IP-Routing-Table) Advertised to non peer-group peers: !--- This is not advertised to R101. 10.10.20.3 Local 0.0.0.0 from 0.0.0.0 (128.16.16.1) Origin IGP, metric 0, localpref 100, weight 32768, valid, sourced, local, best
그런 다음 R102에서 조건부 광고의 상태를 확인합니다.
R102# show ip bgp neighbors 10.10.10.1 BGP neighbor is 10.10.10.1, remote AS 1, external link BGP version 4, remote router ID 200.200.200.1 BGP state = Established, up for 02:27:07 Last read 00:00:07, hold time is 180, keepalive interval is 60 seconds !--- Output suppressed. For address family: IPv4 Unicast BGP table version 6, neighbor version 6 Index 1, Offset 0, Mask 0x2 Condition-map NON-EXIST, Advertise-map ADVERTISE, status: Withdraw 1 accepted prefixes consume 36 bytes Prefix advertised 3, suppressed 0, withdrawn 1 Number of NLRIs in the update sent: max 1, min 0 !--- Output suppressed.
이 출력에서는 조건부 광고가 "철회"되고 경로 맵 "ADVERTISE"와 일치하는 네트워크가 피어 10.10.10.1에 게시되지 않음을 보여줍니다.
route-map "ADVERTISE"와 일치하는 경로가 R101에 발표되지 않았는지 확인하려면 R101에서 BGP 테이블을 확인하십시오.
R101# show ip bgp 128.16.16.0 % Network not in table
다음 예에서는 R102 BGP 테이블에 네트워크 192.168.50.0/24이 없는 경우 BGP가 어떻게 표시되는지 보여줍니다.
먼저 R103에서 R102에 192.168.50.0/24을 더 이상 표시하지 않도록 R103에서 루프백 인터페이스 0을 종료합니다.
R103(config)# interface loopback 0 R103(config-if)# shutdown R103(config-if)# 03:29:36: %LINK-5-CHANGED: Interface Loopback0, changed state to administratively down
그런 다음 R102가 192.168.50.0/24을 학습하지 않고 네트워크가 R102 BGP 테이블에 포함되지 않았는지 확인합니다.
R102# show ip bgp BGP table version is 8, local router ID is 128.16.16.1 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 *> 128.16.16.0/24 0.0.0.0 0 32768 i *> 130.130.0.0 0.0.0.0 0 32768 i *> 200.200.200.0 10.10.10.1 0 0 1 i !--- Note 192.168.50.0/24 is not present.
이제 조건부 광고가 들어오는 데 걸리는 시간을 확인합니다.
R102# debug ip bgp updates *Mar 1 02:39:18.059: BGP(0): 10.10.20.3 rcv UPDATE about 192.168.50.0/24 -- withdrawn *Mar 1 02:39:18.059: BGP(0): no valid path for 192.168.50.0/24 *Mar 1 02:39:18.079: BGP(0): nettable_walker 192.168.50.0/24 no best path *Mar 1 02:39:18.219: BGP(0): 10.10.10.1 computing updates, afi 0, neighbor version 10, table version 11, starting at 0.0.0.0 *Mar 1 02:39:18.219: BGP(0): 10.10.10.1 send unreachable 192.168.50.0/24 *Mar 1 02:39:18.219: BGP(0): 10.10.10.1 send UPDATE 192.168.50.0/24 -- unreachable *Mar 1 02:39:18.219: BGP(0): 10.10.10.1 1 updates enqueued (average=27, maximum=27) *Mar 1 02:39:18.219: BGP(0): 10.10.10.1 update run completed, afi 0, ran for 0ms, neighbor version 10, start version 11, throttled to 11 *Mar 1 02:40:04.747: BPG(0): Condition NON-EXIST changes to Advertise *Mar 1 02:40:04.747: BGP(0): net 128.16.16.0/24 matches ADV MAP ADVERTISE: bump version to 12 *Mar 1 02:40:05.187: BGP(0): nettable_walker 128.16.16.0/24 route sourced locally *Mar 1 02:40:05.187: BGP(0): 10.10.10.1 computing updates, afi 0, neighbor version 11, table version 12, starting at 0.0.0.0 *Mar 1 02:40:05.187: BGP(0): 10.10.10.1 128.16.16.0/24 matches advertise map ADVERTISE, state: Advertise *Mar 1 02:40:05.187: BGP(0): 10.10.10.1 send UPDATE (format) 128.16.16.0/24, next 10.10.10.2, metric 0, path *Mar 1 02:40:05.187: BGP(0): 10.10.10.1 1 updates enqueued (average=52, maximum=52) *Mar 1 02:40:05.187: BGP(0): 10.10.10.1 update run completed, afi 0, ran for 0ms, neighbor version 11, start version 12, throttled to 12
조건부 알림 프로세스는 60초마다 실행되는 BGP 스캐너 프로세스에 의해 트리거됩니다. 즉, 조건부 광고가 적용되는 최대 시간은 60초입니다. BGP 테이블에서 추적된 경로가 제거되는 시기와 BGP 스캐너의 다음 인스턴스가 발생하는 시기에 따라 조건부 알림을 더 빨리 적용할 수 있습니다. R102에서 인접 디바이스 10.10.10.1의 R102에 대한 조건부 광고 상태를 확인하려면 다음 명령을 실행합니다.
R102# show ip bgp neighbors 10.10.10.1 BGP neighbor is 10.10.10.1, remote AS 1, external link BGP version 4, remote router ID 200.200.200.1 BGP state = Established, up for 02:45:27 Last read 00:00:27, hold time is 180, keepalive interval is 60 seconds !--- Output suppressed. For address family: IPv4 Unicast BGP table version 12, neighbor version 12 Index 1, Offset 0, Mask 0x2 Condition-map NON-EXIST, Advertise-map ADVERTISE, status: Advertise 1 accepted prefixes consume 36 bytes Prefix advertised 6, suppressed 0, withdrawn 4 Number of NLRIs in the update sent: max 1, min 0 !--- Output suppressed.
R101의 BGP 테이블 및 라우팅 테이블에는 다음과 같이 128.16.16.0/24이 있습니다.
참고: 이 샘플 출력에서는 BGP 라우터가 피어에 전송하는 일반적인 BGP 공지(network 130.130.0.0/16)과 더불어 조건부 BGP 공지(network 128.16.16.0/24)이 전송됩니다.
R101# show ip bgp BGP table version is 18, local router ID is 200.200.200.1 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 *> 128.16.16.0/24 10.10.10.2 0 0 2 i *> 130.130.0.0 10.10.10.2 0 0 2 i *> 200.200.200.0 0.0.0.0 0 32768 i
R101# show ip route bgp 128.16.0.0/24 is subnetted, 1 subnets B 128.16.16.0 [20/0] via 10.10.10.2, 00:09:32 B 130.130.0.0/16 [20/0] via 10.10.10.2, 02:48:46
이 예에서는 BGP가 "Advertise"에서 "Withut"으로 어떻게 변경되는지 확인하기 위해 R102에 192.168.50.0/24 네트워크를 재설치하는 것을 포함합니다.
192.168.50.0/24을 다시 설치하려면 no shutdown 명령을 실행하여 R103의 인터페이스 루프백 0을 "UP"로 설정합니다.
R103(config)# interface loopback 0 R103(config-if)# no shutdown R103(config-if)# 03:49:06: %LINK-3-UPDOWN: Interface Loopback0, changed state to up 03:49:07: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up !--- R102 kicks in conditional advertisement the moment the !--- conditional network is received again. *Mar 1 02:51:42.227: BGP(0): 10.10.20.3 rcvd UPDATE w/ attr: nexthop 10.10.20.3, origin i, metric 0, path 3 *Mar 1 02:51:42.227: BGP(0): 10.10.20.3 rcvd 192.168.50.0/24 *Mar 1 02:51:42.247: BGP(0): Revise route installing 192.168.50.0/24 -> 10.10.20.3 to main IP table *Mar 1 02:51:42.379: BGP(0): 10.10.10.1 computing updates, afi 0, neighbor version 12, table version 13, starting at 0.0.0.0 *Mar 1 02:51:42.379: BGP(0): 10.10.10.1 send UPDATE (format) 192.168.50.0/24, next 10.10.10.2, metric 0, path 3 *Mar 1 02:51:42.379: BGP(0): 10.10.10.1 1 updates enqueued (average=47, maximum=47) *Mar 1 02:51:42.379: BGP(0): 10.10.10.1 update run completed, afi 0, ran for 0ms, neighbor version 12, start version 13, throttled to 13 *Mar 1 02:52:09.159: BPG(0): Condition NON-EXIST changes to Withdraw *Mar 1 02:52:09.159: BGP(0): net 128.16.16.0/24 matches ADV MAP ADVERTISE: bump version to 14 *Mar 1 02:52:09.499: BGP(0): nettable_walker 128.16.16.0/24 route sourced locally *Mar 1 02:52:11.559: BGP(0): 10.10.10.1 computing updates, afi 0, neighbor version 13, table version 14, starting at 0.0.0.0 *Mar 1 02:52:11.559: BGP(0): 10.10.10.1 128.16.16.0/24 matches advertise map ADVERTISE, state: Withdraw *Mar 1 02:52:11.559: BGP(0): 10.10.10.1 send unreachable 128.16.16.0/24 *Mar 1 02:52:11.559: BGP(0): 10.10.10.1 send UPDATE 128.16.16.0/24 -- unreachable *Mar 1 02:52:11.559: BGP(0): 10.10.10.1 1 updates enqueued (average=27, maximum=27) *Mar 1 02:52:11.559: BGP(0): 10.10.10.1 update run completed, afi 0, ran for 0ms, neighbor version 13, start version 14, throttled to 14
R102는 더 이상 128.16.16.0/24을 R101에 광고하지 않습니다.
R102# show ip bgp neighbors 10.10.10.1 advertised-routes BGP table version is 14, local router ID is 128.16.16.1 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 *> 130.130.0.0 0.0.0.0 0 32768 i *> 192.168.50.0 10.10.20.3 0 0 3 i !--- Note 128.16.16.0/24 is not advertised. R102# show ip bgp neighbors 10.10.10.1 BGP neighbor is 10.10.10.1, remote AS 1, external link BGP version 4, remote router ID 200.200.200.1 BGP state = Established, up for 03:01:32 Last read 00:00:31, hold time is 180, keepalive interval is 60 seconds Neighbor capabilities: !--- Output supressed. For address family: IPv4 Unicast BGP table version 14, neighbor version 14 Index 1, Offset 0, Mask 0x2 Condition-map NON-EXIST, Advertise-map ADVERTISE, status: Withdraw 1 accepted prefixes consume 36 bytes Prefix advertised 7, suppressed 0, withdrawn 5 Number of NLRIs in the update sent: max 1, min 0 !--- Output supressed.
참고: 실제 시나리오에서는 AS1과 AS3이 인터넷에 연결됩니다(글로벌 BGP). 따라서 네트워크 192.168.50.0/24은 AS3에서 AS1(R101) BGP 테이블로 전역 bgp 메시를 통해 전파될 수 있습니다. AS1은 접두사 192.168.50.0을 R102로 전파할 수 있습니다(AS1과 AS2 간의 정책 계약에 따라 다름). R101이 전역 BGP 메쉬에서 학습한 AS3 경로를 R102로 전파하는 경우 non-exist map에 추가 검사를 수행하지 않으면 조건부 광고가 실패할 수 있습니다.
조건부 광고가 실패하는 이유를 더 잘 이해하려면 이 시나리오를 고려하십시오. AS1은 192.168.50.0/24을 글로벌 bgp 메쉬에서 학습하고 192.168.50.0/24을 AS2(R102)에 알립니다. R102는 접두사 192.168.50.0/24을 R103으로 직접 피어링하는 것을 학습합니다(R102에서 R103 링크로 이동). R102와 R103 간의 직접 링크가 실패하면 접두사 192.168.50.0/24이 R102의 BGP 테이블에 더 이상 존재하지 않고 조건부 광고가 시작되고 접두사 128.16.16.0/24을 R101에 발표할 수 있습니다. 그러나 접두사 192.168.50.0/24이 R102 BGP 테이블(R1010에서 학습됨)에 계속 남아 있습니다. 존재하지 않는 맵의 접두사가 R102 BGP 테이블에 남아 있기 때문에 조건부 광고가 중단됩니다. 조건부 광고를 시작할 수 있도록 접두사 192.168.50.0/24을 AS3(R102-R103)에 직접 연결에서만 학습하도록 하려면 직접 연결에서 학습한 접두사 192.168.50.0/24의 AS_PATH와 일치하는 match as_path 문을 non-exist 맵 아래에 추가합니다(이 경우에는 AS 3). 이 경우 정규식은 ^3입니다. 정규식에 대한 자세한 내용은 BGP에서 정규식 사용을 참조하십시오. as-path만 매칭할 수 없으며 접두사와 매칭할 수 없습니다. match as-path는 일치하는 접두사에 대한 일치 기준만 보완할 수 있습니다. 즉, 특정 AS #의 접두사가 없는 경우 일부 접두사를 인접 디바이스에 알릴 수 없습니다.
R102의 새로운 구성은 다음과 같습니다. 추가는 굵게 표시되어 있습니다.
R101 |
---|
hostname R102 ! interface Loopback0 ip address 128.16.16.1 255.255.255.0 ! interface Serial8/0 ip address 10.10.10.2 255.255.255.0 ! interface Serial9/0 ip address 10.10.20.2 255.255.255.0 ! router bgp 2 bgp log-neighbor-changes network 128.16.16.0 mask 255.255.255.0 network 130.130.0.0 neighbor 10.10.10.1 remote-as 1 neighbor 10.10.10.1 advertise-map ADVERTISE non-exist-map NON-EXIST neighbor 10.10.20.3 remote-as 3 ! ip route 130.130.0.0 255.255.0.0 Null0 ! ip as-path access-list 1 permit ^3 ! access-list 60 permit 128.16.16.0 0.0.0.255 access-list 65 permit 192.168.50.0 0.0.0.255 ! route-map NON-EXIST permit 10 match ip address 65 match as-path 1 ! route-map ADVERTISE permit 10 match ip address 60 ! |
BGP 및 조건부 알림과 관련된 알려진 버그 몇 가지가 있습니다. 자세한 내용은 버그 툴킷에서 버그 CSCdp18563(등록된 고객만 해당) 및 CSCdp20320(등록된 고객만 해당)을 참조하십시오.
개정 | 게시 날짜 | 의견 |
---|---|---|
1.0 |
10-Aug-2005 |
최초 릴리스 |