例: BFD を設定して静的ルートを設定し、ネットワーク障害を迅速に検知
この例では、スタティック ルートに Bidirectional Forwarding Detection(BFD)を設定する方法を示しています。
要件
この例では、デバイス初期化以外の特別な設定は必要ありません。
概要
静的ルートには、実用的な多くの用途があります。スタティック ルーティングは、ネットワーク エッジでしばしば使用され、スタブ ネットワークへの接続をサポートします。これは、エントリとエグレスの単一ポイントを考えると、スタティック ルートのシンプルさに適しています。静的Junos OSはグローバルに 5 に設定されます。指定されたネクスト ホップに到達可能な場合、スタティック ルートがアクティブになります。
この例では、172.16.1.2 のネクスト ホップ アドレスを使用して、プロバイダ ネットワークからカスタマー ネットワークに静的ルート 192.168.47.0/24 を設定します。顧客ネットワークからプロバイダ ネットワークへの 0.0.0.0/0 の静的デフォルト ルートは、172.16.1.1 のネクスト ホップ アドレスを使用して設定します。
デモンストレーションを目的として、一部のループバック インターフェイスはデバイス B およびデバイス D で設定されています。これらのループバック インターフェイスは ping アドレスを提供し、スタティック ルートが動作しているのを検証します。
図 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 ガイド 」の「 設定モードでの CLI Junos OS CLI エディター の使用 」 を参照してください。
スタティック ルート用に 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
デバイス D で静的ルートを作成し、ネクスト ホップ アドレスを設定します。
[edit routing-options] user@D# set static route 0.0.0.0/0 next-hop 172.16.1.1
デバイス D で、静的ルート用に BFD を設定します。
[edit routing-options] user@D# set static route 0.0.0.0/0 bfd-liveness-detection minimum-interval 1000
デバイス 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 interfaces
して show protocols
設定を確認 show routing-options
します。出力結果に意図した設定結果が表示されない場合は、この例の手順を繰り返して設定を修正します。
デバイス 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
は description Site- <xxx> 、デバイスの一部SRX シリーズサポートされています。
各クライアントに複数の説明フィールドがある場合は、最初の説明フィールドとともに「その他」が表示されます。
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 メッセージがトレース ファイルに書き込まれます。