例: 内部ホスト ピア セッションでの BFD BGP設定
この例では、BFD(Bidirectional Forwarding Detection)プロトコルでIBGP(内部BGPピア セッションを設定して、ネットワークの障害を検出する方法を示しています。
要件
この例を設定する前に、デバイス初期化以外の特別な設定を行う必要はありません。
概要
IBGP セッションで BFD を有効にする最小設定は、ステートメントを BFD セッションに参加しているすべての BGP 設定に bfd-liveness-detection minimum-interval
含めるという方法です。ステートメント minimum-interval
は、障害検知の最小送受信間隔を指定します。具体的には、この値は、ローカル ルーティング デバイスが hello パケットを送信する最小間隔と、BFD セッションを確立したネイバーからの応答を受信するとルーティング デバイスが期待する最小間隔を表します。1~255,000ミリ秒の値を設定できます。
必要に応じて、 および ステートメントを使用して最小送信間隔と受信間隔 transmit-interval minimum-interval
を minimum-receive-interval
個別に指定できます。これらのステートメントおよび他のオプションの BFD 設定ステートメントについては、 を参照 bfd-liveness-detection
してください。
BFD は、システム リソースを消費する集中的なプロトコルです。ルーティング エンジンベースのセッションに100ミリ秒未満の BFD の最小間隔を指定し、分散 BFD セッションで 10 ミリ秒未満を指定すると、BFD フラッピングが不要になる可能性があります。
ネットワーク環境によっては、以下の推奨事項が追加される場合があります。
一般的なスイッチオーバー イベント中に BFD フラッピングをルーティング エンジンするには、アプリケーション ベース のセッションに 5,000 ミリ秒の最小間隔ルーティング エンジンします。この最小値は、一般的な ルーティング エンジン スイッチオーバー イベント中に、RPD、MIBD、SNMPD などのプロセスが指定したしきい値を超える CPU リソースを利用するために必要です。このため、CPU リソースが不足するため、BFD の処理とスケジューリングが影響を受ける可能性があります。
デュアル シャーシ クラスタ制御リンク シナリオ中に BFD セッションが維持される場合、最初の制御リンクに障害が発生した場合、最小間隔 6,000 ミリ秒を指定して、ルーティング エンジン ベースのセッションに対して LACP がセカンダリ ノードにフラッピングされるのを防ぐ。
多数の BFD セッションを持つ大規模なネットワーク導入の場合、ルーティング エンジン ベース のセッションに 300 ミリ秒、分散 BFD セッションで 100 ミリ秒の最小間隔を指定します。
非常に大規模なネットワーク導入と多数の BFD セッションについては、詳細については、カスタマー サポートジュニパーネットワークスにお問い合わせください。
ノンストップ アクティブ ルーティング(NSR)が設定されている場合に、ルーティング エンジン スイッチオーバー イベント中に BFD セッションを維持するには、ルーティング エンジン ベースのセッションに 2,500 ミリ秒の最小間隔を指定します。NSR が設定された分散 BFD セッションでは、最小間隔の推奨事項は変更されず、ネットワークの導入によってのみ異なります。
BFD は、デフォルトのルーティング インスタンス(メイン ルーター)、ルーティング インスタンス、論理システムでサポートされています。この例では、論理システムの BFD を示しています。
図1は、 内部ピアセッションを持つ典型的なネットワークを示しています。

構成
CLI迅速な設定
この例を迅速に設定するには、以下のコマンドをコピーして、テキスト ファイルに貼り付け、改行を削除し、ネットワーク設定に一致する必要がある詳細情報を変更してから、コマンドを階層レベルで CLI にコピー アンド ペースト [edit]
します。
デバイス A
set logical-systems A interfaces lt-1/2/0 unit 1 description to-B set logical-systems A interfaces lt-1/2/0 unit 1 encapsulation ethernet set logical-systems A interfaces lt-1/2/0 unit 1 peer-unit 2 set logical-systems A interfaces lt-1/2/0 unit 1 family inet address 10.10.10.1/30 set logical-systems A interfaces lo0 unit 1 family inet address 192.168.6.5/32 set logical-systems A protocols bgp group internal-peers type internal set logical-systems A protocols bgp group internal-peers traceoptions file bgp-bfd set logical-systems A protocols bgp group internal-peers traceoptions flag bfd detail set logical-systems A protocols bgp group internal-peers local-address 192.168.6.5 set logical-systems A protocols bgp group internal-peers export send-direct set logical-systems A protocols bgp group internal-peers bfd-liveness-detection minimum-interval 1000 set logical-systems A protocols bgp group internal-peers neighbor 192.163.6.4 set logical-systems A protocols bgp group internal-peers neighbor 192.168.40.4 set logical-systems A protocols ospf area 0.0.0.0 interface lo0.1 passive set logical-systems A protocols ospf area 0.0.0.0 interface lt-1/2/0.1 set logical-systems A policy-options policy-statement send-direct term 2 from protocol direct set logical-systems A policy-options policy-statement send-direct term 2 then accept set logical-systems A routing-options router-id 192.168.6.5 set logical-systems A routing-options autonomous-system 17
デバイス B
set logical-systems B interfaces lt-1/2/0 unit 2 description to-A set logical-systems B interfaces lt-1/2/0 unit 2 encapsulation ethernet set logical-systems B interfaces lt-1/2/0 unit 2 peer-unit 1 set logical-systems B interfaces lt-1/2/0 unit 2 family inet address 10.10.10.2/30 set logical-systems B interfaces lt-1/2/0 unit 5 description to-C set logical-systems B interfaces lt-1/2/0 unit 5 encapsulation ethernet set logical-systems B interfaces lt-1/2/0 unit 5 peer-unit 6 set logical-systems B interfaces lt-1/2/0 unit 5 family inet address 10.10.10.5/30 set logical-systems B interfaces lo0 unit 2 family inet address 192.163.6.4/32 set logical-systems B protocols bgp group internal-peers type internal set logical-systems B protocols bgp group internal-peers local-address 192.163.6.4 set logical-systems B protocols bgp group internal-peers export send-direct set logical-systems B protocols bgp group internal-peers bfd-liveness-detection minimum-interval 1000 set logical-systems B protocols bgp group internal-peers neighbor 192.168.40.4 set logical-systems B protocols bgp group internal-peers neighbor 192.168.6.5 set logical-systems B protocols ospf area 0.0.0.0 interface lo0.2 passive set logical-systems B protocols ospf area 0.0.0.0 interface lt-1/2/0.2 set logical-systems B protocols ospf area 0.0.0.0 interface lt-1/2/0.5 set logical-systems B policy-options policy-statement send-direct term 2 from protocol direct set logical-systems B policy-options policy-statement send-direct term 2 then accept set logical-systems B routing-options router-id 192.163.6.4 set logical-systems B routing-options autonomous-system 17
デバイス C
set logical-systems C interfaces lt-1/2/0 unit 6 description to-B set logical-systems C interfaces lt-1/2/0 unit 6 encapsulation ethernet set logical-systems C interfaces lt-1/2/0 unit 6 peer-unit 5 set logical-systems C interfaces lt-1/2/0 unit 6 family inet address 10.10.10.6/30 set logical-systems C interfaces lo0 unit 3 family inet address 192.168.40.4/32 set logical-systems C protocols bgp group internal-peers type internal set logical-systems C protocols bgp group internal-peers local-address 192.168.40.4 set logical-systems C protocols bgp group internal-peers export send-direct set logical-systems C protocols bgp group internal-peers bfd-liveness-detection minimum-interval 1000 set logical-systems C protocols bgp group internal-peers neighbor 192.163.6.4 set logical-systems C protocols bgp group internal-peers neighbor 192.168.6.5 set logical-systems C protocols ospf area 0.0.0.0 interface lo0.3 passive set logical-systems C protocols ospf area 0.0.0.0 interface lt-1/2/0.6 set logical-systems C policy-options policy-statement send-direct term 2 from protocol direct set logical-systems C policy-options policy-statement send-direct term 2 then accept set logical-systems C routing-options router-id 192.168.40.4 set logical-systems C routing-options autonomous-system 17
デバイス A の設定
手順
次の例では、設定階層内のさまざまなレベルに移動する必要があります。デバイスのナビゲーションの詳細については、「 CLI CLI ガイド 」 の「 設定モードでの CLI エディターの使用 」を 参照してください。
デバイス A を設定するには、以下の手順にアクセスします。
物理リンクをCLIシステム A に設定します。
user@host> set cli logical-system A
インターフェイスを設定します。
[edit interfaces lt-1/2/0 unit 1] user@host:A# set description to-B user@host:A# set encapsulation ethernet user@host:A# set peer-unit 2 user@host:A# set family inet address 10.10.10.1/30 [edit interfaces lo0 unit 1] user@host:A# set family inet address 192.168.6.5/32
設定BGP。
デバイス A がデバイス C に直接接続されていない場合でも、ステートメントはデバイス B とデバイス C の両方
neighbor
に含まれます。[edit protocols bgp group internal-peers] user@host:A# set type internal user@host:A# set local-address 192.168.6.5 user@host:A# set export send-direct user@host:A# set neighbor 192.163.6.4 user@host:A# set neighbor 192.168.40.4
BFD を設定します。
[edit protocols bgp group internal-peers] user@host:A# set bfd-liveness-detection minimum-interval 1000
接続ピアで同じ最小間隔を設定する必要があります。
(オプション)BFD トレースを設定します。
[edit protocols bgp group internal-peers] user@host:A# set traceoptions file bgp-bfd user@host:A# set traceoptions flag bfd detail
設定OSPF。
[edit protocols ospf area 0.0.0.0] user@host:A# set interface lo0.1 passive user@host:A# set interface lt-1/2/0.1
直接ルートを受け入れるポリシーを設定します。
このシナリオで役立つその他のオプションは、ネットワーク ルートまたはローカル ルートを通じて学習したOSPF受け入れる場合があります。
[edit policy-options policy-statement send-direct term 2] user@host:A# set from protocol direct user@host:A# set then accept
ルーター ID と自律システム(AS)番号を設定します。
[edit routing-options] user@host:A# set router-id 192.168.6.5 user@host:A# set autonomous-system 17
デバイスの設定が完了したら、設定モード
commit
から を入力します。 これらの手順を繰り返して、デバイス B とデバイス C を設定します。
結果
設定モードから、 、および のコマンド show interfaces
を入力して show policy-options
show protocols
設定を確認 show routing-options
します。出力結果に意図した設定結果が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@host:A# show interfaces lt-1/2/0 { unit 1 { description to-B; encapsulation ethernet; peer-unit 2; family inet { address 10.10.10.1/30; } } } lo0 { unit 1 { family inet { address 192.168.6.5/32; } } }
user@host:A# show policy-options policy-statement send-direct { term 2 { from protocol direct; then accept; } }
user@host:A# show protocols bgp { group internal-peers { type internal; traceoptions { file bgp-bfd; flag bfd detail; } local-address 192.168.6.5; export send-direct; bfd-liveness-detection { minimum-interval 1000; } neighbor 192.163.6.4; neighbor 192.168.40.4; } } ospf { area 0.0.0.0 { interface lo0.1 { passive; } interface lt-1/2/0.1; } }
user@host:A# show routing-options router-id 192.168.6.5; autonomous-system 17;
検証
設定が正常に機能されていることを確認します。
BFD が有効になっている検証
目的
IBGP ピア間で BFD が有効になっているか検証します。
アクション
動作モードから コマンドを入力 show bgp neighbor
します。フィルタを使用して | match bfd
出力を絞り込む
user@host:A> show bgp neighbor | match bfd Options: <BfdEnabled> BFD: enabled, up Trace file: /var/log/A/bgp-bfd size 131072 files 10 Options: <BfdEnabled> BFD: enabled, up Trace file: /var/log/A/bgp-bfd size 131072 files 10
意味
この出力では、論理システム A には BFD が有効になっている 2 つのネイバーが設定されています。BFD が有効になっていない場合、出力は表示 BFD: disabled, down
され、 <BfdEnabled>
オプションは大分になります。BFD が有効でセッションがダウンしている場合、出力に BFD: enabled, down
.出力はまた、トレース操作が設定されたため、BFD 関連のイベントがログ ファイルに書き込されていることを示しています。
BFD セッションがアップの確認
目的
BFD セッションがアップしているのを検証し、BFD セッションの詳細を表示します。
アクション
動作モードから コマンドを入力 show bfd session extensive
します。
user@host:A> show bfd session extensive Detect Transmit Address State Interface Time Interval Multiplier 192.163.6.4 Up 3.000 1.000 3 Client BGP, TX interval 1.000, RX interval 1.000 Session up time 00:54:40 Local diagnostic None, remote diagnostic None Remote state Up, version 1 Logical system 12, routing table index 25 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 10, remote discriminator 9 Echo mode disabled/inactive Multi-hop route table 25, local-address 192.168.6.5 Detect Transmit Address State Interface Time Interval Multiplier 192.168.40.4 Up 3.000 1.000 3 Client BGP, TX interval 1.000, RX interval 1.000 Session up time 00:48:03 Local diagnostic None, remote diagnostic None Remote state Up, version 1 Logical system 12, routing table index 25 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 14, remote discriminator 13 Echo mode disabled/inactive Multi-hop route table 25, local-address 192.168.6.5 2 sessions, 2 clients Cumulative transmit rate 2.0 pps, cumulative receive rate 2.0 pps
意味
出力 TX interval 1.000, RX interval 1.000
は、 ステートメントで設定された設定を表 minimum-interval
します。その他のすべての出力は、BFD のデフォルト設定を表しています。デフォルト設定を変更するには、 ステートメントの下に オプションのステートメントを含 bfd-liveness-detection
める必要があります。
詳細な BFD イベントの表示
目的
BFD トレース ファイルの内容を表示して、必要に応じてトラブルシューティングをサポートします。
アクション
動作モードから コマンドを入力 file show /var/log/A/bgp-bfd
します。
user@host:A> file show /var/log/A/bgp-bfd Aug 15 17:07:25 trace_on: Tracing to "/var/log/A/bgp-bfd" started Aug 15 17:07:26.492190 bgp_peer_init: BGP peer 192.163.6.4 (Internal AS 17) local address 192.168.6.5 not found. Leaving peer idled Aug 15 17:07:26.493176 bgp_peer_init: BGP peer 192.168.40.4 (Internal AS 17) local address 192.168.6.5 not found. Leaving peer idled Aug 15 17:07:32.597979 task_connect: task BGP_17.192.163.6.4+179 addr 192.163.6.4+179: No route to host Aug 15 17:07:32.599623 bgp_connect_start: connect 192.163.6.4 (Internal AS 17): No route to host Aug 15 17:07:36.869394 task_connect: task BGP_17.192.168.40.4+179 addr 192.168.40.4+179: No route to host Aug 15 17:07:36.870624 bgp_connect_start: connect 192.168.40.4 (Internal AS 17): No route to host Aug 15 17:08:04.599220 task_connect: task BGP_17.192.163.6.4+179 addr 192.163.6.4+179: No route to host Aug 15 17:08:04.601135 bgp_connect_start: connect 192.163.6.4 (Internal AS 17): No route to host Aug 15 17:08:08.869717 task_connect: task BGP_17.192.168.40.4+179 addr 192.168.40.4+179: No route to host Aug 15 17:08:08.869934 bgp_connect_start: connect 192.168.40.4 (Internal AS 17): No route to host Aug 15 17:08:36.603544 advertising receiving-speaker only capabilty to neighbor 192.163.6.4 (Internal AS 17) Aug 15 17:08:36.606726 bgp_read_message: 192.163.6.4 (Internal AS 17): 0 bytes buffered Aug 15 17:08:36.609119 Initiated BFD session to peer 192.163.6.4 (Internal AS 17): address=192.163.6.4 ifindex=0 ifname=(none) txivl=1000 rxivl=1000 mult=3 ver=255 Aug 15 17:08:36.734033 advertising receiving-speaker only capabilty to neighbor 192.168.40.4 (Internal AS 17) Aug 15 17:08:36.738436 Initiated BFD session to peer 192.168.40.4 (Internal AS 17): address=192.168.40.4 ifindex=0 ifname=(none) txivl=1000 rxivl=1000 mult=3 ver=255 Aug 15 17:08:40.537552 BFD session to peer 192.163.6.4 (Internal AS 17) up Aug 15 17:08:40.694410 BFD session to peer 192.168.40.4 (Internal AS 17) up
意味
ルートが確立される前に、 No route to host
メッセージが出力に表示されます。ルートが確立された後、最後の 2 行には、両方の BFD セッションが設定されます。
ループバック インターフェイスの非アクティブ化と再有効化後の詳細な BFD イベントの表示
目的
ルーターやスイッチをダウンして動作を戻した後、何が起こっているかを確認します。ルーターやスイッチの停止をシミュレーションするには、論理システム B のループバック インターフェイスを非アクティブにします。
アクション
設定モードから コマンドを入力
deactivate logical-systems B interfaces lo0 unit 2 family inet
します。user@host:A# deactivate logical-systems B interfaces lo0 unit 2 family inet user@host:A# commit
動作モードから コマンドを入力
file show /var/log/A/bgp-bfd
します。user@host:A> file show /var/log/A/bgp-bfd ... Aug 15 17:20:55.995648 bgp_read_v4_message:9747: NOTIFICATION received from 192.163.6.4 (Internal AS 17): code 6 (Cease) subcode 6 (Other Configuration Change) Aug 15 17:20:56.004508 Terminated BFD session to peer 192.163.6.4 (Internal AS 17) Aug 15 17:21:28.007755 task_connect: task BGP_17.192.163.6.4+179 addr 192.163.6.4+179: No route to host Aug 15 17:21:28.008597 bgp_connect_start: connect 192.163.6.4 (Internal AS 17): No route to host
設定モードから コマンドを入力
activate logical-systems B interfaces lo0 unit 2 family inet
します。user@host:A# activate logical-systems B interfaces lo0 unit 2 family inet user@host:A# commit
動作モードから コマンドを入力
file show /var/log/A/bgp-bfd
します。user@host:A> file show /var/log/A/bgp-bfd ... Aug 15 17:25:53.623743 advertising receiving-speaker only capabilty to neighbor 192.163.6.4 (Internal AS 17) Aug 15 17:25:53.631314 Initiated BFD session to peer 192.163.6.4 (Internal AS 17): address=192.163.6.4 ifindex=0 ifname=(none) txivl=1000 rxivl=1000 mult=3 ver=255 Aug 15 17:25:57.570932 BFD session to peer 192.163.6.4 (Internal AS 17) up