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

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

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

close
keyboard_arrow_left
list Table of Contents
keyboard_arrow_right

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

starstarstarstarstar
Go to English page
면책 조항:

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

예: 라우팅 정책에서 확장 커뮤니티 구성

date_range 19-Jan-25

확장 커뮤니티는 대부분의 경우 일반 커뮤니티와 유사합니다. VPN(Virtual Private Network)과 같은 일부 네트워킹 구현은 4옥te 정규 커뮤니티 값이 충분한 확장과 유연성을 제공하지 않기 때문에 확장 커뮤니티를 사용합니다. 확장 커뮤니티는 두 개의 주요 섹션으로 나뉘어진 8옥텟 값입니다.

요구 사항

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

개요

이 예에서 디바이스 R1 및 디바이스 R2는 AS(Autonomous System) 64510의 OSPF neighbor입니다. 디바이스 R3은 디바이스 R1에 대한 외부 BGP(EBGP) 연결을 보유합니다. 디바이스 R2는 루프백 인터페이스(lo0)의 주소로 시뮬레이션된 172.16/16 주소 공간에 고객 네트워크를 보유합니다. 디바이스 R1에는 여러 172.16에 대한 정적 경로가 있습니다.x네트워크를 /24하고 이러한 경로에 정기적인 커뮤니티 가치를 연결합니다. 그런 다음 디바이스 R1은 내보내기 정책을 사용하여 디바이스 R3에 경로를 보급합니다. 디바이스 R3는 이러한 경로를 수신하고 가져오기 정책을 사용하여 확장된 커뮤니티 값을 경로에 추가합니다.

주:

지원되는 확장 커뮤니티 목록은

BGP 커뮤니티, 확장 커뮤니티 및 대규모 커뮤니티를 라우팅 정책 일치 조건으로 이해하기를 참조하십시오.

토폴로지

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

그림 1: 확장된 BGP 커뮤니티를 위한 토폴로지확장된 BGP 커뮤니티를 위한 토폴로지

CLI 빠른 구성은(는) 그림 1 내 모든 디바이스의 구성을 보여줍니다.

섹션 #configuration587__policy-extended-community-st은 디바이스 R3의 단계를 설명합니다.

구성

CLI 빠른 구성

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

디바이스 R1

content_copy zoom_out_map
set interfaces fe-1/2/0 unit 0 family inet address 10.0.0.1/30
set interfaces fe-1/2/3 unit 0 family inet address 10.0.0.14/30
set interfaces lo0 unit 0 family inet address 192.168.0.1/32 primary
set protocols bgp group ext type external
set protocols bgp group ext export send-static
set protocols bgp group ext peer-as 64511
set protocols bgp group ext neighbor 10.0.0.13
set protocols ospf area 0.0.0.0 interface fe-1/2/0.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set policy-options policy-statement send-static term 1 from protocol static
set policy-options policy-statement send-static term 1 then accept
set routing-options static route 172.16.1.0/24 next-hop 10.0.0.2
set routing-options static route 172.16.1.0/24 community 64510:1
set routing-options static route 172.16.2.0/24 next-hop 10.0.0.2
set routing-options static route 172.16.2.0/24 community 64510:2
set routing-options static route 172.16.3.0/24 next-hop 10.0.0.2
set routing-options static route 172.16.3.0/24 community 64510:3
set routing-options static route 172.16.4.0/24 next-hop 10.0.0.2
set routing-options static route 172.16.4.0/24 community 64510:4
set routing-options router-id 192.168.0.1
set routing-options autonomous-system 64510

디바이스 R2

content_copy zoom_out_map
set interfaces fe-1/2/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 interfaces lo0 unit 0 family inet address 172.16.1.1/32
set interfaces lo0 unit 0 family inet address 172.16.2.2/32
set interfaces lo0 unit 0 family inet address 172.16.3.3/32
set interfaces lo0 unit 0 family inet address 172.16.4.4/32
set protocols ospf area 0.0.0.0 interface fe-1/2/0.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set routing-options router-id 192.168.0.2
set routing-options autonomous-system 64510

디바이스 R3

content_copy zoom_out_map
set interfaces fe-1/2/3 unit 0 family inet address 10.0.0.13/30
set interfaces lo0 unit 0 family inet address 192.168.0.3/32
set protocols bgp group to-R1 type external
set protocols bgp group to-R1 import set-ext-comms
set protocols bgp group to-R1 peer-as 64510
set protocols bgp group to-R1 neighbor 10.0.0.14
set policy-options policy-statement set-ext-comms term route-1 from route-filter 172.16.1.0/24 exact
set policy-options policy-statement set-ext-comms term route-1 then community add target-as
set policy-options policy-statement set-ext-comms term route-1 then accept
set policy-options policy-statement set-ext-comms term route-2 from route-filter 172.16.2.0/24 exact
set policy-options policy-statement set-ext-comms term route-2 then community add target-ip
set policy-options policy-statement set-ext-comms term route-2 then accept
set policy-options policy-statement set-ext-comms term route-3 from route-filter 172.16.3.0/24 exact
set policy-options policy-statement set-ext-comms term route-3 then community add origin-as
set policy-options policy-statement set-ext-comms term route-3 then accept
set policy-options policy-statement set-ext-comms term route-4 from route-filter 172.16.4.0/24 exact
set policy-options policy-statement set-ext-comms term route-4 then community add origin-ip
set policy-options policy-statement set-ext-comms term route-4 then accept
set policy-options community origin-as members origin:64511:3
set policy-options community origin-ip members origin:172.16.7.7:4
set policy-options community target-as members target:64511:1
set policy-options community target-ip members target:172.16.7.7:2
set routing-options router-id 192.168.0.3
set routing-options autonomous-system 64511

절차

단계별 절차

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

디바이스 R3 구성:

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

    content_copy zoom_out_map
    [edit interfaces]
    user@R3# set fe-1/2/3 unit 0 family inet address 10.0.0.13/30
    user@R3# set lo0 unit 0 family inet address 192.168.0.3/32
    
  2. 디바이스 R1에 EBGP 연결을 구성합니다.

    content_copy zoom_out_map
    [edit protocols bgp group to-R1]
    user@R3# set type external
    user@R3# set import set-ext-comms
    user@R3# set peer-as 64510
    user@R3# set neighbor 10.0.0.14
    
  3. 디바이스 R1에서 수신한 경로에 확장된 커뮤니티 값을 추가하는 정책을 구성합니다.

    확장 커뮤니티는 의 표기법을 type:administrator:assigned-number사용합니다.

    특정 커뮤니티 값은 에 설명된 community (Policy Options)대로 특정 매개 변수 내에서 관리 목표를 달성하는 모든 것이 될 수 있습니다.

    content_copy zoom_out_map
    [edit policy-options policy-statement set-ext-comms]
    user@R3# set term route-1 from route-filter 172.16.1.0/24 exact
    user@R3# set term route-1 then community add target-as
    user@R3# set term route-1 then accept
    user@R3# set term route-2 from route-filter 172.16.2.0/24 exact
    user@R3# set term route-2 then community add target-ip
    user@R3# set term route-2 then accept
    user@R3# set term route-3 from route-filter 172.16.3.0/24 exact
    user@R3# set term route-3 then community add origin-as
    user@R3# set term route-3 then accept
    user@R3# set term route-4 from route-filter 172.16.4.0/24 exact
    user@R3# set term route-4 then community add origin-ip
    user@R3# set term route-4 then accept
    [edit policy-options]
    user@R3# set community origin-as members origin:64511:3
    user@R3# set community origin-ip members origin:172.16.7.7:4
    user@R3# set community target-as members target:64511:1
    user@R3# set community target-ip members target:172.16.7.7:2
    
  4. 자율 시스템(AS) 번호 및 라우터 ID를 구성합니다.

    content_copy zoom_out_map
    [edit routing-options]
    user@R3# set router-id 192.168.0.3
    user@R3# set autonomous-system 64511
    

결과

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

content_copy zoom_out_map
user@R3# show interfaces
fe-1/2/3 {
    unit 0 {
        family inet {
            address 10.0.0.13/30;
        }
    }
}
lo0 {
    unit 0 {
        family inet {
            address 192.168.0.3/32;
        }
    }
}
content_copy zoom_out_map
user@R3# show protocols
bgp {
    group to-R1 {
        type external;
        import set-ext-comms;
        peer-as 64510;
        neighbor 10.0.0.14;
    }
}
content_copy zoom_out_map
user@R3# show policy-options
policy-statement set-ext-comms {
    term route-1 {
        from {
            route-filter 172.16.1.0/24 exact;
        }
        then {
            community add target-as;
            accept;
        }
    }
    term route-2 {
        from {
            route-filter 172.16.2.0/24 exact;
        }
        then {
            community add target-ip;
            accept;
        }
    }
    term route-3 {
        from {
            route-filter 172.16.3.0/24 exact;
        }
        then {
            community add origin-as;
            accept;
        }
    }
    term route-4 {
        from {
            route-filter 172.16.4.0/24 exact;
        }
        then {
            community add origin-ip;
            accept;
        }
    }
}
community origin-as members origin:64511:3;
community origin-ip members origin:172.16.7.7:4;
community target-as members target:64511:1;
community target-ip members target:172.16.7.7:2;
content_copy zoom_out_map
user@R3# show routing-options
router-id 192.168.0.3;
autonomous-system 64511;

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

검증

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

디바이스 R1에서 경로 확인

목적

디바이스 R1에서 172.16을 확인합니다. 라우팅 테이블의 경로입니다.

작업

content_copy zoom_out_map
user@R1> show route protocol static match-prefix 172.16.* detail

inet.0: 15 destinations, 15 routes (15 active, 0 holddown, 0 hidden)
172.16.1.0/24 (1 entry, 1 announced)
        *Static Preference: 5
                Next hop type: Router, Next hop index: 835
                Address: 0x9260250
                Next-hop reference count: 19
                Next hop: 10.0.0.2 via fe-1/2/0.0, selected
                State: <Active Int Ext>
                Local AS: 64510 
                Age: 2:06:08 
                Task: RT
                Announcement bits (2): 2-KRT 3-BGP_RT_Background 
                AS path: I
                Communities: 64510:1

172.16.2.0/24 (1 entry, 1 announced)
        *Static Preference: 5
                Next hop type: Router, Next hop index: 835
                Address: 0x9260250
                Next-hop reference count: 19
                Next hop: 10.0.0.2 via fe-1/2/0.0, selected
                State: <Active Int Ext>
                Local AS: 64510 
                Age: 2:06:08 
                Task: RT
                Announcement bits (2): 2-KRT 3-BGP_RT_Background 
                AS path: I
                Communities: 64510:2

172.16.3.0/24 (1 entry, 1 announced)
        *Static Preference: 5
                Next hop type: Router, Next hop index: 835
                Address: 0x9260250
                Next-hop reference count: 19
                Next hop: 10.0.0.2 via fe-1/2/0.0, selected
                State: <Active Int Ext>
                Local AS: 64510 
                Age: 2:06:08 
                Task: RT
                Announcement bits (2): 2-KRT 3-BGP_RT_Background 
                AS path: I
                Communities: 64510:3

172.16.4.0/24 (1 entry, 1 announced)
        *Static Preference: 5
                Next hop type: Router, Next hop index: 835
                Address: 0x9260250
                Next-hop reference count: 19
                Next hop: 10.0.0.2 via fe-1/2/0.0, selected
                State: <Active Int Ext>
                Local AS: 64510 
                Age: 2:06:08 
                Task: RT
                Announcement bits (2): 2-KRT 3-BGP_RT_Background 
                AS path: I
                Communities: 64510:4

의미

출력은 일반 커뮤니티 값이 경로에 연결되어 있음을 보여줍니다.

주:

커뮤니티는 정적 경로에 연결되므로 커뮤니티가 비 BGP 경로에 연결될 수 있음을 보여 줍니다.

디바이스 R3에서 경로 확인

목적

디바이스 R3에서 172.16을 확인합니다. 라우팅 테이블의 경로입니다.

작업

content_copy zoom_out_map
user@R3> show route protocol bgp match-prefix 172.16.* detail
betsy@tp5# run show route protocol bgp match-prefix 172.16.* detail logical-system R3       

inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
172.16.1.0/24 (1 entry, 1 announced)
        *BGP    Preference: 170/-101
                Next hop type: Router, Next hop index: 611
                Address: 0x9260130
                Next-hop reference count: 8
                Source: 10.0.0.14
                Next hop: 10.0.0.14 via fe-1/2/3.0, selected
                State: <Active Ext>
                Local AS: 64511 Peer AS: 64510
                Age: 1:57:27 
                Task: BGP_64510.10.0.0.14+54618
                Announcement bits (1): 0-KRT 
                AS path: 64510 I
                Communities: 64510:1 target:64511:1
                Accepted
                Localpref: 100
                Router ID: 192.168.0.1

172.16.2.0/24 (1 entry, 1 announced)
        *BGP    Preference: 170/-101
                Next hop type: Router, Next hop index: 611
                Address: 0x9260130
                Next-hop reference count: 8
                Source: 10.0.0.14
                Next hop: 10.0.0.14 via fe-1/2/3.0, selected
                State: <Active Ext>
                Local AS: 64511 Peer AS: 64510
                Age: 1:57:27 
                Task: BGP_64510.10.0.0.14+54618
                Announcement bits (1): 0-KRT 
                AS path: 64510 I
                Communities: 64510:2 target:172.16.7.7:2
                Accepted
                Localpref: 100
                Router ID: 192.168.0.1

172.16.3.0/24 (1 entry, 1 announced)
        *BGP    Preference: 170/-101
                Next hop type: Router, Next hop index: 611
                Address: 0x9260130
                Next-hop reference count: 8
                Source: 10.0.0.14
                Next hop: 10.0.0.14 via fe-1/2/3.0, selected
                State: <Active Ext>
                Local AS: 64511 Peer AS: 64510
                Age: 1:57:27 
                Task: BGP_64510.10.0.0.14+54618
                Announcement bits (1): 0-KRT 
                AS path: 64510 I
                Communities: 64510:3 origin:64511:3
                Accepted
                Localpref: 100
                Router ID: 192.168.0.1

172.16.4.0/24 (1 entry, 1 announced)
        *BGP    Preference: 170/-101
                Next hop type: Router, Next hop index: 611
                Address: 0x9260130      
                Next-hop reference count: 8
                Source: 10.0.0.14
                Next hop: 10.0.0.14 via fe-1/2/3.0, selected
                State: <Active Ext>
                Local AS: 64511 Peer AS: 64510
                Age: 1:57:27 
                Task: BGP_64510.10.0.0.14+54618
                Announcement bits (1): 0-KRT 
                AS path: 64510 I
                Communities: 64510:4 origin:172.16.7.7:4
                Accepted
                Localpref: 100
                Router ID: 192.168.0.1

의미

출력은 일반 커뮤니티 값이 경로에 연결된 상태로 유지되고 확장된 커뮤니티 값이 추가됨을 보여줍니다.

external-footer-nav