귀하의 경험을 개선할 수 있도록 도와주십시오.

귀하의 의견을 알려주십시오.

2분이 소요되는 설문 조사에 시간을 내주시겠습니까?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
BGP 사용자 가이드
Table of Contents Expand all
list Table of Contents

이 기계 번역이 도움이 되었습니까?

starstarstarstarstar
Go to English page
면책 조항:

이 페이지는 타사 기계 번역 소프트웨어를 사용해 번역됩니다. 주니퍼 네트웍스에서는 우수한 품질의 번역을 제공하기 위한 합리적인 수준의 노력을 기울이지만 해당 컨텐츠의 정확성을 보장할 수 없습니다. 본 번역에 포함된 정보의 정확성과 관련해 의문이 있는 경우 영문 버전을 참조하시기 바랍니다. 다운로드 가능한 PDF는 영어로만 제공됩니다.

BGP 커뮤니티에 대한 라우팅 정책

date_range 19-Jan-25

BGP 커뮤니티, 확장 커뮤니티 및 대규모 커뮤니티를 라우팅 정책 일치 조건으로 이해

BGP 커뮤니티는 공통 속성을 공유하는 대상 그룹입니다. 커뮤니티 정보는 BGP 업데이트 메시지에 경로 속성으로 포함됩니다. 이 정보는 커뮤니티 구성원을 식별하고 각 구성원에 대해 자세히 설명할 필요 없이 그룹에서 작업을 수행할 수 있도록 합니다. 커뮤니티 및 확장된 커뮤니티 속성을 사용하여 수락, 거부, 선호 또는 재배포와 같은 라우팅 결정을 트리거할 수 있습니다.

구성(정적, 집계 또는 생성된 경로의 경우) 또는 가져오기 라우팅 정책을 통해 비 BGP 경로에 커뮤니티 태그를 할당할 수 있습니다. 그런 다음 BGP가 경로를 내보낼 때 이러한 태그를 일치시킬 수 있습니다.

커뮤니티 값은 두 개의 주요 섹션으로 나뉘는 32비트 필드입니다. 값의 처음 16비트는 커뮤니티를 시작한 네트워크의 AS 번호를 인코딩하고, 마지막 16비트는 AS에서 할당한 고유 번호를 전달합니다. 이 시스템은 인터넷의 각 AS에 대해 전역적으로 고유한 커뮤니티 값 집합을 보장하려고 시도합니다. Junos OS는 의 표기법 as-number:community-value을 사용하며, 여기서 각 값은 십진수입니다. 0 및 65,535의 AS 값은 예약되어 있으며, 해당 AS 번호 내의 모든 커뮤니티 값도 예약되어 있습니다. 각 커뮤니티 또는 커뮤니티 집합에는 구성 계층 내에서 [edit policy-options] 이름이 지정됩니다. 커뮤니티의 이름은 라우팅 디바이스에 커뮤니티를 고유하게 식별하고 경로를 분류하는 방법으로 사용됩니다. 예를 들어 커뮤니티 값이 64510:1111인 경로는 라는 커뮤니티 AS64510-routes에 속할 수 있습니다. 커뮤니티 이름은 라우팅 정책 내에서 일치 기준 또는 작업으로 사용되기도 합니다. 커뮤니티를 만들기 위한 명령 구문은 다음과 같습니다. 정책 옵션 community name members [community-ids]. community-ids 는 단일 커뮤니티 가치 또는 여러 커뮤니티 가치입니다. 커뮤니티 이름에 두 개 이상의 값이 할당되면 라우팅 디바이스는 이를 커뮤니티 값의 논리적 AND로 해석합니다. 즉, 경로는 커뮤니티 이름을 할당받기 전에 구성된 모든 값을 가져야 합니다.

일반 커뮤니티 속성은 4개의 옥텟입니다. VPN과 같은 네트워킹 향상 기능에는 커뮤니티와 같은 속성으로 충족할 수 있는 기능 요구 사항이 있습니다. 그러나 4-옥텟 커뮤니티 값은 VPN 요구 사항을 수용할 만큼 충분한 확장과 유연성을 제공하지 않습니다. 이것은 확장된 커뮤니티의 창출로 이어집니다. 확장 커뮤니티는 두 개의 주요 섹션으로 나뉘는 8옥텟 값입니다. 커뮤니티의 처음 2개 옥텟은 유형 필드를 인코딩하고 마지막 6개 옥텟은 유형 필드에서 정의한 형식으로 고유한 데이터 세트를 전달합니다. 확장된 커뮤니티는 커뮤니티를 그룹화하거나 분류할 수 있는 더 넓은 범위를 제공합니다.

BGP 확장 커뮤니티 속성 형식에는 세 가지 필드가 있습니다. type:administrator:assigned-number. 라우팅 디바이스는 단어 target 또는 origin 유형 필드를 나타낼 것으로 예상합니다. 관리자 필드는 AS 또는 IPv4 주소에 10진수를 사용하는 반면, 할당된 번호 필드에는 필드 크기(2옥텟의 경우 65,535, 4옥텟의 경우 4,294,967,295)보다 크지 않은 십진수가 필요합니다.

표준 및 확장 커뮤니티 속성에 대한 커뮤니티 ID를 지정할 때 UNIX 스타일 정규 표현식을 사용할 수 있습니다. 유일한 예외는 확장 커뮤니티 속성에 대한 정규식을 지원하지 않는 VPN 가져오기 정책(vrf-import)입니다.

일반 BGP 커뮤니티 속성은 16비트 값으로 분할된 하나 이상의 4바이트 값 집합으로 구성된 가변 길이 속성입니다. 최상위 단어는 AS 번호로 해석되며, 최하위 단어는 AS 운영자가 할당한 로컬 정의 값입니다. 4바이트 ASN을 채택한 이후 4바이트 BGP 일반 커뮤니티 및 6바이트 BGP 확장 커뮤니티는 더 이상 BGP 커뮤니티 속성을 지원할 수 없습니다. 운영자는 BGP 커뮤니티의 로컬 부분에 AS 번호를 인코딩하는 경우가 많으며, 이는 때때로 커뮤니티 형식이 ASN:ASN임을 의미합니다. 4바이트 ASN을 사용하면 인코딩하려면 8바이트가 필요합니다. BGP 확장 커뮤니티에서는 4바이트 AS를 전역 관리자 필드로 인코딩할 수 있지만 로컬 관리자 필드에는 2바이트의 사용 가능한 공간만 있습니다. 따라서 6바이트 확장 커뮤니티 속성도 적합하지 않습니다. 이를 극복하기 위해 Junos OS는 전역 관리자로서 자치 시스템 번호를 인코딩하기 위해 가장 중요한 4바이트 값을 제공하는 12바이트 BGP 대규모 커뮤니티와 RFC 8092에 정의된 로컬 값을 인코딩하기 위해 나머지 2개의 4바이트 할당 번호를 제공하는 선택적 전이적 경로 속성을 구성할 수 있도록 허용합니다. 및 [edit routing-options static route ip-address community] 계층 수준에서 BGP 대규모 커뮤니티를 [edit policy-options community community-name members] 구성할 수 있습니다. BGP 대규모 커뮤니티 속성 형식에는 4개의 필드가 있습니다. large:global administrator:assigned number:assigned number.

BGP IPv6 유니캐스트 주소별 확장 커뮤니티는 20바이트 값 집합으로 인코딩됩니다. 20바이트 값은 다음 형식으로 해석됩니다.

  • 최상위 2바이트는 유형 및 하위 유형 값(높은 값(최상위 바이트) 및 낮은 값(두 번째로 중요한 바이트))을 인코딩합니다.

  • 다음 16바이트는 IPv6 유니캐스트 주소를 인코딩합니다. IETF RFC의 전역 관리자입니다.

  • 마지막 2바이트는 운영자가 정의한 로컬 값을 인코딩합니다. IETF RFC의 로컬 관리자입니다.

IPv6 유니캐스트 주소별 BGP 확장 커뮤니티 속성은 키워드 ipv6-target, ipv6-origin, 또는 ipv6-extended IPv6 및 로컬 관리자가 <, > 및 :로 구분되어 뒤에 표시됩니다.

주:

BGP 대규모 커뮤니티 속성 값의 길이는 0이 아닌 12의 배수여야 합니다.

예: 특정 Community 태그를 포함하는 BGP 경로를 IS-IS로 재배포하도록 라우팅 정책 구성

이 예는 커뮤니티에서 Edu BGP 경로를 가져와 메트릭 63으로 IS-IS에 배치하는 정책을 정의합니다.

요구 사항

이 예를 구성하기 전에 디바이스 초기화를 제외한 특별한 구성은 필요하지 않습니다.

개요

그림 1 본 예제에서 사용되는 토폴로지를 나타냅니다.

그림 1: 특정 Community 태그가 있는 BGP 경로를 IS-IS로 재배포특정 Community 태그가 있는 BGP 경로를 IS-IS로 재배포

이 예에서 디바이스 A, 디바이스 B, 디바이스 C, 디바이스 D는 AS(Autonomous System) 1에 있으며 IS-IS를 실행하고 있습니다. 디바이스 D를 제외한 모든 AS 1 디바이스는 내부 BGP(IBGP)를 실행하고 있습니다.

디바이스 E는 AS 2에 있으며 디바이스 C와 외부 BGP(EBGP) 피어링 세션을 가지고 있습니다. 디바이스 E에는 10.2.0.0/16 및 10.3.0.0/16이라는 두 개의 정적 경로가 있습니다. 이러한 경로는 Edu 2:5 커뮤니티 속성으로 태그가 지정되며 EBGP를 통해 디바이스 C에 보급됩니다.

디바이스 C는 Edu 2:5 community 속성으로 태그가 지정된 BGP 경로를 수락하고, 경로를 IS-IS로 재배포하며, 이러한 경로에 IS-IS 메트릭 63을 적용합니다.

CLI 빠른 구성은(는) 그림 1 내 모든 디바이스의 구성을 보여줍니다. 이 섹션에서는 #d206e65__d206e386 디바이스 C와 디바이스 E의 단계를 설명합니다.

구성

절차

CLI 빠른 구성

이 예를 빠르게 구성하려면, 아래 명령을 복사하여 텍스트 파일로 붙여 넣은 다음 모든 라인브레이크를 제거하고, 네트워크 구성을 일치하는 데 필요한 세부 사항을 바꾸고 [edit] 계층 수준에서 명령을 CLI로 복사해 붙여 넣습니다.

디바이스 A

content_copy zoom_out_map
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.5/30
set interfaces fe-1/2/0 unit 0 family iso
set interfaces lo0 unit 0 family inet address 192.168.0.1/32
set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0001.00
set protocols bgp group int type internal
set protocols bgp group int local-address 192.168.0.1
set protocols bgp group int neighbor 192.168.0.2
set protocols bgp group int neighbor 192.168.0.3
set protocols isis interface fe-1/2/0.0 level 1 disable
set protocols isis interface lo0.0
set routing-options router-id 192.168.0.1
set routing-options autonomous-system 1

디바이스 B

content_copy zoom_out_map
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.6/30
set interfaces fe-1/2/0 unit 0 family iso
set interfaces fe-1/2/1 unit 0 family inet address 10.0.0.9/30
set interfaces fe-1/2/1 unit 0 family iso
set interfaces lo0 unit 0 family inet address 192.168.0.2/32
set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0002.00
set protocols bgp group int type internal
set protocols bgp group int local-address 192.168.0.2
set protocols bgp group int neighbor 192.168.0.1
set protocols bgp group int neighbor 192.168.0.3
set protocols isis interface fe-1/2/0.0 level 1 disable
set protocols isis interface fe-1/2/1.0 level 1 disable
set protocols isis interface lo0.0
set routing-options router-id 192.168.0.2
set routing-options autonomous-system 1

디바이스 C

content_copy zoom_out_map
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.10/30
set interfaces fe-1/2/0 unit 0 family iso
set interfaces fe-1/2/1 unit 0 family inet address 10.0.0.13/30
set interfaces fe-1/2/1 unit 0 family iso
set interfaces fe-1/2/2 unit 0 family inet address 10.0.0.25/30
set interfaces fe-1/2/2 unit 0 family iso
set interfaces lo0 unit 0 family inet address 192.168.0.3/32
set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0003.00
set protocols bgp group int type internal
set protocols bgp group int local-address 192.168.0.3
set protocols bgp group int neighbor 192.168.0.1
set protocols bgp group int neighbor 192.168.0.2
set protocols bgp group external-peers type external
set protocols bgp group external-peers export send-isis-and-direct
set protocols bgp group external-peers peer-as 2
set protocols bgp group external-peers neighbor 10.0.0.26
set protocols isis export Edu-to-isis
set protocols isis interface fe-1/2/0.0 level 1 disable
set protocols isis interface fe-1/2/1.0 level 1 disable
set protocols isis interface fe-1/2/2.0 level 1 disable
set protocols isis interface fe-1/2/2.0 level 2 passive
set protocols isis interface lo0.0
set policy-options policy-statement Edu-to-isis term 1 from protocol bgp
set policy-options policy-statement Edu-to-isis term 1 from community Edu
set policy-options policy-statement Edu-to-isis term 1 then metric 63
set policy-options policy-statement Edu-to-isis term 1 then accept
set policy-options policy-statement send-isis-and-direct term 1 from protocol isis
set policy-options policy-statement send-isis-and-direct term 1 from protocol direct
set policy-options policy-statement send-isis-and-direct term 1 from route-filter 10.0.0.0/16 orlonger
set policy-options policy-statement send-isis-and-direct term 1 from route-filter 192.168.0.0/16 orlonger
set policy-options policy-statement send-isis-and-direct term 1 then accept
set policy-options community Edu members 2:5
set routing-options router-id 192.168.0.3
set routing-options autonomous-system 1

디바이스 D

content_copy zoom_out_map
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.14/30
set interfaces fe-1/2/0 unit 0 family iso
set interfaces lo0 unit 0 family inet address 192.168.0.4/32
set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0004.00
set protocols isis interface fe-1/2/0.0 level 1 disable
set protocols isis interface lo0.0
set routing-options router-id 192.168.0.4
set routing-options autonomous-system 1

디바이스 E

content_copy zoom_out_map
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.26/30
set interfaces lo0 unit 7 family inet address 192.168.0.5/32 primary
set interfaces lo0 unit 7 family inet address 10.2.0.1/32
set interfaces lo0 unit 7 family inet address 10.3.0.1/32
set protocols bgp group external-peers type external
set protocols bgp group external-peers export statics
set protocols bgp group external-peers peer-as 1
set protocols bgp group external-peers neighbor 10.0.0.25
set policy-options policy-statement statics from protocol static
set policy-options policy-statement statics then community add Edu
set policy-options policy-statement statics then accept
set policy-options community Edu members 2:5
set routing-options static route 10.2.0.0/16 reject
set routing-options static route 10.2.0.0/16 install
set routing-options static route 10.3.0.0/16 reject
set routing-options static route 10.3.0.0/16 install
set routing-options router-id 192.168.0.5
set routing-options autonomous-system 2
단계별 절차

다음 예는 구성 계층에서 다양한 수준의 탐색이 필요합니다. CLI 탐색에 관한 정보는 CLI 사용자 가이드에서 구성 모드에서 CLI 편집기 사용을 참조하십시오.

디바이스 E 구성:

  1. 인터페이스를 구성합니다.

    content_copy zoom_out_map
    [edit interfaces]
    user@E# set fe-1/2/0 unit 0 family inet address 10.0.0.26/30
    user@E# set lo0 unit 7 family inet address 192.168.0.5/32 primary
    user@E# set lo0 unit 7 family inet address 10.2.0.1/32
    user@E# set lo0 unit 7 family inet address 10.3.0.1/32
    
  2. statics 정적 경로에 커뮤니티 속성을 추가하는 Edu 정책을 구성합니다.

    content_copy zoom_out_map
    [edit policy-options]
    user@E# set policy-statement statics from protocol static
    user@E# set policy-statement statics then community add Edu
    user@E# set policy-statement statics then accept
    user@E# set community Edu members 2:5
    
  3. EBGP를 statics 구성하고 정책을 적용합니다.

    content_copy zoom_out_map
    [edit protocols bgp group external-peers]
    user@E# set type external
    user@E# set export statics
    user@E# set peer-as 1
    user@E# set protocols bgp group external-peers neighbor 10.0.0.25
    
  4. 고정 경로를 구성합니다.

    content_copy zoom_out_map
    [edit routing-options static]
    user@E# set route 10.2.0.0/16 reject
    user@E# set route 10.2.0.0/16 install
    user@E# set route 10.3.0.0/16 reject
    user@E# set route 10.3.0.0/16 install
    
  5. 라우터 ID 및 AS 번호를 구성합니다.

    content_copy zoom_out_map
    [edit routing-options]
    user@E# set router-id 192.168.0.5
    user@E# set autonomous-system 2
    
단계별 절차

다음 예는 구성 계층에서 다양한 수준의 탐색이 필요합니다. CLI 탐색에 관한 정보는 CLI 사용자 가이드에서 구성 모드에서 CLI 편집기 사용을 참조하십시오.

디바이스 C 구성:

  1. 인터페이스를 구성합니다.

    content_copy zoom_out_map
    [edit interfaces]
    user@C# set fe-1/2/0 unit 0 family inet address 10.0.0.10/30
    user@C# set fe-1/2/0 unit 0 family iso
    user@C# set fe-1/2/1 unit 0 family inet address 10.0.0.13/30
    user@C# set fe-1/2/1 unit 0 family iso
    user@C# set fe-1/2/2 unit 0 family inet address 10.0.0.25/30
    user@C# set fe-1/2/2 unit 0 family iso
    user@C# set lo0 unit 0 family inet address 192.168.0.3/32
    user@C# set lo0 unit 0 family iso address 49.0002.0192.0168.0003.00
    
  2. IBGP를 구성합니다.

    content_copy zoom_out_map
    [edit protocols bgp group int]
    user@C# set type internal
    user@C# set local-address 192.168.0.3
    user@C# set neighbor 192.168.0.1
    user@C# set neighbor 192.168.0.2
    
  3. 디바이스 E에서 학습한 Edu 태그가 지정된 BGP 경로를 재배포하고 메트릭 63을 적용하는 Edu-to-isis 정책을 구성합니다.

    content_copy zoom_out_map
    [edit policy-options]
    user@C# set policy-statement Edu-to-isis term 1 from protocol bgp
    user@C# set policy-statement Edu-to-isis term 1 from community Edu
    user@C# set policy-statement Edu-to-isis term 1 then metric 63
    user@C# set policy-statement Edu-to-isis term 1 then accept
    user@C# set community Edu members 2:5
    
  4. 인터페이스에서 IS-IS를 활성화하고 Edu-to-isis 정책을 적용합니다.

    content_copy zoom_out_map
    [edit protocols isis]
    user@C# set export Edu-to-isis
    user@C# set interface fe-1/2/0.0 level 1 disable
    user@C# set interface fe-1/2/1.0 level 1 disable
    user@C# set interface fe-1/2/2.0 level 1 disable
    user@C# set interface fe-1/2/2.0 level 2 passive
    user@C# set interface lo0.0
    
  5. EBGP를 통해 디바이스 E에 경로를 재배포하는 send-isis-and-direct 정책을 구성합니다.

    이 정책이 없으면 디바이스 E는 AS 1의 네트워크에 연결할 수 없습니다.

    content_copy zoom_out_map
    [edit policy-options policy-statement send-isis-and-direct term 1]
    user@C# set from protocol isis
    user@C# set from protocol direct
    user@C# set from route-filter 10.0.0.0/16 orlonger
    user@C# set from route-filter 192.168.0.0/16 orlonger
    user@C# set then accept
    
  6. EBGP를 구성하고 send-isis-and-direct 정책을 적용합니다.

    content_copy zoom_out_map
    [edit protocols bgp group external-peers]
    user@C# set type external
    user@C# set export send-isis-and-direct
    user@C# set peer-as 2
    user@C# set neighbor 10.0.0.26
    
  7. 라우터 ID 및 AS(Autonomous System) 번호를 구성합니다.

    content_copy zoom_out_map
    [edit routing-options]
    user@C# set router-id 192.168.0.3
    user@C# set autonomous-system 1
    
결과

구성 모드에서 show interfaces, show protocols, show policy-optionsshow routing-options 명령을 입력하여 구성을 확인합니다. 출력 결과가 의도한 구성대로 표시되지 않으면 이 예의 지침을 반복하여 구성을 수정하십시오.

디바이스 E

content_copy zoom_out_map
user@E# show interfaces
fe-1/2/0 {
    unit 0 {
        family inet {
            address 10.0.0.26/30;
        }
    }
}
lo0 {
    unit 0 {
        family inet {
            address 192.168.0.5/32 {
                primary;
            }
            address 10.2.0.1/32;
            address 10.3.0.1/32;
        }
    }
}
content_copy zoom_out_map
user@E# show protocols
bgp {
    group external-peers {
        type external;
        export statics;
        peer-as 1;
        neighbor 10.0.0.25;
    }
}
content_copy zoom_out_map
user@E# show policy-options
policy-statement statics {
    from protocol static;
    then {
        community add Edu;
        accept;
    }
}
community Edu members 2:5;
content_copy zoom_out_map
user@E# show routing-options
static {
    route 10.2.0.0/16 {
        reject;
        install;
    }
    route 10.3.0.0/16 {
        reject;
        install;
    }
}
router-id 192.168.0.5;
autonomous-system 2;

디바이스 C

content_copy zoom_out_map
user@C# show interfaces
fe-1/2/0 {
    unit 0 {
        family inet {
            address 10.0.0.10/30;
        }
        family iso;
    }
}
fe-1/2/1 {
    unit 0 {
        family inet {
            address 10.0.0.13/30;
        }
        family iso;
    }
}
fe-1/2/2 {
    unit 0 {
        family inet {
            address 10.0.0.25/30;
        }
        family iso;
    }
}
lo0 {
    unit 0 {
        family inet {
            address 192.168.0.3/32;
        }
        family iso {
            address 49.0002.0192.0168.0003.00;
        }
    }
}
content_copy zoom_out_map
user@C# show protocols
bgp {
    group int {
        type internal;
        local-address 192.168.0.3;
        neighbor 192.168.0.1;
        neighbor 192.168.0.2;
    }
    group external-peers {
        type external;
        export send-isis-and-direct;
        peer-as 2;
        neighbor 10.0.0.26;
    }
}
isis {
    export Edu-to-isis;
    interface fe-1/2/0.0 {
        level 1 disable;
    }
    interface fe-1/2/1.0 {
        level 1 disable;
    }
    interface fe-1/2/2.0 {
        level 1 disable;
        level 2 passive;
    }
    interface lo0.0;
}
content_copy zoom_out_map
user@C# show policy-options
policy-statement Edu-to-isis {
    term 1 {
        from {
            protocol bgp;
            community Edu;
        }
        then {
            metric 63;
            accept;
        }
    }
}
policy-statement send-isis-and-direct {
    term 1 {
        from {
            protocol [ isis direct ];
            route-filter 10.0.0.0/16 orlonger;
            route-filter 192.168.0.0/16 orlonger;
        }
        then accept;
    }
}
community Edu members 2:5;
content_copy zoom_out_map
user@C# show routing-options
router-id 192.168.0.3;
autonomous-system 1;

디바이스 구성을 마쳤으면 구성 모드에서 commit을(를) 입력합니다.

검증

구성이 올바르게 작동하고 있는지 확인합니다.

IS-IS 이웃 확인

목적

디바이스 E의 BGP 경로가 AS 1의 IS-IS 네트워크에서 통신되는지 확인합니다.

작업

운영 모드에서 show route protocol isis 명령을 입력합니다.

content_copy zoom_out_map
user@D> show route protocol isis
inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.0.0.4/30        *[IS-IS/18] 22:30:53, metric 30
                    > to 10.0.0.13 via fe-1/2/0.0
10.0.0.8/30        *[IS-IS/18] 22:30:53, metric 20
                    > to 10.0.0.13 via fe-1/2/0.0
10.0.0.24/30       *[IS-IS/18] 03:31:21, metric 20
                    > to 10.0.0.13 via fe-1/2/0.0
10.2.0.0/16        *[IS-IS/165] 02:36:31, metric 73
                    > to 10.0.0.13 via fe-1/2/0.0
10.3.0.0/16        *[IS-IS/165] 02:36:31, metric 73
                    > to 10.0.0.13 via fe-1/2/0.0
192.168.0.1/32     *[IS-IS/18] 03:40:28, metric 30
                    > to 10.0.0.13 via fe-1/2/0.0
192.168.0.2/32     *[IS-IS/18] 22:30:53, metric 20
                    > to 10.0.0.13 via fe-1/2/0.0
192.168.0.3/32     *[IS-IS/18] 22:30:53, metric 10
                    > to 10.0.0.13 via fe-1/2/0.0

iso.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
의미

예상대로 10.2.0.0/16 및 10.3.0.0/16 경로는 메트릭 73의 IS-IS 외부 경로로 디바이스 D의 라우팅 테이블에 있습니다. 디바이스 C가 메트릭에 63을 추가하지 않은 경우 디바이스 D는 이러한 경로에 대한 메트릭 10을 갖게 됩니다.

예: BGP 커뮤니티를 제거하는 라우팅 정책 구성

이 예는 BGP 경로를 수락하지만 경로에서 BGP 커뮤니티를 제거하는 정책을 만드는 방법을 보여줍니다.

요구 사항

이 예제를 구성하기 전에 디바이스 초기화 이외의 특별한 구성은 필요하지 않습니다.

개요

이 예는 외부 BGP(EBGP) 연결이 있는 두 라우팅 디바이스를 보여줍니다. 디바이스 R2는 BGP 세션을 사용하여 디바이스 R1에 2개의 정적 경로를 전송합니다. 디바이스 R1에서 가져오기 정책은 모든 BGP 커뮤니티가 경로에서 제거되어야 한다고 지정합니다.

기본적으로 EBGP 피어에 커뮤니티가 구성되면 커뮤니티가 전송되고 수락됩니다. 이웃으로부터 받은 커뮤니티의 수락을 억제하려면 모든 커뮤니티 또는 지정된 커뮤니티 집합을 제거할 수 있습니다. 정책의 결과가 빈 커뮤니티 집합인 경우 커뮤니티 속성은 포함되지 않습니다. 모든 커뮤니티를 제거하려면 먼저 와일드카드 커뮤니티 집합을 정의합니다(여기서 커뮤니티 이름은 wild).

content_copy zoom_out_map
[edit policy-options]
community wild members "* : *";

그런 다음 라우팅 정책 문에서 작업을 지정합니다.community delete

content_copy zoom_out_map
[edit policy-options]
policy-statement policy-name {
    term term-name {
        then community delete wild;
    }
}

AS(Autonomous System)에서 특정 커뮤니티를 억제하려면 커뮤니티를 로 community wild members "*:community-value"정의합니다.

토폴로지

그림 2은 샘플 네트워크를 표시합니다.

그림 2: 커뮤니티를 제거하는 BGP 정책커뮤니티를 제거하는 BGP 정책

구성

CLI 빠른 구성

이 예를 빠르게 구성하려면, 아래 명령을 복사하여 텍스트 파일로 붙여 넣은 다음 모든 라인브레이크를 제거하고, 네트워크 구성을 일치하는 데 필요한 세부 사항을 바꾸고 [edit] 계층 수준에서 명령을 CLI로 복사해 붙여 넣습니다.

디바이스 R1

content_copy zoom_out_map
set interfaces fe-1/1/0 unit 0 description to-R2
set interfaces fe-1/1/0 unit 0 family inet address 10.0.0.1/30
set interfaces lo0 unit 0 family inet address 192.168.0.1/32
set protocols bgp group external-peers type external
set protocols bgp group external-peers peer-as 2
set protocols bgp group external-peers neighbor 10.0.0.2 import remove-communities
set policy-options policy-statement remove-communities term 1 from protocol bgp
set policy-options policy-statement remove-communities term 1 then community delete wild
set policy-options policy-statement remove-communities term 1 then accept
set policy-options policy-statement remove-communities term 2 then reject
set policy-options community wild members *:*
set routing-options router-id 192.168.0.1
set routing-options autonomous-system 1

디바이스 R2

content_copy zoom_out_map
set interfaces fe-1/1/0 unit 0 description to-R1
set interfaces fe-1/1/0 unit 0 family inet address 10.0.0.2/30
set interfaces lo0 unit 0 family inet address 192.168.0.2/32
set protocols bgp group external-peers type external
set protocols bgp group external-peers export statics
set protocols bgp group external-peers peer-as 1
set protocols bgp group external-peers neighbor 10.0.0.1
set policy-options policy-statement statics from protocol static
set policy-options policy-statement statics then community add 1
set policy-options policy-statement statics then accept
set policy-options community 1 members 2:1
set policy-options community 1 members 2:2
set policy-options community 1 members 2:3
set policy-options community 1 members 2:4
set policy-options community 1 members 2:5
set policy-options community 1 members 2:6
set policy-options community 1 members 2:7
set policy-options community 1 members 2:8
set policy-options community 1 members 2:9
set policy-options community 1 members 2:10
set routing-options static route 10.2.0.0/16 reject
set routing-options static route 10.2.0.0/16 install
set routing-options static route 10.3.0.0/16 reject
set routing-options static route 10.3.0.0/16 install
set routing-options router-id 192.168.0.3
set routing-options autonomous-system 2

절차

단계별 절차

다음 예는 구성 계층에서 다양한 수준의 탐색이 필요합니다. CLI 탐색 관련 정보는 Junos OS CLI 사용자 가이드구성 모드에서의 CLI 편집기 사용을 참조하십시오.

디바이스 R1 구성

  1. 인터페이스를 구성합니다.

    content_copy zoom_out_map
    [edit interfaces]
    user@R1# set fe-1/1/0 unit 0 description to-R2
    user@R1# set fe-1/1/0 unit 0 family inet address 10.0.0.1/30
    user@R1# set lo0 unit 0 family inet address 192.168.0.1/32
    
  2. BGP를 구성합니다.

    디바이스 R2와의 BGP 피어링 세션에 가져오기 정책을 적용합니다.

    content_copy zoom_out_map
    [edit protocols bgp group external-peers]
    user@R1# set type external
    user@R1# set peer-as 2
    user@R1# set neighbor 10.0.0.2 import remove-communities
    
  3. 커뮤니티를 삭제하는 라우팅 정책을 구성합니다.

    content_copy zoom_out_map
    [edit policy-options policy-statement remove-communities]
    user@R1# set term 1 from protocol bgp
    user@R1# set term 1 then community delete wild
    user@R1# set term 1 then accept
    user@R1# set term 2 then reject
    
  4. AS(Autonomous System) 번호와 라우터 ID를 구성합니다.

    content_copy zoom_out_map
    [edit routing-options ]
    user@R1# set router-id 192.168.0.1
    user@R1# set autonomous-system 1
    
단계별 절차

다음 예는 구성 계층에서 다양한 수준의 탐색이 필요합니다. CLI 탐색 관련 정보는 Junos OS CLI 사용자 가이드구성 모드에서의 CLI 편집기 사용을 참조하십시오.

디바이스 R2 구성:

  1. 인터페이스를 구성합니다.

    content_copy zoom_out_map
    [edit interfaces]
    user@R2# set fe-1/1/0 unit 0 description to-R1
    user@R2# set fe-1/1/0 unit 0 family inet address 10.0.0.2/30
    user@R2# set lo0 unit 0 family inet address 192.168.0.2/32
    
  2. 라우터 ID 및 AS(Autonomous System) 번호를 구성합니다.

    content_copy zoom_out_map
    [edit routing-options]
    user@R2# set router-id 192.168.0.3
    user@R2# set autonomous-system 2
    
  3. BGP를 구성합니다.

    content_copy zoom_out_map
    [edit  protocols bgp group external-peers]
    user@R2# set type external
    user@R2# set peer-as 1
    user@R2# set neighbor 10.0.0.1
    
  4. 여러 커뮤니티를 구성하거나 여러 구성원이 있는 단일 커뮤니티를 구성합니다.

    content_copy zoom_out_map
    [edit policy-options community 1]
    user@R2# set members 2:1
    user@R2# set members 2:2
    user@R2# set members 2:3
    user@R2# set members 2:4
    user@R2# set members 2:5
    user@R2# set members 2:6
    user@R2# set members 2:7
    user@R2# set members 2:8
    user@R2# set members 2:9
    user@R2# set members 2:10
    
  5. 고정 경로를 구성합니다.

    content_copy zoom_out_map
    [edit routing-options static]
    user@R2# set route 10.2.0.0/16 reject
    user@R2# set route 10.2.0.0/16 install
    user@R2# set route 10.3.0.0/16 reject
    user@R2# set route 10.3.0.0/16 install
    
  6. 정적 경로를 BGP에 보급하고 BGP 커뮤니티를 경로에 추가하는 라우팅 정책을 구성합니다.

    content_copy zoom_out_map
    [edit policy-options policy-statement statics]
    user@R2# set from protocol static
    user@R2# set then community add 1
    user@R2# set then accept
    
  7. 내보내기 정책을 적용합니다.

    content_copy zoom_out_map
    [edit protocols bgp group external-peers]
    user@R2# set export statics
    
결과

구성 모드에서 show interfaces, show protocols, show policy-optionsshow routing-options 명령을 입력하여 구성을 확인합니다. 출력 결과가 의도한 구성대로 표시되지 않으면 이 예의 지침을 반복하여 구성을 수정하십시오.

디바이스 R1

content_copy zoom_out_map
user@R1# show interfaces
fe-1/1/0 {
    unit 0{
        description to-R2;
        family inet {
            address 10.0.0.1/30;
        }
    }
}
lo0 {
    unit 0 {
        family inet {
            address 192.168.0.1/32;
        }
    }
}
content_copy zoom_out_map
user@R1# show protocols
bgp {
    group external-peers {
        type external;
        peer-as 2;
        neighbor 10.0.0.2 {
            import remove-communities;
        }
    }
}
content_copy zoom_out_map
user@R1# show policy-options
policy-statement remove-communities {
    term 1 {
        from protocol bgp;
        then {
            community delete wild;
            accept;
        }
    }
    term 2 {
        then reject;
    }
}
community wild members *:*;
content_copy zoom_out_map
user@R1# show routing-options
router-id 192.168.0.1;
autonomous-system 1;

디바이스 R2

content_copy zoom_out_map
user@R2# show interfaces
fe-1/1/0 {
    unit 0 {
        description to-R1;
        family inet {
            address 10.0.0.2/30;
        }
    }
}
lo0 {
    unit 0 {
        family inet {
            address 192.168.0.2/32;
        }
    }
}
content_copy zoom_out_map
user@R2# show protocols
bgp {
    group external-peers {
        type external;
        export statics;
        peer-as 1;
        neighbor 10.0.0.1;
    }
}
content_copy zoom_out_map
user@R2# show policy-options
policy-statement statics {
    from protocol static;
    then {
        community add 1;
        accept;
    }
}
community 1 members [ 2:1 2:2 2:3 2:4 2:5 2:6 2:7 2:8 2:9 2:10 ];
content_copy zoom_out_map
user@R2# show routing-options
static {
    route 10.2.0.0/16 {
        reject;
        install;
    }
    route 10.3.0.0/16 {
        reject;
        install;
    }
}
router-id 192.168.0.3;
autonomous-system 2;

디바이스 구성이 완료되면 구성모드에서 commit을(를) 입력합니다.

검증

구성이 올바르게 작동하고 있는지 확인합니다.

BGP 경로 확인

목적

디바이스 R1의 라우팅 테이블에 BGP 커뮤니티가 포함되어 있지 않은지 확인합니다.

작업
  1. 디바이스 R1에서 명령을 실행합니다 show route protocols bgp extensive .

    content_copy zoom_out_map
    user@R1> show route protocols bgp extensive
    
    inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
    10.2.0.0/16 (1 entry, 1 announced)
    TSI:
    KRT in-kernel 10.2.0.0/16 -> {10.0.0.2}
            *BGP    Preference: 170/-101
                    Next hop type: Router, Next hop index: 671
                    Address: 0x9458270
                    Next-hop reference count: 4
                    Source: 10.0.0.2
                    Next hop: 10.0.0.2 via lt-1/1/0.5, selected
                    Session Id: 0x100001
                    State: <Active Ext>
                    Local AS:     1 Peer AS:     2
                    Age: 20:39:01 
                    Validation State: unverified 
                    Task: BGP_2.10.0.0.2+179
                    Announcement bits (1): 0-KRT 
                    AS path: 2 I
                    Accepted
                    Localpref: 100
                    Router ID: 192.168.0.3
    
    10.3.0.0/16 (1 entry, 1 announced)
    TSI:
    KRT in-kernel 10.3.0.0/16 -> {10.0.0.2}
            *BGP    Preference: 170/-101
                    Next hop type: Router, Next hop index: 671
                    Address: 0x9458270
                    Next-hop reference count: 4
                    Source: 10.0.0.2
                    Next hop: 10.0.0.2 via lt-1/1/0.5, selected
                    Session Id: 0x100001
                    State: <Active Ext>
                    Local AS:     1 Peer AS:     2
                    Age: 20:39:01 
                    Validation State: unverified 
                    Task: BGP_2.10.0.0.2+179
                    Announcement bits (1): 0-KRT 
                    AS path: 2 I
                    Accepted
                    Localpref: 100
                    Router ID: 192.168.0.3
  2. 디바이스 R1에서 가져오기 정책의 구성을 비활성화 community remove 합니다.

    content_copy zoom_out_map
    [edit policy-options policy-statement remove-communities term 1]
    user@R1# deactivate then community delete wild
    user@R1# commit
    
  3. 디바이스 R1에서 명령을 실행하여 show route protocols bgp extensive 보급된 커뮤니티를 확인합니다.

    content_copy zoom_out_map
    user@R1> show route protocols bgp extensive
    inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
    10.2.0.0/16 (1 entry, 1 announced)
    TSI:
    KRT in-kernel 10.2.0.0/16 -> {10.0.0.2}
            *BGP    Preference: 170/-101
                    Next hop type: Router, Next hop index: 671
                    Address: 0x9458270
                    Next-hop reference count: 4
                    Source: 10.0.0.2
                    Next hop: 10.0.0.2 via lt-1/1/0.5, selected
                    Session Id: 0x100001
                    State: <Active Ext>
                    Local AS:     1 Peer AS:     2
                    Age: 20:40:53 
                    Validation State: unverified 
                    Task: BGP_2.10.0.0.2+179
                    Announcement bits (1): 0-KRT 
                    AS path: 2 I
                    Communities: 2:1 2:2 2:3 2:4 2:5 2:6 2:7 2:8 2:9 2:10
                    Accepted
                    Localpref: 100
                    Router ID: 192.168.0.3
    
    10.3.0.0/16 (1 entry, 1 announced)
    TSI:
    KRT in-kernel 10.3.0.0/16 -> {10.0.0.2}
            *BGP    Preference: 170/-101
                    Next hop type: Router, Next hop index: 671
                    Address: 0x9458270
                    Next-hop reference count: 4
                    Source: 10.0.0.2
                    Next hop: 10.0.0.2 via lt-1/1/0.5, selected
                    Session Id: 0x100001
                    State: <Active Ext>
                    Local AS:     1 Peer AS:     2
                    Age: 20:40:53 
                    Validation State: unverified 
                    Task: BGP_2.10.0.0.2+179
                    Announcement bits (1): 0-KRT 
                    AS path: 2 I
                    Communities: 2:1 2:2 2:3 2:4 2:5 2:6 2:7 2:8 2:9 2:10
                    Accepted
                    Localpref: 100
                    Router ID: 192.168.0.3
    
    
의미

출력은 디바이스 R1의 라우팅 테이블에서 디바이스 R2에서 전송된 BGP 경로에서 커뮤니티가 억제됨을 보여줍니다. 디바이스 R1의 community remove 가져오기 정책 설정이 비활성화되면 커뮤니티가 더 이상 억제되지 않습니다.

예: BGP 커뮤니티 수를 기반으로 라우팅 정책 구성

이 예는 BGP 커뮤니티 수를 기반으로 BGP 경로를 수락하는 정책을 생성하는 방법을 보여줍니다.

요구 사항

이 예제를 구성하기 전에 디바이스 초기화 이외의 특별한 구성은 필요하지 않습니다.

개요

이 예는 외부 BGP(EBGP) 연결이 있는 두 라우팅 디바이스를 보여줍니다. 디바이스 R2는 BGP 세션을 사용하여 디바이스 R1에 2개의 정적 경로를 전송합니다. 디바이스 R1에서 가져오기 정책은 BGP 수신 경로가 일치하는 것으로 간주될 커뮤니티를 최대 5개까지 포함할 수 있도록 지정합니다. 예를 들어, 경로에 세 개의 커뮤니티가 포함된 경우 일치하는 것으로 간주되어 허용됩니다. 경로에 6개 이상의 커뮤니티가 포함된 경우 일치하지 않는 경로로 간주되어 거부됩니다.

EBGP의 기본 정책은 모든 경로를 수락하는 것임을 기억해야 합니다. 일치하지 않는 경로가 거부되도록 하려면 정책 정의 끝에 작업을 포함해야 then reject 합니다.

토폴로지

그림 3은 샘플 네트워크를 표시합니다.

그림 3: 허용되는 커뮤니티 수에 제한이 있는 BGP 정책허용되는 커뮤니티 수에 제한이 있는 BGP 정책

구성

CLI 빠른 구성

이 예를 빠르게 구성하려면, 아래 명령을 복사하여 텍스트 파일로 붙여 넣은 다음 모든 라인브레이크를 제거하고, 네트워크 구성을 일치하는 데 필요한 세부 사항을 바꾸고 [edit] 계층 수준에서 명령을 CLI로 복사해 붙여 넣습니다.

디바이스 R1

content_copy zoom_out_map
set interfaces fe-1/1/0 unit 0 description to-R2
set interfaces fe-1/1/0 unit 0 family inet address 10.0.0.1/30
set interfaces lo0 unit 0 family inet address 192.168.0.1/32
set protocols bgp group external-peers type external
set protocols bgp group external-peers peer-as 2
set protocols bgp group external-peers neighbor 10.0.0.2 import import-communities
set policy-options policy-statement import-communities term 1 from protocol bgp
set policy-options policy-statement import-communities term 1 from community-count 5 orlower
set policy-options policy-statement import-communities term 1 then accept
set policy-options policy-statement import-communities term 2 then reject
set routing-options router-id 192.168.0.1
set routing-options autonomous-system 1

디바이스 R2

content_copy zoom_out_map
set interfaces fe-1/1/0 unit 0 description to-R1
set interfaces fe-1/1/0 unit 0 family inet address 10.0.0.2/30
set interfaces lo0 unit 0 family inet address 192.168.0.2/32
set protocols bgp group external-peers type external
set protocols bgp group external-peers export statics
set protocols bgp group external-peers peer-as 1
set protocols bgp group external-peers neighbor 10.0.0.1
set policy-options policy-statement statics from protocol static
set policy-options policy-statement statics then community add 1
set policy-options policy-statement statics then accept
set policy-options community 1 members 2:1
set policy-options community 1 members 2:2
set policy-options community 1 members 2:3
set policy-options community 1 members 2:4
set policy-options community 1 members 2:5
set policy-options community 1 members 2:6
set policy-options community 1 members 2:7
set policy-options community 1 members 2:8
set policy-options community 1 members 2:9
set policy-options community 1 members 2:10
set routing-options static route 10.2.0.0/16 reject
set routing-options static route 10.2.0.0/16 install
set routing-options static route 10.3.0.0/16 reject
set routing-options static route 10.3.0.0/16 install
set routing-options router-id 192.168.0.3
set routing-options autonomous-system 2

절차

단계별 절차

다음 예는 구성 계층에서 다양한 수준의 탐색이 필요합니다. CLI 탐색 관련 정보는 Junos OS CLI 사용자 가이드구성 모드에서의 CLI 편집기 사용을 참조하십시오.

디바이스 R1 구성

  1. 인터페이스를 구성합니다.

    content_copy zoom_out_map
    [edit interfaces]
    user@R1# set fe-1/1/0 unit 0 description to-R2
    user@R1# set fe-1/1/0 unit 0 family inet address 10.0.0.1/30
    user@R1# set lo0 unit 0 family inet address 192.168.0.1/32
    
  2. BGP를 구성합니다.

    디바이스 R2와의 BGP 피어링 세션에 가져오기 정책을 적용합니다.

    content_copy zoom_out_map
    [edit protocols bgp group external-peers]
    user@R1# set type external
    user@R1# set peer-as 2
    user@R1# set neighbor 10.0.0.2 import import-communities
    
  3. 직접 경로를 전송하는 라우팅 정책을 구성합니다.

    content_copy zoom_out_map
    [edit policy-options policy-statement import-communities]
    user@R1# set term 1 from protocol bgp
    user@R1# set term 1 from community-count 5 orlower
    user@R1# set term 1 then accept
    user@R1# set term 2 then reject
    
  4. AS(Autonomous System) 번호와 라우터 ID를 구성합니다.

    content_copy zoom_out_map
    [edit routing-options ]
    user@R1# set router-id 192.168.0.1
    user@R1# set autonomous-system 1
    
단계별 절차

다음 예는 구성 계층에서 다양한 수준의 탐색이 필요합니다. CLI 탐색 관련 정보는 Junos OS CLI 사용자 가이드구성 모드에서의 CLI 편집기 사용을 참조하십시오.

디바이스 R2 구성:

  1. 인터페이스를 구성합니다.

    content_copy zoom_out_map
    [edit interfaces]
    user@R2# set fe-1/1/0 unit 0 description to-R1
    user@R2# set fe-1/1/0 unit 0 family inet address 10.0.0.2/30
    user@R2# set lo0 unit 0 family inet address 192.168.0.2/32
    
  2. 라우터 ID 및 AS(Autonomous System) 번호를 구성합니다.

    content_copy zoom_out_map
    [edit routing-options]
    user@R2# set router-id 192.168.0.3
    user@R2# set autonomous-system 2
    
  3. BGP를 구성합니다.

    content_copy zoom_out_map
    [edit  protocols bgp group external-peers]
    user@R2# set type external
    user@R2# set peer-as 1
    user@R2# set neighbor 10.0.0.1
    
  4. 여러 커뮤니티를 구성하거나 여러 구성원이 있는 단일 커뮤니티를 구성합니다.

    content_copy zoom_out_map
    [edit policy-options community 1]
    user@R2# set members 2:1
    user@R2# set members 2:2
    user@R2# set members 2:3
    user@R2# set members 2:4
    user@R2# set members 2:5
    user@R2# set members 2:6
    user@R2# set members 2:7
    user@R2# set members 2:8
    user@R2# set members 2:9
    user@R2# set members 2:10
    
  5. 고정 경로를 구성합니다.

    content_copy zoom_out_map
    [edit routing-options static]
    user@R2# set route 10.2.0.0/16 reject
    user@R2# set route 10.2.0.0/16 install
    user@R2# set route 10.3.0.0/16 reject
    user@R2# set route 10.3.0.0/16 install
    
  6. 정적 경로를 BGP에 보급하고 BGP 커뮤니티를 경로에 추가하는 라우팅 정책을 구성합니다.

    content_copy zoom_out_map
    [edit policy-options policy-statement statics]
    user@R2# set from protocol static
    user@R2# set then community add 1
    user@R2# set then accept
    
  7. 내보내기 정책을 적용합니다.

    content_copy zoom_out_map
    [edit protocols bgp group external-peers]
    user@R2# set export statics
    
결과

구성 모드에서 show interfaces, show protocols, show policy-optionsshow routing-options 명령을 입력하여 구성을 확인합니다. 출력 결과가 의도한 구성대로 표시되지 않으면 이 예의 지침을 반복하여 구성을 수정하십시오.

디바이스 R1

content_copy zoom_out_map
user@R1# show interfaces
fe-1/1/0 {
    unit 0{
        description to-R2;
        family inet {
            address 10.0.0.1/30;
        }
    }
}
lo0 {
    unit 0 {
        family inet {
            address 192.168.0.1/32;
        }
    }
}
}
content_copy zoom_out_map
user@R1# show protocols
bgp {
    group external-peers {
        type external;
        peer-as 2;
        neighbor 10.0.0.2 {
            import import-communities;
        }
    }
}
content_copy zoom_out_map
user@R1# show policy-options
policy-statement import-communities {
    term 1 {
        from {
            protocol bgp;
            community-count 5 orlower;
        }
        then accept;
    }
    term 2 {
        then reject;
    }
}
content_copy zoom_out_map
user@R1# show routing-options
router-id 192.168.0.1;
autonomous-system 1;

디바이스 R2

content_copy zoom_out_map
user@R2# show interfaces
fe-1/1/0 {
    unit 0 {
        description to-R1;
        family inet {
            address 10.0.0.2/30;
        }
    }
}
lo0 {
    unit 0 {
        family inet {
            address 192.168.0.2/32;
        }
    }
}
content_copy zoom_out_map
user@R2# show protocols
bgp {
    group external-peers {
        type external;
        export statics;
        peer-as 1;
        neighbor 10.0.0.1;
    }
}
content_copy zoom_out_map
user@R2# show policy-options
policy-statement statics {
    from protocol static;
    then {
        community add 1;
        accept;
    }
}
community 1 members [ 2:1 2:2 2:3 2:4 2:5 2:6 2:7 2:8 2:9 2:10 ];
content_copy zoom_out_map
user@R2# show routing-options
static {
    route 10.2.0.0/16 {
        reject;
        install;
    }
    route 10.3.0.0/16 {
        reject;
        install;
    }
}
router-id 192.168.0.3;
autonomous-system 2;

디바이스 구성이 완료되면 구성모드에서 commit을(를) 입력합니다.

검증

구성이 올바르게 작동하고 있는지 확인합니다.

BGP 경로 확인

목적

디바이스 R1의 라우팅 테이블에 예상되는 BGP 경로가 포함되어 있는지 확인합니다.

작업
  1. 디바이스 R1에서 명령을 실행합니다 show route protocols bgp .

    content_copy zoom_out_map
    user@R1> show route protocols bgp
    
    inet.0: 5 destinations, 5 routes (3 active, 0 holddown, 2 hidden)
    
  2. 디바이스 R1에서 community-count 가져오기 정책의 구성을 변경합니다.

    content_copy zoom_out_map
    [edit policy-options policy-statement import-communities term 1]
    user@R1# set from community-count 5 orhigher
    user@R1# commit
    
  3. 디바이스 R1에서 명령을 실행합니다 show route protocols bgp .

    content_copy zoom_out_map
    user@R1> show route protocols bgp
    
    inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both
    
    10.2.0.0/16        *[BGP/170] 18:29:53, localpref 100
                          AS path: 2 I, validation-state: unverified
                        > to 10.0.0.2 via fe-1/1/0.0
    10.3.0.0/16        *[BGP/170] 18:29:53, localpref 100
                          AS path: 2 I, validation-state: unverified
                        > to 10.0.0.2 via fe-1/1/0.0
  4. 디바이스 R1에서 명령을 실행하여 show route protocols bgp extensive 보급된 커뮤니티를 확인합니다.

    content_copy zoom_out_map
    user@R1> show route protocols bgp extensive
    inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
    10.2.0.0/16 (1 entry, 1 announced)
    TSI:
    KRT in-kernel 10.2.0.0/16 -> {10.0.0.2}
            *BGP    Preference: 170/-101
                    Next hop type: Router, Next hop index: 671
                    Address: 0x9458270
                    Next-hop reference count: 4
                    Source: 10.0.0.2
                    Next hop: 10.0.0.2 via fe-1/1/0.0, selected
                    Session Id: 0x100001
                    State: <Active Ext>
                    Local AS:     1 Peer AS:     2
                    Age: 18:56:10 
                    Validation State: unverified 
                    Task: BGP_2.10.0.0.2+179
                    Announcement bits (1): 0-KRT 
                    AS path: 2 I
                    Communities: 2:1 2:2 2:3 2:4 2:5 2:6 2:7 2:8 2:9 2:10
                    Accepted
                    Localpref: 100
                    Router ID: 192.168.0.3
    
    10.3.0.0/16 (1 entry, 1 announced)
    TSI:
    KRT in-kernel 10.3.0.0/16 -> {10.0.0.2}
            *BGP    Preference: 170/-101
                    Next hop type: Router, Next hop index: 671
                    Address: 0x9458270
                    Next-hop reference count: 4
                    Source: 10.0.0.2
                    Next hop: 10.0.0.2 via fe-1/1/0.0, selected
                    Session Id: 0x100001
                    State: <Active Ext>
                    Local AS:     1 Peer AS:     2
                    Age: 18:56:10 
                    Validation State: unverified 
                    Task: BGP_2.10.0.0.2+179
                    Announcement bits (1): 0-KRT 
                    AS path: 2 I
                    Communities: 2:1 2:2 2:3 2:4 2:5 2:6 2:7 2:8 2:9 2:10
                    Accepted
                    Localpref: 100
                    Router ID: 192.168.0.3
    
    
의미

출력은 디바이스 R1의 라우팅 테이블에서 디바이스 R2에서 전송된 BGP 경로가 숨겨져 있음을 보여줍니다. 디바이스 R1의 community-count 가져오기 정책 설정이 수정되면 BGP 경로가 더 이상 숨겨지지 않습니다.

footer-navigation