예: 세그먼트 라우팅을 사용하여 OSPFv2의 여러 독립 인스턴스 구성
이 예제를 사용하여 세그먼트 라우팅으로 OSPFv2의 여러 IGP 인스턴스를 구성할 수 있습니다.
당사 콘텐츠 테스트 팀은 이 예제를 검증하고 업데이트했습니다.
독서 시간 |
30분 |
구성 시간 |
20분 |
사전 요구 사항 예
하드웨어 요구 사항 |
MX 시리즈 라우터 3개 |
소프트웨어 요구 사항 |
모든 디바이스에서 실행되는 Junos OS 릴리스 24.4R1 이상 |
시작하기 전에
혜택 |
세그먼트 라우팅을 사용하여 OSPFv2의 여러 독립 인스턴스를 구성하면 특히 크고 복잡한 네트워크에서 네트워크 유연성, 확장성 및 트래픽 엔지니어링에 대한 제어력이 향상됩니다. |
자세히 알아보기 |
기능 개요
사용 기술 |
|
기본 검증 작업 |
|
토폴로지 개요
이 구성 예는 R1, R2 및 R3의 세 디바이스를 묘사합니다. 디바이스 R1과 디바이스 R2 사이, 디바이스 R2와 디바이스 R3 사이에는 두 개의 하위 인터페이스가 구성되어 있습니다. 각 디바이스는 세그먼트 라우팅이 활성화된 상태에서 여러 최단 경로 우선(OSPF) 인스턴스를 실행합니다. 네트워크를 통해 경로 제어를 제공하도록 SR-MPLS를 구성합니다. 라는 이름의 metro-edge
OSPF 인스턴스가 디바이스의 두 하위 인터페이스 각각에서 실행됩니다.
호스트 이름 |
역할 |
기능 |
---|---|---|
R1, R2 및 R3 |
디바이스에는 세그먼트 라우팅이 활성화된 하위 인터페이스에 구성된 다중 인스턴스 OSPF가 있습니다. |
디바이스는 OSPF 다중 인스턴스에 참여하고, 경로를 보급하며, 접두사 SID를 사용하여 트래픽을 다른 디바이스로 전달합니다. |
토폴로지 그림

R2 구성 단계
R2의 전체 샘플 컨피그레이션은 부록 1: 모든 디바이스에서 명령 설정
이 섹션에서는 이 예에서 R0 디바이스를 구성하는 데 필요한 주요 구성 작업을 강조합니다.
-
디바이스 인터페이스의 논리적 장치에서 호스트 이름,
enhanced-ip
모드, IPv4 주소와 같은 기본 디바이스 설정을 구성합니다.IP 주소로 루프백 인터페이스를 구성하고 MPLS를 활성화합니다.
라우터 ID 및 AS(Autonomous System) 번호를 구성하여 동일한 AS에 속하는 라우팅 디바이스 세트 내에서 라우팅 정보를 전파합니다.
VLAN 태깅을 활성화하고 서로 다른 VLAN ID를 가진 두 인터페이스의 논리적 단위를 구성합니다.
각 논리 장치에서 MPLS를 사용하도록 설정합니다. 각 인터페이스의 논리적 단위에서 나가는 패킷에 적용할 수 있는 MPLS 레이블의 최대 수를 구성합니다.
패킷을 로드 밸런싱하는 정책을 정의하고 패킷당 정책을 적용하여 트래픽 로드 밸런싱을 활성화합니다.
정확한 접두사를 기반으로 경로와 일치하는 정책 문을 구성하고 일치하는 경로에 세그먼트 식별자를 할당합니다.
계층 수준에서 MPLS 트래픽 엔지니어링, 세그먼트 라우팅 글로벌 블록(SRGB) 레이블 범위를
edit protocol mpls
구성하여 세그먼트 라우팅 도메인 전반에 걸쳐 레이블을 더 예측 가능하게 하고, MPLS 레이블 범위를 구성하여 링크에 대해 구성된 srgb 레이블의 레이블을 할당합니다.[edit] set system host-name R2 set chassis network-services enhanced-ip set interfaces ge-0/0/0 unit 1 family inet address 10.0.0.2/24 set interfaces ge-0/0/0 unit 2 family inet address 10.0.0.12/24 set interfaces ge-0/0/1 unit 1 family inet address 10.2.2.1/24 set interfaces ge-0/0/1 unit 2 family inet address 10.2.2.11/24
[edit] set interfaces lo0 unit 0 family inet address 10.1.255.2/32 set interfaces lo0 unit 0 family mpls
[edit] set routing-options router-id 10.1.255.2 set routing-options autonomous-system 100
[edit] set interfaces ge-0/0/0 vlan-tagging set interfaces ge-0/0/0 unit 1 vlan-id 1 set interfaces ge-0/0/0 unit 2 vlan-id 2 set interfaces ge-0/0/1 vlan-tagging set interfaces ge-0/0/1 unit 1 vlan-id 1 set interfaces ge-0/0/1 unit 2 vlan-id 2
[edit] set interfaces ge-0/0/0 unit 1 family mpls maximum-labels 5 set interfaces ge-0/0/0 unit 2 family mpls maximum-labels 5 set interfaces ge-0/0/1 unit 1 family mpls maximum-labels 5 set interfaces ge-0/0/1 unit 2 family mpls maximum-labels 5
[edit] set policy-options policy-statement pplb then load-balance per-packet set policy-options policy-statement pplb then accept set routing-options forwarding-table export pplb
[edit] set policy-options policy-statement prefix-sid term 1 from route-filter 10.1.255.2/32 exact set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1001 set policy-options policy-statement prefix-sid term 1 then accept
[edit] set protocols mpls traffic-engineering set protocols mpls label-range srgb-label-range 800000 879999 set protocols mpls label-range static-label-range 60001 100000 set protocols mpls interface all set protocols mpls interface fxp0.0 disable
하위 인터페이스에서 을(를
ospf-instance
metro-edge
) 구성합니다(R2에서 R1로 및 R2에서 R3으로 연결).[edit] set protocols ospf-instance metro-edge area 0.0.0.0 interface all
접두사 sids와 함께 세그먼트 라우팅을 사용하도록 OSPF
metro-edge
인스턴스를 활성화합니다.[edit] set protocols ospf-instance metro-edge source-packet-routing prefix-segment prefix-sid
- 노드 세그먼트의 IPv4 인덱스 값을 구성합니다.
[edit] set protocols ospf-instance metro-edge source-packet-routing node-segment ipv4-index 1
OSPF
metro-edge
인스턴스의 루프백 주소를 패시브(passive)로 구성하고 관리 인터페이스(fxp0.0)를 비활성화합니다.[edit] set protocols ospf-instance metro-edge area 0.0.0.0 interface lo0.0 passive set protocols ospf-instance metro-edge area 0.0.0.0 interface fxp0.0 disable
확인
명령 | 확인 작업 |
---|---|
show route protocol ospf table inet.0 extensive |
|
ospf 봄 sid-데이터베이스 igp 인스턴스 표시 igp-instance | OSPF 인스턴스에 대한 OSPF 세그먼트 라우팅 데이터베이스를 확인합니다. |
ospf neighbor igp 인스턴스 표시 igp-instance | 특정 OSPF 인스턴스에 대한 neighbor를 확인합니다. |
ospf 데이터베이스 igp 인스턴스 표시 igp-instance | IGP 인스턴스와 연결된 OSPF 링크 상태 데이터베이스(LSDB)에서 OSPF 광고 항목을 확인합니다. |
ospf 인터페이스 igp 인스턴스 표시 igp-instance | IGP 인스턴스에 매핑된 인터페이스를 확인합니다. |
ospf 경로 igp 인스턴스 표시 igp-instance | R1 및 R3의 경로와 OSPF 인스턴스 매핑 정보를 확인합니다. |
라우팅 테이블 확인
목적
라우팅 테이블의 경로 항목을 확인합니다
행동
운영 모드에서 명령을 실행합니다 show route table inet.0 route-destination address extensive
.
user@R2>show route protocol ospf table inet.0 10.1.255.1 extensive inet.0: 19 destinations, 21 routes (19 active, 0 holddown, 0 hidden) 10.1.255.1/32 (1 entry, 1 announced) TSI: KRT in-kernel 10.1.255.1/32 -> {list:10.0.0.1, 10.0.0.11} *OSPF Preference: 10/10 Next hop type: Router, Next hop index: 0 Address: 0x8b32234 Next-hop reference count: 2, Next-hop session id: 0 Kernel Table Id: 0 Next hop: 10.0.0.1 via ge-0/0/0.1, selected Session Id: 0 Next hop: 10.0.0.11 via ge-0/0/0.2 Session Id: 0 State: <Active Int> Local AS: 100 Age: 1w4d 16:01:19 Metric: 1 Validation State: unverified Area: 0.0.0.0 Task: OSPF-metro-edge Announcement bits (1): 0-KRT AS path: I Thread: junos-main user@R2>show route protocol ospf table inet.0 10.1.255.3 extensive inet.0: 19 destinations, 21 routes (19 active, 0 holddown, 0 hidden) 10.1.255.3/32 (1 entry, 1 announced) TSI: KRT in-kernel 10.1.255.3/32 -> {list:10.2.2.2, 10.2.2.12} *OSPF Preference: 10/10 Next hop type: Router, Next hop index: 0 Address: 0x8b316f4 Next-hop reference count: 2, Next-hop session id: 0 Kernel Table Id: 0 Next hop: 10.2.2.2 via ge-0/0/1.1, selected Session Id: 0 Next hop: 10.2.2.12 via ge-0/0/1.2 Session Id: 0 State: <Active Int> Local AS: 100 Age: 1w4d 16:13:55 Metric: 1 Validation State: unverified Area: 0.0.0.0 Task: OSPF-metro-edge Announcement bits (1): 0-KRT AS path: I Thread: junos-main
의미
출력은 R1(10.1.255.1)의 루프백 주소와 R3(10.1.255.2)의 루프백 주소가 R2에서 구성된 대로 최단 경로 우선(OSPF) igp-instance metro-edge 에 매핑되는 것을 보여줍니다.
OSPF 광고 확인
목적
IGP 인스턴스와 연결된 OSPF 링크 상태 데이터베이스(LSDB)에서 OSPF 광고 항목을 확인합니다.
행동
운영 모드에서 명령을 실행합니다 show ospf database igp-instance igp-instance
.
user@R2>show ospf database igp-instance metro-edge OSPF database, Area 0.0.0.0 Type ID Adv Rtr Seq Age Opt Cksum Len Router 10.1.255.1 10.1.255.1 0x80000013 1110 0x22 0xe6e9 72 Router *10.1.255.2 10.1.255.2 0x80000015 1084 0x22 0x7be2 96 Router 10.1.255.3 10.1.255.3 0x80000013 1585 0x22 0x491 72 Network *10.0.0.2 10.1.255.2 0x80000010 2959 0x22 0x6791 32 Network *10.0.0.12 10.1.255.2 0x80000010 2209 0x22 0x3eb 32 Network 10.2.2.2 10.1.255.3 0x80000010 2085 0x22 0x4ba6 32 Network 10.2.2.12 10.1.255.3 0x80000010 1085 0x22 0xe601 32 OpaqArea 7.0.0.1 10.1.255.1 0x80000012 193 0x22 0x8c0 44 OpaqArea*7.0.0.1 10.1.255.2 0x80000012 511 0x22 0x2a9b 44 OpaqArea 7.0.0.1 10.1.255.3 0x80000012 585 0x22 0x4c76 44 OpaqArea 8.0.0.1 10.1.255.1 0x80000010 2610 0x22 0x4683 48 OpaqArea*8.0.0.1 10.1.255.2 0x80000010 2584 0x22 0xac01 52 OpaqArea 8.0.0.1 10.1.255.3 0x80000010 2584 0x22 0x7d06 52 OpaqArea 8.0.0.2 10.1.255.1 0x80000010 1860 0x22 0x4f55 48 OpaqArea*8.0.0.2 10.1.255.2 0x80000011 334 0x22 0xf393 52 OpaqArea 8.0.0.2 10.1.255.3 0x80000011 84 0x22 0xc498 52 OpaqArea*8.0.0.3 10.1.255.2 0x80000010 1834 0x22 0x445a 48 OpaqArea*8.0.0.4 10.1.255.2 0x80000010 1459 0x22 0x4d2c 48
의미
OSPF 라우팅 테이블의 경로 확인
목적
OSPF 라우팅 테이블에서 경로를 확인합니다
행동
운영 모드에서 명령을 실행합니다 show ospf route
.
user@R2>show ospf route igp-instance metro-edge Topology default Route Table: Prefix Path Route NH Metric NextHop Nexthop Type Type Type Interface Address/LSP 10.1.255.1 Intra Router IP 1 ge-0/0/0.1 10.0.0.1 ge-0/0/0.2 10.0.0.11 10.1.255.3 Intra Router IP 1 ge-0/0/1.1 10.2.2.2 ge-0/0/1.2 10.2.2.12 10.0.0.0/24 Intra Network IP 1 ge-0/0/0.1 ge-0/0/0.2 10.1.255.1/32 Intra Network IP 1 ge-0/0/0.1 10.0.0.1 ge-0/0/0.2 10.0.0.11 10.1.255.2/32 Intra Network IP 0 lo0.0 10.1.255.3/32 Intra Network IP 1 ge-0/0/1.1 10.2.2.2 ge-0/0/1.2 10.2.2.12 10.2.2.0/24 Intra Network IP 1 ge-0/0/1.1 ge-0/0/1.2 299840 Intra Network Mpls 0 ge-0/0/0.2 10.0.0.11 299840 (S=0) Intra Network Mpls 0 ge-0/0/0.2 10.0.0.11 299856 Intra Network Mpls 0 ge-0/0/0.1 10.0.0.1 299856 (S=0) Intra Network Mpls 0 ge-0/0/0.1 10.0.0.1 299904 Intra Network Mpls 0 ge-0/0/1.2 10.2.2.12 299904 (S=0) Intra Network Mpls 0 ge-0/0/1.2 10.2.2.12 299920 Intra Network Mpls 0 ge-0/0/1.1 10.2.2.2 299920 (S=0) Intra Network Mpls 0 ge-0/0/1.1 10.2.2.2
의미
R2의 출력은 R1 및 R3의 루프백 주소와 OSPF 인스턴스 매핑 정보를 보여줍니다.
OSPF 세그먼트 라우팅 데이터베이스를 확인합니다
목적
OSPF 인스턴스 메트로 에지에 대한 OSPF 세그먼트 라우팅 데이터베이스를 확인합니다.
행동
운영 모드에서 명령을 실행합니다 show ospf spring sid-database igp-instance igp-instance
.
user@R2>show ospf spring sid-database igp-instance metro-edge OSPF database, Area 0.0.0.0 SID Prefix Advertised-by Route-type 1000 10.1.255.1/32 10.1.255.1 Intra-Area 1001 10.1.255.2/32 10.1.255.2 Intra-Area 1002 10.1.255.3/32 10.1.255.3 Intra-Area
의미
출력은 서로 다른 접두사 SID를 보급하는 여러 최단 경로 우선(OSPF) 인스턴스를 보여줍니다.
OSPF 인터페이스 확인
목적
OSPF 인스턴스 지원 인터페이스에 대한 상태 정보를 확인합니다.
행동
운영 모드에서 명령을 실행합니다 show ospf interface igp-instance igp-instance
.
user@R2>show ospf interface igp-instance metro-edge Interface State Area DR ID BDR ID Nbrs ge-0/0/0.1 DR 0.0.0.0 10.1.255.2 10.1.255.1 1 ge-0/0/0.2 DR 0.0.0.0 10.1.255.2 10.1.255.1 1 ge-0/0/1.1 DR 0.0.0.0 10.1.255.2 10.1.255.3 1 ge-0/0/1.2 DR 0.0.0.0 10.1.255.2 10.1.255.3 1 lo0.0 DRother 0.0.0.0 0.0.0.0 0.0.0.0 0 lo0.0 DRother 0.0.0.0 0.0.0.0 0.0.0.0 0
의미
출력에는 OSPF 인스턴스(메트로 에지)에 매핑된 R2의 하위 인터페이스가 표시됩니다.
OSPF 인접 네트워크 확인
목적
구성된 링크 간의 인접성을 확인합니다.
행동
운영 모드에서 명령을 실행합니다 show ospf neighbor igp-instance igp-instance
.
user@R2>show ospf neighbor igp-instance metro-edge Address Interface State ID Pri Dead 10.0.0.1 ge-0/0/0.1 Full 10.1.255.1 128 35 10.0.0.11 ge-0/0/0.2 Full 10.1.255.1 128 39 10.2.2.2 ge-0/0/1.1 Full 10.1.255.3 128 33 10.2.2.12 ge-0/0/1.2 Full 10.1.255.3 128 36
의미
디바이스 R2는 디바이스 R1 및 디바이스 R3과 인접성을 설정했으며, 상태 출력 필드가 나타내는 Full
바와 같습니다.
부록 1: 모든 디바이스에서 명령 설정
이 예를 빠르게 구성하려면 다음 명령을 복사하여 텍스트 파일에 붙여 넣고 줄 바꿈을 제거한 다음 네트워크 구성에 맞게 필요한 세부 정보를 변경한 다음 명령을 복사하여 [edit] 계층 수준에서 CLI에 붙여 넣습니다.
R1 시리즈
set system host-name R1 set interfaces ge-0/0/0 unit 1 family inet address 10.0.0.1/24 set interfaces ge-0/0/0 unit 2 family inet address 10.0.0.11/24 set interfaces ge-0/0/0 unit 2 enable set interfaces ge-0/0/0 vlan-tagging set interfaces ge-0/0/0 unit 1 vlan-id 1 set interfaces ge-0/0/0 unit 2 vlan-id 2 set interfaces ge-0/0/0 unit 1 family mpls maximum-labels 5 set interfaces ge-0/0/0 unit 2 family mpls maximum-labels 5 set interfaces lo0 unit 0 family inet address 10.1.255.1/32 set interfaces lo0 unit 0 family mpls set policy-options policy-statement pplb then load-balance per-packet set policy-options policy-statement pplb then accept set policy-options policy-statement prefix-sid term 1 from route-filter 10.1.255.1/32 exact set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1000 set policy-options policy-statement prefix-sid term 1 then accept set routing-options router-id 10.1.255.1 set routing-options autonomous-system 100 set routing-options forwarding-table export pplb set protocols mpls traffic-engineering set protocols mpls label-range srgb-label-range 800000 879999 set protocols mpls label-range static-label-range 60001 100000 set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf-instance metro-edge source-packet-routing prefix-segment prefix-sid set protocols ospf-instance metro-edge source-packet-routing node-segment ipv4-index 0 set protocols ospf-instance metro-edge area 0.0.0.0 interface all set protocols ospf-instance metro-edge area 0.0.0.0 interface lo0.0 passive set protocols ospf-instance metro-edge area 0.0.0.0 interface fxp0.0 disable
R2 (R2)
set system host-name R2 set interfaces ge-0/0/0 unit 1 family inet address 10.0.0.2/24 set interfaces ge-0/0/0 unit 2 family inet address 10.0.0.12/24 set interfaces ge-0/0/1 unit 1 family inet address 10.2.2.1/24 set interfaces ge-0/0/1 unit 2 family inet address 10.2.2.11/24 set interfaces ge-0/0/0 vlan-tagging set interfaces ge-0/0/0 unit 1 vlan-id 1 set interfaces ge-0/0/0 unit 2 vlan-id 2 set interfaces ge-0/0/1 vlan-tagging set interfaces ge-0/0/1 unit 1 vlan-id 1 set interfaces ge-0/0/1 unit 2 vlan-id 2 set interfaces ge-0/0/0 unit 1 family mpls maximum-labels 5 set interfaces ge-0/0/0 unit 2 family mpls maximum-labels 5 set interfaces ge-0/0/1 unit 1 family mpls maximum-labels 5 set interfaces ge-0/0/1 unit 2 family mpls maximum-labels 5 set interfaces lo0 unit 0 family inet address 10.1.255.2/32 set interfaces lo0 unit 0 family mpls set policy-options policy-statement pplb then load-balance per-packet set policy-options policy-statement pplb then accept set policy-options policy-statement prefix-sid term 1 from route-filter 10.1.255.2/32 exact set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1001 set policy-options policy-statement prefix-sid term 1 then accept set routing-options router-id 10.1.255.2 set routing-options autonomous-system 100 set routing-options forwarding-table export pplb set protocols mpls traffic-engineering set protocols mpls label-range srgb-label-range 800000 879999 set protocols mpls label-range static-label-range 60001 100000 set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf-instance metro-edge source-packet-routing prefix-segment prefix-sid set protocols ospf-instance metro-edge source-packet-routing node-segment ipv4-index 1 set protocols ospf-instance metro-edge area 0.0.0.0 interface all set protocols ospf-instance metro-edge area 0.0.0.0 interface lo0.0 passive set protocols ospf-instance metro-edge area 0.0.0.0 interface fxp0.0 disable
R3 (R3)
set system host-name R3 set interfaces ge-0/0/0 unit 1 family inet address 10.2.2.2/24 set interfaces ge-0/0/0 unit 2 family inet address 10.2.2.12/24 set interfaces ge-0/0/0 vlan-tagging set interfaces ge-0/0/0 unit 1 vlan-id 1 set interfaces ge-0/0/0 unit 2 vlan-id 2 set interfaces ge-0/0/0 unit 1 family mpls maximum-labels 5 set interfaces ge-0/0/0 unit 2 family mpls maximum-labels 5 set interfaces lo0 unit 0 family inet address 10.1.255.3/32 set interfaces lo0 unit 0 family mpls set policy-options policy-statement pplb then load-balance per-packet set policy-options policy-statement pplb then accept set policy-options policy-statement prefix-sid term 1 from route-filter 10.1.255.3/32 exact set policy-options policy-statement prefix-sid term 1 then prefix-segment index 1002 set policy-options policy-statement prefix-sid term 1 then accept set routing-options router-id 10.1.255.3 set routing-options autonomous-system 100 set routing-options forwarding-table export pplb set protocols mpls traffic-engineering set protocols mpls label-range srgb-label-range 800000 879999 set protocols mpls label-range static-label-range 60001 100000 set protocols mpls interface all set protocols mpls interface fxp0.0 disable set protocols ospf-instance metro-edge source-packet-routing prefix-segment prefix-sid set protocols ospf-instance metro-edge source-packet-routing node-segment ipv4-index 2 set protocols ospf-instance metro-edge area 0.0.0.0 interface lo0.0 passive set protocols ospf-instance metro-edge area 0.0.0.0 interface all set protocols ospf-instance metro-edge area 0.0.0.0 interface fxp0.0 disable