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

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

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

close
keyboard_arrow_left
list Table of Contents
keyboard_arrow_right

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

starstarstarstarstar
Go to English page
면책 조항:

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

예: RPD 인프라에서 경로 접두사에 대한 우선 순위 구성

date_range 19-Jan-25

이 예에서는 OSPF, LDP 및 BGP 프로토콜에 대한 RPD 인프라의 경로 접두사에 대한 우선 순위를 구성하는 방법을 보여줍니다.

요구 사항

이 예에서 사용되는 하드웨어 및 소프트웨어 구성 요소는 다음과 같습니다.

  • ACX 시리즈, M 시리즈, MX 시리즈, PTX 시리즈 및 T 시리즈의 조합에 있는 라우터 3개.

  • 모든 디바이스에서 실행되는 Junos OS 릴리스 16.1 이상

시작하기 전에:

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

  2. 다음과 같은 프로토콜을 구성합니다.

    • BGP(Border Gateway Protocol)

    • MPLS

    • 최단 경로 우선(OSPF)

    • LDP

개요

경로 수가 많은 네트워크에서는 더 나은 컨버전스를 위해 경로가 업데이트되는 순서를 제어하고 차별화된 서비스를 제공하는 것이 중요할 때가 있습니다. 접두사 우선 순위 지정은 사용자가 특정 경로/접두사를 다른 경로보다 우선시하고 RIB(라우팅 테이블) 및 FIB(포워딩 테이블)에서 경로가 업데이트되는 순서를 제어하는 데 도움이 됩니다. Junos OS 릴리스 16.1 이상에서는 경로가 LDP/OSPF에서 rpd로, rpd에서 커널로 업데이트되는 순서를 제어할 수 있습니다. 프로토콜에서 기존 가져오기 정책의 우선순위를 또는 이를 통해 지정할 highlow 수 있습니다. 토폴로지가 변경되는 경우, 우선 순위가 높은 접두사가 라우팅 테이블에서 먼저 업데이트되고 그 다음에 낮은 우선 순위가 높은 접두사가 업데이트됩니다. 일반적으로 명시적으로 우선 순위가 할당되지 않은 경로는 중간 우선 순위로 처리됩니다. 동일한 우선 순위 수준 내에서 경로는 사전순으로 계속 업데이트됩니다.

이 예에서 라우팅 디바이스는 영역 0.0.0.0에 있으며 인터페이스 ge-1/3/0은 이웃 디바이스에 연결됩니다. 세 가지 가져오기 라우팅 정책을 구성합니다. next-hop-self, OSPF-PRIO 및 prio_for_bgp. 라우팅 정책 next-hop-self는 BGP의 경로를 수락합니다. OSPF 라우팅 정책의 경우 172.16.25.3/32와 일치하는 경로는 우선 순위가 높기 때문에 먼저 설치됩니다. LDP는 OSPF에서 경로를 가져옵니다. BGP 우선 순위 지정의 경우, 172.16.50.1/32와 일치하는 경로는 우선 순위가 높기 때문에 먼저 설치됩니다. 이러한 접두사와 연결된 경로는 접두사의 지정된 우선 순위 순서대로 라우팅 테이블에 설치됩니다.

토폴로지

그림 1은 샘플 토폴로지를 표시합니다.

그림 1: rpd 인프라의 경로 접두사에 대한 우선 순위rpd 인프라의 경로 접두사에 대한 우선 순위

구성

CLI 빠른 구성

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

R1

content_copy zoom_out_map
set interfaces ge-1/3/0 unit 0 family inet address 172.16.12.1/24
set interfaces ge-1/3/0 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 172.16.25.1/32
set protocols mpls interface ge-1/3/0.0
set protocols bgp group prio_internal type internal
set protocols bgp group prio_internal local-address 172.16.25.1
set protocols bgp group prio_internal import prio_for_bgp
set protocols bgp group prio_internal neighbor 172.16.25.3 family inet unicast
set protocols bgp group prio_internal neighbor 172.16.25.3 export next-hop-self
sset protocols ospf import ospf_prio
set protocols ospf area 0.0.0.0 interface ge-1/3/0.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ldp interface ge-1/3/0.0
set protocols ldp interface lo0.0
set policy-options policy-statement next-hop-self term nhself from protocol bgp
set policy-options policy-statement next-hop-self term nhself then next-hop self
set policy-options policy-statement next-hop-self term nhself then accept
set policy-options policy-statement ospf_prio term ospf_ldp from protocol ospf
set policy-options policy-statement ospf_prio term ospf_ldp from route-filter 172.16.25.3/32 exact
set policy-options policy-statement ospf_prio term ospf_ldp then priority high
set policy-options policy-statement ospf_prio term ospf_ldp then accept
set policy-options policy-statement prio_for_bgp term bgp_prio from protocol bgp
set policy-options policy-statement prio_for_bgp term bgp_prio from route-filter 172.16.50.1/32 exact
set policy-options policy-statement prio_for_bgp term bgp_prio then priority high
set routing-options nonstop-routing
set routing-options router-id 172.16.25.1
set routing-options autonomous-system 2525

R2

content_copy zoom_out_map
set interfaces ge-1/0/5 unit 0 family inet address 172.16.12.2/24
set interfaces ge-1/0/5 unit 0 family mpls
set interfaces ge-1/3/0 unit 0 family inet address 172.16.23.2/24
set interfaces ge-1/3/0 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 172.16.25.2/32
set protocols mpls interface ge-1/0/5.0
set protocols mpls interface ge-1/3/0.0
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-1/0/5.0
set protocols ospf area 0.0.0.0 interface ge-1/3/0.0
set protocols ldp interface ge-1/0/5.0
set protocols ldp interface ge-1/3/0.0
set protocols ldp interface lo0.0
set routing-options nonstop-routing
set routing-options router-id 172.16.25.2
set routing-options autonomous-system 2525

R3

content_copy zoom_out_map
set interfaces ge-1/0/1 unit 0 family inet address 172.16.23.3/24
set interfaces ge-1/0/1 unit 0 family mpls
set interfaces lo0 unit 0 family inet address 172.16.25.3/32
set protocols mpls interface ge-1/0/1.0
set protocols bgp group prio_internal type internal
set protocols bgp group prio_internal local-address 172.16.25.3
set protocols bgp group prio_internal neighbor 172.16.25.1 family inet unicast
set protocols bgp group prio_internal neighbor 172.16.25.1 export next-hop-self
set protocols bgp group prio_internal neighbor 172.16.25.1 export static_to_bgp
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-1/0/1.0
set protocols ldp interface ge-1/0/1.0
set protocols ldp interface lo0.0
set policy-options policy-statement next-hop-self term nhself from protocol bgp
set policy-options policy-statement next-hop-self term nhself then next-hop self
set policy-options policy-statement next-hop-self term nhself then accept
set policy-options policy-statement static_to_bgp term s_to_b from protocol static
set policy-options policy-statement static_to_bgp term s_to_b from route-filter 172.16.50.1/32 exact
set policy-options policy-statement static_to_bgp term s_to_b from route-filter 172.16.50.2/32 exact
set policy-options policy-statement static_to_bgp term s_to_b then accept
set routing-options nonstop-routing
set routing-options static route 172.16.50.1/32 receive
set routing-options static route 172.16.50.2/32 receive
set routing-options router-id 172.16.25.3
set routing-options autonomous-system 2525

디바이스 R1 구성

단계별 절차

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

디바이스 R1 구성

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

    content_copy zoom_out_map
    [edit interfaces]
    user@R1# set interfaces ge-1/3/0 unit 0 family inet address 172.16.12.1/24
    user@R1# set interfaces ge-1/3/0 unit 0 family mpls
    user@R1# set interfaces lo0 unit 0 family inet address 172.16.25.1/32
    
  2. 디바이스에 루프백 주소를 할당합니다.

    content_copy zoom_out_map
    [edit lo0 unit 0 family]
    user@R1# set address 172.16.25.1/32
    
  3. MPLS를 구성합니다.

    content_copy zoom_out_map
    [edit protocols]
    user@R1# set protocols mpls interface ge-1/3/0.0
    
  4. 라우터 R1의 라우터 ID와 AS(Autonomous System)를 구성합니다.

    content_copy zoom_out_map
    [edit routing-options]
    user@R1# set router-id 172.16.7.7
    user@R1# set autonomous-system 100
    
  5. 라우터 R1의 인터페이스에서 OSPF를 활성화합니다.

    content_copy zoom_out_map
    [edit protocols]
    user@R1# set protocols ospf import ospf_prio
    user@R1# set protocols ospf area 0.0.0.0 interface ge-1/3/0.0
    user@R1# set protocols ospf area 0.0.0.0 interface lo0.0 passive
    
  6. 인터페이스에서 LDP 프로토콜을 구성합니다.

    content_copy zoom_out_map
    [edit protocols]
    user@R1# set protocols ldp interface ge-1/3/0.0
    user@R1# set protocols ldp interface lo0.0
    
  7. BGP를 구성합니다.

    content_copy zoom_out_map
    [edit protocols]
    user@R1# set protocols bgp group prio_internal type internal
    user@R1# set protocols bgp group prio_internal local-address 172.16.25.1
    user@R1# set protocols bgp group prio_internal import prio_for_bgp
    user@R1# set protocols bgp group prio_internal neighbor 172.16.25.3 family inet unicast
    user@R1# set protocols bgp group prio_internal neighbor 172.16.25.3 export next-hop-self
    
  8. 경로의 우선 순위를 지정하도록 정책 옵션을 구성합니다. 정책 next-hop-self는 BGP의 경로를 수락합니다. 세 가지 가져오기 라우팅 정책을 구성합니다. next-hop-self, OSPF-PRIO 및 prio_for_bgp. 라우팅 정책 next-hop-self는 BGP의 경로를 수락합니다. ospf-prio 라우팅 정책의 경우 172.16.25.3/32와 일치하는 경로는 우선 순위가 높기 때문에 먼저 설치됩니다. LDP는 OSPF에서 경로를 가져옵니다. prio_for_bgp 정책의 경우 172.16.50.1/32와 일치하는 경로는 우선 순위가 높기 때문에 먼저 설치됩니다.

    content_copy zoom_out_map
    [edit policy-options policy-statement]
    user@R1# set policy-options policy-statement next-hop-self term nhself from protocol bgp
    user@R1# set policy-options policy-statement next-hop-self term nhself then next-hop self
    user@R1# set policy-options policy-statement next-hop-self term nhself then accept
    user@R1# set policy-options policy-statement ospf_prio term ospf_ldp from protocol ospf
    user@R1# set policy-options policy-statement ospf_prio term ospf_ldp from route-filter 172.16.25.3/32 exact
     set policy-options policy-statement ospf_prio term ospf_ldp then priority high
     set policy-options policy-statement ospf_prio term ospf_ldp then accept
     set policy-options policy-statement prio_for_bgp term bgp_prio from protocol bgp
     set policy-options policy-statement prio_for_bgp term bgp_prio from route-filter 172.16.50.1/32 exact
     set policy-options policy-statement prio_for_bgp term bgp_prio then priority high
    

결과

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

content_copy zoom_out_map
[edit]
user@R1# show interfaces
ge-1/3/0 {
    unit 0 {
        family inet {
            address 172.16.12.1/24;
        }
        family mpls;
    }
}
lo0 {
    unit 0 {
        family inet {
            address address 172.16.25.1/32;
        }
    }
}
content_copy zoom_out_map
[edit]
user@R1# show protocols
mpls {
    interface ge-1/3/0.0;
}
bgp {
    group prio_internal {
        type internal;
        local-address 172.16.25.1;
    import prio_for_bgp
        neighbor 172.16.25.3 {
            family inet {
                unicast;
                }
                export next-hop-self;
                }
                }
            }
        ospf {
            import ospf_prio;
            area 0.0.0.0 {
                interface ge-1/3/0.0;
                interface lo0.0 {
                    passive;
                    }
            }
        }
        ldp {
        interface ge-1/3/0.0;
        interface lo0.0;
        }
    }
content_copy zoom_out_map
[edit]
user@R1# show routing-options
nonstop-routing;
router-id 172.16.25.1;
autonomous-system 2525;
content_copy zoom_out_map
[edit]
user@R1# show policy-options
policy-statement next-hop-self {
    term nhself {
        from protocol bgp;
        then {
            next-hop self;
                accept;
            }
    }
}
policy-statement ospf_prio {
    term ospf_ldp {
        from {
            protocol ospf;
            route-filter 172.16.25.3/32 exact;
            }
        then {
                priority high;
                accept;
                }
            }
    }
policy-statement prio_for_bgp {
    term bgp_prio {
        from {
            protocol bgp;
        route-filter 172.16.50.1/32 exact;
            }
            then priority high;
    }
}

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

검증

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

OSPF 경로의 우선 순위 확인

목적

OSPF에서 예상되는 경로에 우선 순위가 설정되어 있는지 확인합니다.

작업

디바이스 R1의 운영 모드에서 명령을 실행합니다 show ospf route 172.16.25.3/32 extensive . 높음 우선 순위는 OSPF 경로 172.16.25.3에 적용됩니다.

content_copy zoom_out_map
user@R1> show ospf route 172.16.25.3/32 extensive

Topology default Route Table:
 
Prefix             Path  Route      NH       Metric NextHop       Nexthop      
                   Type  Type       Type            Interface     Address/LSP
172.16.25.3          Intra Router     IP            2 ge-1/3/0.0    172.16.12.2
  area 0.0.0.0, origin 172.16.25.3, optional-capability 0x0
172.16.25.3/32       Intra Network    IP            2 ge-1/3/0.0    172.16.12.2
  area 0.0.0.0, origin 172.16.25.3, priority high

의미

출력은 OSPF 경로 172.16.25.3에 우선 순위가 high 적용됨을 보여줍니다.

LDP 경로의 우선 순위 확인

목적

LDP가 OSPF에서 상속되는지 확인합니다.

작업

운영 모드에서 명령을 입력하여 show route 172.16.25.3 LDP가 OSPF에서 경로를 상속했는지 확인합니다.

content_copy zoom_out_map
user@R1> show route 172.16.25.3

  inet.0: 24 destinations, 24 routes (24 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
 
172.16.25.3/32       *[OSPF/10] 00:10:27, metric 2
                    > to 172.16.25.2 via ge-1/3/0.0
 
inet.3: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
 
172.16.25.3/32       *[LDP/9] 00:10:24, metric 1
                    > to 172.16.25.2 via ge-1/3/0.0, Push 299824
    

운영 모드에서 명령을 입력하여 show route 172.16.25.3 extensive LDP가 우선 순위를 상속받았는지 확인합니다.

content_copy zoom_out_map
user@R1> show route 172.16.25.3 extensive
inet.0: 24 destinations, 24 routes (24 active, 0 holddown, 0 hidden)
172.16.25.3/32 (1 entry, 1 announced)
        State:<Flashall>
TSI:
KRT in-kernel 172.16.25.3/32 -> {172.16.12.2}
        *OSPF   Preference: 10
                Next hop type: Router, Next hop index: 549
                Address: 0xa463390
                Next-hop reference count: 6
                Next hop: 172.16.12.2 via ge-1/3/0.0, selected
                Session Id: 0x0
                State:<Active Int HighPriority>
                Local AS:  2525 
                Age: 10:43      Metric: 2 
                Validation State: unverified 
                Area: 0.0.0.0
                Task: OSPF
                Announcement bits (4): 0-KRT 4-LDP 6-Resolve tree 2 7-Resolve_IGP_FRR task 
                AS path: I


inet.3: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)

172.16.25.3/32 (1 entry, 1 announced)
        State:<Flashall>
LDP    Preference: 9
                Next hop type: Router, Next hop index: 582
                Address: 0xa477810
                Next-hop reference count: 12
                Next hop: 172.16.12.2 via ge-1/3/0.0, selected
                Label operation: Push 299824
                Label TTL action: prop-ttl
                Load balance label: Label 299824: None; 
                Label element ptr: 0xa17ad00
                Label parent element ptr: 0x0
                Label element references: 1
                Label element child references: 0
                Label element lsp id: 0
                Session Id: 0x0
                State:<Active Int HighPriority>                
                Local AS:  2525 
                Age: 10:40      Metric: 1 
                Validation State: unverified 
                Task: LDP
                Announcement bits (3): 2-Resolve tree 1 3-Resolve tree 2 4-Resolve_IGP_FRR task 
                AS path: I

 

의미

출력은 LDP가 OSPF에서 경로 172.16.25.3에 대한 우선 순위를 high 상속함을 보여줍니다.

BGP 경로의 우선 순위 확인

목적

BGP에서 예상되는 경로에 우선 순위가 설정되어 있는지 확인합니다.

작업

디바이스 R1에서 작동 모드에서 명령을 실행하여 show route protocol bgp BGP에서 학습한 경로를 표시합니다.

content_copy zoom_out_map
user@R1> show route protocol bgp

inet.0: 24 destinations, 24 routes (24 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
 
172.16.50.1/32        *[BGP/170] 00:11:24, localpref 100, from 172.16.25.3
                      AS path: I, validation-state: unverified
                    > to 172.16.12.2 via ge-1/3/0.0, Push 299824
172.16.50.2/32        *[BGP/170] 00:11:24, localpref 100, from 172.16.25.3
                      AS path: I, validation-state: unverified
                    > to 172.16.12.2 via ge-1/3/0.0, Push 299824
 
inet.3: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
 
mpls.0: 9 destinations, 9 routes (9 active, 0 holddown, 0 hidden)

디바이스 R1의 운영 모드에서 명령을 실행합니다 show route 172.16.50.1 extensive . BGP 경로 172.16.50.1에는 높은 우선 순위가 적용됩니다.

content_copy zoom_out_map
user@R1> show route 172.16.50.1 extensive

inet.0: 24 destinations, 24 routes (24 active, 0 holddown, 0 hidden)
172.16.50.1/32 (1 entry, 1 announced)
TSI:
KRT in-kernel 172.16.50.1/32 -> {indirect(1048574)}
        *BGP    Preference: 170/-101
                Next hop type: Indirect, Next hop index: 0
                Address: 0xa487b10
                Next-hop reference count: 4
                Source: 172.16.25.3
                Next hop type: Router, Next hop index: 582
                Next hop: 172.16.12.2 via ge-1/3/0.0, selected
                Label operation: Push 299824
                Label TTL action: prop-ttl
                Load balance label: Label 299824: None; 
                Label element ptr: 0xa17ad00
                Label parent element ptr: 0x0
                Label element references: 1
                Label element child references: 0
                Label element lsp id: 0
                Session Id: 0x0
                Protocol next hop: 172.16.25.3
                Indirect next hop: 0xa4a9800 1048574 INH Session ID: 0x0
                State: <Active Int Ext HighPriority>
                Local AS:  2525 Peer AS:  2525
                Age: 11:49      Metric2: 1 
                Validation State: unverified 
                Task: BGP_2525.172.16.25.3
                Announcement bits (2): 0-KRT 6-Resolve tree 2 
                AS path: I (Atomic)
                Accepted
                Localpref: 100
                Router ID: 172.16.25.3
                Indirect next hops: 1   
                        Protocol next hop: 172.16.25.3 Metric: 1
                        Indirect next hop: 0xa4a9800 1048574 INH Session ID: 0x0
                        Indirect path forwarding next hops: 1
                                Next hop type: Router
                                Next hop: 172.16.12.2 via ge-1/3/0.0
                                Session Id: 0x0
                        172.16.25.3/32 Originating RIB: inet.3
                          Metric: 1                       Node path count: 1
                          Forwarding nexthops: 1
                                Nexthop: 172.16.12.2 via ge-1/3/0.0

의미

출력은 BGP 경로 172.16.50.1에 우선 순위가 high 적용되었음을 보여줍니다.

external-footer-nav