논리적 시스템에 대한 정적 라우팅
예: 동일한 라우터 내에서 논리적 시스템 간 정적 경로 구성
이 예에서는 논리적 시스템 간의 정적 경로를 구성하는 방법을 보여줍니다. 논리적 시스템은 단일 물리적 라우터로 구성되고 논리 터널 인터페이스에 의해 연결됩니다.
요구 사항
논리적 터널(lt)인터페이스를 사용하여 논리적 시스템을 연결해야 합니다. 예를 들면 다음과 같습니다. MX 시리즈라우터 및 EX 시리즈 스위치에서 논리적 터널 인터페이스를 사용하여 동일한 디바이스에서 논리적 시스템을 연결합니다.
개요
정적 경로는 디바이스에서 특정 경로를 사용하여 루트가 특정 서브넷에 도착하는 방법을 지정하는 하드 코드 경로입니다. 스텁 네트워크에 연결된 라우터는 종종 정적 경로를 사용하도록 구성됩니다. 스텁 네트워크는 다른 네트워크에 대해 알지 없는 네트워크입니다. 스텁 네트워크는 비-로컬 목적지로의 기본 경로만 인식하여 단일 경로를 통해 비-로컬 트래픽을 전송합니다. 이 예에서는 10.10.10.0/30 네트워크로의 정적 경로가 있는 논리적 시스템 LS1을 구성하고 넥프 주소를 192.168.10.2로 정의합니다. 또한 192.168.10.0/30 네트워크로의 정적 경로가 있는 논리적 시스템 LS1을 구성하고 10.10.10.1의 넥프 주소를 정의합니다.
구성
CLI 빠른 구성
이 예제를 신속하게 구성하려면 다음 명령을 복사하여 텍스트 파일에 붙여넣기하고, 라인 끊기를 제거하고, 네트워크 구성과 일치하는 데 필요한 세부 정보를 변경한 다음, 명령어를 계층 수준에서 CLI [edit]
붙여넣습니다.
set logical-systems LS1 interfaces lt-1/2/0 unit 0 description LS1->LS2 set logical-systems LS1 interfaces lt-1/2/0 unit 0 encapsulation ethernet set logical-systems LS1 interfaces lt-1/2/0 unit 0 peer-unit 1 set logical-systems LS1 interfaces lt-1/2/0 unit 0 family inet address 192.168.10.1/30 set logical-systems LS2 interfaces lt-1/2/0 unit 1 description LS2->LS1 set logical-systems LS2 interfaces lt-1/2/0 unit 1 encapsulation ethernet set logical-systems LS2 interfaces lt-1/2/0 unit 1 peer-unit 0 set logical-systems LS2 interfaces lt-1/2/0 unit 1 family inet address 192.168.10.2/30 set logical-systems LS2 interfaces lt-1/2/0 unit 9 description LS2->LS3 set logical-systems LS2 interfaces lt-1/2/0 unit 9 encapsulation ethernet set logical-systems LS2 interfaces lt-1/2/0 unit 9 peer-unit 10 set logical-systems LS2 interfaces lt-1/2/0 unit 9 family inet address 10.10.10.1/30 set logical-systems LS3 interfaces lt-1/2/0 unit 10 description LS3->LS2 set logical-systems LS3 interfaces lt-1/2/0 unit 10 encapsulation ethernet set logical-systems LS3 interfaces lt-1/2/0 unit 10 peer-unit 9 set logical-systems LS3 interfaces lt-1/2/0 unit 10 family inet address 10.10.10.2/30 set logical-systems LS1 routing-options static route 10.10.10.0/30 next-hop 192.168.10.2 set logical-systems LS3 routing-options static route 192.168.10.0/30 next-hop 10.10.10.1
절차
단계별 절차
다음 예제에서는 구성 계층의 다양한 수준을 탐색해야 합니다. 네트워크의 네트워크 CLI 정보는 CLI 사용자 가이드의 CLI Editor 사용 CLI 참조하십시오.
논리적 시스템 간에 정적 경로를 구성하는 경우:
명령을
show interfaces terse
실행하여 라우터에 논리적터널(lt)인터페이스가 있는지 확인합니다.user@host> show interfaces terse Interface Admin Link Proto Local Remote so-0/0/0 up down so-0/0/1 up down so-0/0/2 up down so-0/0/3 up down gr-1/2/0 up up ip-1/2/0 up up lt-1/2/0 up up ...
논리적 시스템 LS1에 논리적 시스템 LS2 연결의 논리적 터널 인터페이스를 구성합니다.
[edit] user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 0 description LS1->LS2 user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 0 encapsulation ethernet user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 0 peer-unit 1 user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 0 family inet address 192.168.10.1/30
논리적 시스템 LS2가 논리적 시스템 LS1에 연결되는 논리적 터널 인터페이스를 구성합니다.
[edit] user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 1 description LS2->LS1 user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 1 encapsulation ethernet user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 1 peer-unit 0 user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 1 family inet address 192.168.10.2/30
논리적 시스템 LS2에 논리적 시스템 LS3에 연결하는 논리적 터널 인터페이스를 구성합니다.
[edit] user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 9 description LS2->LS3 user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 9 encapsulation ethernet user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 9 peer-unit 10 user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 9 family inet address 10.10.10.1/30
논리적 시스템 LS3에서 논리적 터널 인터페이스를 논리적 시스템 LS2에 연결합니다.
[edit] user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 10 description LS3->LS2 user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 10 encapsulation ethernet user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 10 peer-unit 9 user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 10 family inet address 10.10.10.2/30
논리적 시스템 LS1에서 10.10.10.0/30 네트워크에 연결하는 정적 경로를 구성합니다.
[edit] user@host# set logical-systems LS1 routing-options static route 10.10.10.0/30 next-hop 192.168.10.2
논리적 시스템 LS3에서 192.168.10.0/30 네트워크에 연결하는 정적 경로를 구성합니다.
[edit] user@host# set logical-systems LS3 routing-options static route 192.168.10.0/30 next-hop 10.10.10.1
디바이스 구성이 완료되면 구성을 커밋합니다.
[edit] user@host# commit
결과
명령을 발행하여 구성을 show logical-systems
확인 출력이 의도한 구성을 표시하지 않는 경우 이 예제의 지침을 반복하여 구성을 수정합니다.
user@host# show logical-systems LS1 { interfaces { lt-1/2/0 { unit 0 { description LS1->LS2; encapsulation ethernet; peer-unit 1; family inet { address 192.168.10.1/30; } } } } routing-options { static { route 10.10.10.0/30 next-hop 192.168.10.2; } } } LS2 { interfaces { lt-1/2/0 { unit 1 { description LS2->LS1; encapsulation ethernet; peer-unit 0; family inet { address 192.168.10.2/30; } } unit 9 { description LS2->LS3; encapsulation ethernet; peer-unit 10; family inet { address 10.10.10.1/30; } } } } } LS3 { interfaces { lt-1/2/0 { unit 10 { description LS3->LS2; encapsulation ethernet; peer-unit 9; family inet { address 10.10.10.2/30; } } } } routing-options { static { route 192.168.10.0/30 next-hop 10.10.10.1; } } }
확인
구성이 제대로 작동하고 있는지 확인합니다.
논리적 시스템이 구성 중개인가 하는지 확인
목적
인터페이스가 올바르게 구성되었는지 확인합니다.
작업
user@host> show interfaces terse Interface Admin Link Proto Local Remote ... lt-1/2/0 up up lt-1/2/0.0 up up inet 192.168.10.1/30 lt-1/2/0.1 up up inet 192.168.10.2/30 lt-1/2/0.9 up up inet 10.10.10.1/30 lt-1/2/0.10 up up inet 10.10.10.2/30 ...
논리적 시스템 간 연결 검증
목적
정적 경로가 논리적 시스템 LS1 및 LS3의 라우팅 테이블에 표시하는지 확인 또한 논리적 시스템이 서로 핑을 핑(ping)할 수 있는지도 확인해야 합니다.
작업
user@host> show route logical-system LS1 inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.10.10.0/30 *[Static/5] 18:43:25 > to 192.168.10.2 via lt-1/2/0.0 192.168.10.0/30 *[Direct/0] 18:43:25 > via lt-1/2/0.0 192.168.10.1/32 *[Local/0] 18:43:25 Local via lt-1/2/0.0
user@host> show route logical-system LS3 inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.10.10.0/30 *[Direct/0] 23:11:21 > via lt-1/2/0.10 10.10.10.2/32 *[Local/0] 23:11:21 Local via lt-1/2/0.10 192.168.10.0/30 *[Static/5] 00:23:31 > to 10.10.10.1 via lt-1/2/0.10
LS1, Ping LS3에서
user@host> set cli logical-system LS1
user@host:LS1> ping 10.10.10.2 PING 10.10.10.2 (10.10.10.2): 56 data bytes 64 bytes from 10.10.10.2: icmp_seq=0 ttl=63 time=1.263 ms 64 bytes from 10.10.10.2: icmp_seq=1 ttl=63 time=1.086 ms 64 bytes from 10.10.10.2: icmp_seq=2 ttl=63 time=1.077 ms
LS3에서 Ping LS1
user@host> set cli logical-system LS3
user@host:LS3> ping 192.168.10.1 PING 192.168.10.1 (192.168.10.1): 56 data bytes 64 bytes from 192.168.10.1: icmp_seq=0 ttl=63 time=10.781 ms 64 bytes from 192.168.10.1: icmp_seq=1 ttl=63 time=1.167 ms 64 bytes from 192.168.10.1: icmp_seq=2 ttl=63 time=1.152 ms