예: 보다 빠른 네트워크 장애 감지를 위한 정적 경로에 대한 BFD 구성
이 예에서는 정적 경로에 대해 BFD(Bidirectional Forwarding Detection)를 구성하는 방법을 보여줍니다.
요구 사항
이 예에서는 디바이스 초기화 이외에는 특별한 구성이 필요하지 않습니다.
개요
정적 경로에 대한 많은 실용적인 애플리케이션이 있습니다. 스텁 네트워크에 대한 첨부 파일을 지원하기 위해 네트워크 에지에서 정적 라우팅이 사용되는 경우가 많습니다. 스텁 네트워크는 단일 진입 지점과 송신을 고려하면 정적 경로의 단순성과 적합합니다. Junos OS에서 정적 경로는 전역 선호도가 5입니다. 지정된 다음 홉에 도달할 수 있는 경우 정적 경로가 활성화됩니다.
이 예에서는 172.16.1.2의 넥스트 홉 주소를 사용하여 프로바이더는 네트워크에서 고객 네트워크로 정적 Route 192.168.47.0/24를 구성합니다. 또한 172.16.1.1의 넥스트 홉 주소를 사용하여 고객 네트워크에서 프로바이더 네트워크로 0.0.0.0/0의 정적 기본 경로를 구성합니다.
데모를 위해 장비 B 및 디바이스 D에 일부 루프백 인터페이스가 구성됩니다. 이러한 루프백 인터페이스는 핑에 주소를 제공하므로 정적 경로가 작동하는지 확인합니다.
그림 1 은 샘플 네트워크를 보여줍니다.
토폴로지
구성
CLI 빠른 구성
이 예제를 신속하게 구성하려면 다음 명령을 복사하여 텍스트 파일에 붙여넣고, 줄 바꿈을 제거하고, 네트워크 구성에 필요한 세부 정보를 변경한 다음, 명령을 복사하여 계층적 수준에서 CLI [edit]
에 붙여넣습니다.
디바이스 B
set interfaces ge-1/2/0 unit 0 description B->D set interfaces ge-1/2/0 unit 0 family inet address 172.16.1.1/24 set interfaces lo0 unit 57 family inet address 10.0.0.1/32 set interfaces lo0 unit 57 family inet address 10.0.0.2/32 set routing-options static route 192.168.47.0/24 next-hop 172.16.1.2 set routing-options static route 192.168.47.0/24 bfd-liveness-detection minimum-interval 1000 set routing-options static route 192.168.47.0/24 bfd-liveness-detection description Site-xxx set protocols bfd traceoptions file bfd-trace set protocols bfd traceoptions flag all
디바이스 D
set interfaces ge-1/2/0 unit 1 description D->B set interfaces ge-1/2/0 unit 1 family inet address 172.16.1.2/24 set interfaces lo0 unit 2 family inet address 192.168.47.5/32 set interfaces lo0 unit 2 family inet address 192.168.47.6/32 set routing-options static route 0.0.0.0/0 next-hop 172.16.1.1 set routing-options static route 0.0.0.0/0 bfd-liveness-detection minimum-interval 1000 set protocols bfd traceoptions file bfd-trace set protocols bfd traceoptions flag all
절차
단계별 절차
다음 예제에서는 구성 계층에서 다양한 레벨을 탐색해야 합니다. CLI 탐색에 대한 자세한 내용은 Junos OS CLI 사용자 가이드의 Configuration 모드에서 CLI Editor를 사용하는 것을 참조하십시오.
정적 경로에 대해 BFD를 구성하려면 다음을 수행합니다.
디바이스 B에서 인터페이스를 구성합니다.
[edit interfaces] user@B# set ge-1/2/0 unit 0 description B->D user@B# set ge-1/2/0 unit 0 family inet address 172.16.1.1/24 user@B# set lo0 unit 57 family inet address 10.0.0.1/32 user@B# set lo0 unit 57 family inet address 10.0.0.2/32
디바이스 B에서 정적 경로를 생성하고 넥스 홉 주소를 설정합니다.
[edit routing-options] user@B# set static route 192.168.47.0/24 next-hop 172.16.1.2
디바이스 B에서 정적 경로에 대해 BFD를 구성합니다.
[edit routing-options] user@B# set static route 192.168.47.0/24 bfd-liveness-detection minimum-interval 1000 set routing-options static route 192.168.47.0/24 bfd-liveness-detection description Site-xxx
디바이스 B에서 BFD에 대한 추적 작업을 구성합니다.
[edit protocols] user@B# set bfd traceoptions file bfd-trace user@B# set bfd traceoptions flag all
디바이스 B 구성을 완료한 경우 구성을 커밋합니다.
[edit] user@B# commit
디바이스 D에서 인터페이스를 구성합니다.
[edit interfaces] user@D# set ge-1/2/0 unit 1 description D->B user@D# set ge-1/2/0 unit 1 family inet address 172.16.1.2/24 user@D# set lo0 unit 2 family inet address 192.168.47.5/32 user@D# set lo0 unit 2 family inet address 192.168.47.6/32
Device D에서 정적 경로를 생성하고 넥트 홉 주소를 설정합니다.
[edit routing-options] user@D# set static route 0.0.0.0/0 next-hop 172.16.1.1
Device D에서 정적 경로에 대한 BFD를 구성합니다.
[edit routing-options] user@D# set static route 0.0.0.0/0 bfd-liveness-detection minimum-interval 1000
Device D에서 BFD에 대한 추적 작업을 구성합니다.
[edit protocols] user@D# set bfd traceoptions file bfd-trace user@D# set bfd traceoptions flag all
디바이스 D 구성을 완료한 경우 구성을 커밋합니다.
[edit] user@D# commit
결과
, show protocols
및 show routing-options
명령을 발행하여 구성을 show interfaces
확인합니다. 출력이 의도한 구성을 표시하지 않는 경우 이 예제의 지침을 반복하여 구성을 수정합니다.
디바이스 B
user@B# show interfaces ge-1/2/0 { unit 0 { description B->D; family inet { address 172.16.1.1/24; } } } lo0 { unit 57 { family inet { address 10.0.0.1/32; address 10.0.0.2/32; } } }
user@D# show protocols bfd { traceoptions { file bfd-trace; flag all; } }
user@B# show routing-options static { route 192.168.47.0/24 { next-hop 172.16.1.2; bfd-liveness-detection { description Site- xxx; minimum-interval 1000; } } }
디바이스 D
user@D# show interfaces ge-1/2/0 { unit 1 { description D->B; family inet { address 172.16.1.2/24; } } } lo0 { unit 2 { family inet { address 192.168.47.5/32; address 192.168.47.6/32; } } }
user@D# show routing-options static { route 0.0.0.0/0 { next-hop 172.16.1.1; bfd-liveness-detection { description Site - xxx; minimum-interval 1000; } } }
확인
구성이 올바르게 작동하는지 확인합니다.
BFD 세션이 가동 중인지 확인
목적
BFD 세션이 시작되었는지 확인하고 BFD 세션에 대한 세부 정보를 확인합니다.
작업
운영 모드에서 명령을 입력합니다 show bfd session extensive
.
user@B> show bfd session extensive Detect Transmit Address State Interface Time Interval Multiplier 172.16.1.2 Up lt-1/2/0.0 3.000 1.000 3 Client Static, description Site-xxx, TX interval 1.000, RX interval 1.000 Session up time 00:14:30 Local diagnostic None, remote diagnostic None Remote state Up, version 1 Replicated, routing table index 172 Min async interval 1.000, min slow interval 1.000 Adaptive async TX interval 1.000, RX interval 1.000 Local min TX interval 1.000, minimum RX interval 1.000, multiplier 3 Remote min TX interval 1.000, min RX interval 1.000, multiplier 3 Local discriminator 2, remote discriminator 1 Echo mode disabled/inactive 1 sessions, 1 clients Cumulative transmit rate 1.0 pps, cumulative receive rate 1.0 pps
SRX description Site- <xxx> 시리즈 디바이스에서만 지원됩니다.
각 클라이언트에 두 개 이상의 설명 필드가 있는 경우 첫 번째 설명 필드와 함께 "and more"가 표시됩니다.
user@D> show bfd session extensive Detect Transmit Address State Interface Time Interval Multiplier 172.16.1.1 Up lt-1/2/0.1 3.000 1.000 3 Client Static, TX interval 1.000, RX interval 1.000 Session up time 00:14:35 Local diagnostic None, remote diagnostic None Remote state Up, version 1 Replicated, routing table index 170 Min async interval 1.000, min slow interval 1.000 Adaptive async TX interval 1.000, RX interval 1.000 Local min TX interval 1.000, minimum RX interval 1.000, multiplier 3 Remote min TX interval 1.000, min RX interval 1.000, multiplier 3 Local discriminator 1, remote discriminator 2 Echo mode disabled/inactive 1 sessions, 1 clients Cumulative transmit rate 1.0 pps, cumulative receive rate 1.0 pps
의미
출력은 TX interval 1.000, RX interval 1.000
명령문으로 minimum-interval
구성된 설정을 나타냅니다. 다른 모든 출력은 BFD의 기본 설정을 나타냅니다. 기본 설정을 수정하려면 명령문 아래에 bfd-liveness-detection
옵션 명령문을 포함하십시오.
상세 BFD 이벤트 보기
목적
BFD 추적 파일의 내용을 보고 필요한 경우 문제 해결을 지원합니다.
작업
운영 모드에서 명령을 입력합니다 file show /var/log/bfd-trace
.
user@B> file show /var/log/bfd-trace Nov 23 14:26:55 Data (9) len 35: (hex) 42 46 44 20 70 65 72 69 6f 64 69 63 20 78 6d 69 74 20 72 Nov 23 14:26:55 PPM Trace: BFD periodic xmit rt tbl index 172 Nov 23 14:26:55 Received Downstream TraceMsg (22) len 108: Nov 23 14:26:55 IfIndex (3) len 4: 0 Nov 23 14:26:55 Protocol (1) len 1: BFD Nov 23 14:26:55 Data (9) len 83: (hex) 70 70 6d 64 5f 62 66 64 5f 73 65 6e 64 6d 73 67 20 3a 20 Nov 23 14:26:55 PPM Trace: ppmd_bfd_sendmsg : socket 12 len 24, ifl 78 src 172.16.1.1 dst 172.16.1.2 errno 65 Nov 23 14:26:55 Received Downstream TraceMsg (22) len 93: Nov 23 14:26:55 IfIndex (3) len 4: 0 Nov 23 14:26:55 Protocol (1) len 1: BFD Nov 23 14:26:55 Data (9) len 68: (hex) 42 46 44 20 70 65 72 69 6f 64 69 63 20 78 6d 69 74 20 74
의미
BFD 메시지가 추적 파일에 기록되고 있습니다.