BGP エラーメッセージ
BGP 更新メッセージのエラー処理について
いずれかのメッセージ属性が異常な場合、BGP メッセージは異常と見なされます。BGP セッションに参加しているルーターが不正な更新メッセージを受信すると、セッション全体がデフォルトでリセットされます。有効なルートを持つ更新メッセージも影響を受けるので、これは望ましくないものです。この望ましくない動作を回避するには、BGP 更新メッセージのエラー処理を変更する必要があります。
BGP 更新メッセージのエラー処理を設定するには、ステートメントを bgp-error-tolerance
、 、または[edit protocols bgp group group-name neighbor address]
階層レベルで[edit protocols bgp]
設定[edit protocols bgp group group-name]
します。
bgp-error-tolerance { malformed-route-limit number; malformed-update-log-interval seconds; no-malformed-route-limit; }
属性に属性タイプ フィールドの値と競合する属性フラグが含まれている場合、属性フラグは正しい値にリセットされ、更新メッセージが処理されます。属性フラグの拡張長ビットの値は、属性長が 1 つまたは 2 つのオクテットであるかどうかを定義するため、変更されません。そのため、属性フラグの値は BGP 更新パケットの解析方法に影響します。
パス属性の属性フラグ値の明示的な仕様はありません。
異常な更新メッセージは、メッセージに含まれる属性の値に応じて、ケースごとに処理されます。異常な BGP 更新メッセージを処理する方法は 3 種類あり、重大度は減少しています。
Notification message approach—異常なメッセージ エラーがローカルに記録され、エラー コード更新メッセージがピアの管理に送信され、BGP セッション全体がリセットされます。
このアプローチは、次の場合に選択されます。
BGP 更新メッセージには、MP reach 属性または MP unreach 属性が含まれています。
属性長と属性長フィールドの値が一致しないため、NLRI フィールドまたは BGP 更新メッセージを正しく解析できません。
Treat-as-withdraw approach—不正な形式の更新メッセージ内のすべてのルートは、ステートメントが設定されていない限り
keep none
、非表示ルートとして扱われ、その場合はルートが破棄されます。ステートメントがないkeep none
場合は、非表示の異常ルートの数に制限が設定され、これを超えるとルートが破棄され、不正なルートが非表示にならないようにします。Junos OS は、異常なルート制限に達すると、新しく受信した不正なルートを削除します。Attribute discard approach更新メッセージ内の異常な属性は破棄されます。ただし、メッセージは処理されます。破棄する属性がルート選択またはインストールに影響する可能性がある場合は、このアプローチを使用することはお勧めできません。
注:更新メッセージに属性が複数回表示された場合、最初以外の属性のすべてのオカレンスが破棄され、メッセージが処理されます。
BGP 更新メッセージは、以下の属性についてスキャンされ、これらの属性の値に基づいて異常な形式として扱われます。
The origin attribute—取り消し扱いアプローチで処理されます。
The AS path attribute—取り消し扱いアプローチで処理されます。
The AS 4 path attribute属性破棄アプローチで処理されます。属性タイプ コードと競合する属性フラグがある属性がある場合、Junos OS は属性フラグを正しい値にリセットします。更新メッセージは引き続き処理されます。
Junos OS では、属性フラグの拡張長ビットの値は変更されません。このビットは、属性の長さが 1 オクテットか 2 オクテットかを定義します。このフラグの値は、BGP パケットの解析方法に影響します。パス属性に対してこの値を明示的に指定する必要はありません。
The aggregator attribute属性破棄アプローチで処理されます。
The aggregator 4 attribute属性破棄アプローチで処理されます。
The next-hop attribute—取り消し扱いアプローチで処理されます。
The multiple exit discriminator attribute—取り消し扱いアプローチで処理されます。
The local preference attribute—取り消し扱いアプローチで処理されます。
The atomic aggregate attribute属性破棄アプローチで処理されます。
The community attribute—取り消し扱いアプローチで処理されます。
The extended community attribute—取り消し扱いアプローチで処理されます。
The originator attribute—取り消し扱いアプローチで処理されます。
The cluster attribute—取り消し扱いアプローチで処理されます。
The PMSI attribute—取り消し扱いアプローチで処理されます。
The MP reach attribute—通知メッセージ アプローチによって処理されます。
The MP unreach attribute—通知メッセージ アプローチによって処理されます。
The attribute set attribute—取り消し扱いアプローチで処理されます。
The AIGP attribute—取り消し扱いアプローチで処理されます。
Unknown attribute—BGP フラグがこれがオプションの属性であることを示していない場合、この不正な属性は通知メッセージ アプローチによって処理されます。
BGP 更新メッセージに複数の不正な属性が含まれている場合、その属性のいずれかによってトリガーされる最も重大なアプローチに従います。
関連項目
例:BGP 更新メッセージのエラー処理の設定
この例では、BGP エラー処理を設定する方法を示しています。
要件
開始する前に、以下を行います。
ルーター インターフェイスを設定します。
IGP(Interior Gateway Protocol)を設定します。
BGP を設定します。
ルーティング ポリシーを設定します。
概要
ルーティング デバイスが不正な属性を持つ更新メッセージを受信すると、ルーターはセッションをリセットする必要があります。これは、RFC 4271、 境界ゲートウェイ プロトコル 4(BGP-4)で指定されています。セッションは、問題のある属性を持つルートだけでなく、セッションを介して交換されるその他の有効なルートにも影響を与えます。さらに、この動作は、オプションの推移的な属性の場合に潜在的なセキュリティの脆弱性を提示する可能性があります。不正な更新メッセージによるルーティングへの影響を最小限に抑えるために、インターネット ドラフト draft-ietf-idr-error-handling-01.txt、 改訂 BGP UPDATE メッセージのエラー処理 は、不正な属性を持つ BGP 更新メッセージを処理するための変更を指定します。新しいエラー処理により、確立されたセッションを維持し、有効なルート交換を維持しながら、不正な UPDATE メッセージで運ばれるルートを削除できます。
トポロジ
で 図 1、デバイスR1は、デバイスR0との内部BGPピアリングセッション、およびデバイスR2との外部BGPピアリングセッションを持っています。

ネットワークの不安定性を引き起こす不正な更新メッセージから保護するために、デバイスR1にはBGPエラー処理が設定されています。
bgp-error-tolerance { malformed-update-log-interval 10; malformed-route-limit 5; }
デフォルトでは、いずれかのメッセージ属性が異常な場合、BGP メッセージは異常と見なされます。BGP セッションに参加しているルーターが不正な更新メッセージを受信すると、セッション全体がリセットされます。ステートメントは bgp-error-tolerance
、次の BGP エラー処理が有効になるように、この動作をオーバーライドします。
致命的なエラーが発生した場合、Junos OS はエラー コード更新メッセージという名前の通知メッセージを送信し、BGP セッションをリセットします。MP_{UN}REACH 属性のエラーは致命的であると見なされます。1 つの BGP 更新で複数のMP_{UN}REACH 属性が存在することも致命的なエラーと見なされます。Junos OS は、NLRI フィールドまたは BGP 更新を正しく解析できない場合、BGP セッションをリセットします。属性の長さが属性値の長さと一致しない場合、BGP 更新パケットの解析に失敗する可能性があります。
一部の非エラーの場合、Junos OS は、不正な BGP 更新メッセージに含まれるすべてのルートを取り消されたルートとして扱い、BGP にステートメントが含まれていない場合
keep none
は非表示としてインストールします。Junos OS では、以下のいずれかの属性が関係する場合に、このエラー処理アプローチを使用します。ORIGIN、AS_PATH、NEXT_HOP、MULTI_EXIT_DISC、LOCAL_PREF、ORIGINATOR、CLUSTER、ATTRSET、PMSI、コミュニティ、拡張コミュニティ。さらに、必須の既知のパス属性のいずれかが欠落している場合、Junos OS は BGP 更新を不正な形式として扱います。これらの不正な形式の非表示ルートのメモリ使用量を制限するために、Junos OS は、不正な形式の非表示ルートの最大数に達した後、新しい異常な非表示ルートのインストールを停止します。この例では、ステートメントを使用してmalformed-route-limit
最大数が 5 に設定されています。デフォルト値は 1000 です。必要に応じて、異常な属性によって非表示になるルートを無制限に許可できます。これを行うには、ステートメントをno-malformed-route-limit
含めます。その他の非エラーの場合、Junos OS は不正なパス属性を破棄し、引き続き BGP 更新メッセージを処理します。ルート選択やインストールに影響を与える可能性のあるパス属性にこのアプローチを使用するのは安全ではありません。Junos OS では、以下のいずれかの属性が関係する場合に、このエラー処理アプローチを使用します。ATOMIC_AGGREGATE、アグリゲータ、アグリゲータ4、AS4PATHです。
Junos OS は、異常なパケットのトラブルシューティングを容易にするために、異常なパス属性コード、フラグ、長さ、ピアおよびファミリーに関する情報、および不正な BGP 更新からの最初のプレフィックスを示すエラーをログに記録します。異常なパケットを短時間で大量に受信すると、異常なパケットのロギングによって Junos OS のパフォーマンスが低下する可能性があります。パフォーマンスへの影響を制限するために、Junos OS は、異常な更新をログに記録し、一定間隔のロギングを抑制し、サマリーをログに記録するアルゴリズムを実装しています。ロギング抑制タイマーが期限切れになると、ソフトウェアは間隔中に受信した不正な属性の総数をログに記録します。この例では、タイマーはステートメントを使用して 10 秒に malformed-update-log-interval
設定されています。デフォルト値は 300 秒(5 分)です。
CLI クイック設定 でのすべてのデバイス 図 1の設定を示しています。
このセクション #d100e116__d100e307 では、デバイス R1 の手順について説明します。
設定
CLI クイック設定
この例を迅速に設定するには、次のコマンドをコピーしてテキスト ファイルに貼り付け、改行を削除し、ネットワーク設定に一致するために必要な詳細情報を変更してから、コマンドを階層レベルで [edit]
CLI にコピーアンドペーストします。
デバイス R0
set interfaces fe-1/2/0 unit 0 description to-R1 set interfaces fe-1/2/0 unit 0 family inet address 172.16.10.5/30 set interfaces lo0 unit 0 family inet address 192.168.0.3/32 set protocols bgp group internal-peers type internal set protocols bgp group internal-peers local-address 192.168.0.3 set protocols bgp group internal-peers export local-direct set protocols bgp group internal-peers neighbor 192.168.0.1 set protocols ospf area 0.0.0.0 interface fe-1/2/0.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set policy-options policy-statement local-direct from protocol [local direct] set policy-options policy-statement local-direct then accept set routing-options autonomous-system 64510 set routing-options router-id 192.168.0.3
デバイスR1
set interfaces fe-1/2/1 unit 0 description to-R2 set interfaces fe-1/2/1 unit 0 family inet address 10.10.10.1/30 set interfaces fe-1/2/0 unit 0 description to-R0 set interfaces fe-1/2/0 unit 0 family inet address 172.16.10.6/30 set interfaces lo0 unit 0 family inet address 192.168.0.1/32 set protocols bgp bgp-error-tolerance malformed-update-log-interval 10 set protocols bgp bgp-error-tolerance malformed-route-limit 5 set protocols bgp group internal-peers type internal set protocols bgp group internal-peers local-address 192.168.0.1 set protocols bgp group internal-peers export local-direct set protocols bgp group internal-peers neighbor 192.168.0.3 set protocols bgp group external-peers type external set protocols bgp group external-peers export local-direct set protocols bgp group external-peers peer-as 64511 set protocols bgp group external-peers neighbor 10.10.10.2 set protocols ospf area 0.0.0.0 interface fe-1/2/1.0 set protocols ospf area 0.0.0.0 interface fe-1/2/0.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set policy-options policy-statement local-direct from protocol [local direct] set policy-options policy-statement local-direct then accept set routing-options autonomous-system 64510 set routing-options router-id 192.168.0.1
デバイスR2
set interfaces fe-1/2/1 unit 0 description to-R1 set interfaces fe-1/2/1 unit 0 family inet address 10.10.10.2/30 set interfaces lo0 unit 0 family inet address 192.168.0.2/32 set protocols bgp group external-peers type external set protocols bgp group external-peers export local-direct set protocols bgp group external-peers peer-as 64510 set protocols bgp group external-peers neighbor 10.10.10.1 set protocols ospf area 0.0.0.0 interface fe-1/2/1.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set policy-options policy-statement local-direct from protocol [local direct] set policy-options policy-statement local-direct then accept set routing-options autonomous-system 64511 set routing-options router-id 192.168.10.2
手順
手順
次の例では、設定階層のさまざまなレベルに移動する必要があります。CLI のナビゲーションの詳細については、『Junos OS CLI ユーザー ガイド』の「設定モードでの CLI エディターの使用」を参照してください。
BGP エラー処理を設定するには、次の手順にしたがっています。
ルーター インターフェイスを設定します。
[edit interfaces] user@R1# set fe-1/2/1 unit 0 description to-R2 user@R1# set fe-1/2/1 unit 0 family inet address 10.10.10.1/30 user@R1# set fe-1/2/0 unit 0 description to-R0 user@R1# set fe-1/2/0 unit 0 family inet address 172.16.10.6/30 user@R1# set lo0 unit 0 family inet address 192.168.0.1/32
OSPF や IS-IS などの IGP(Interior Gateway Protocol)を設定します。
[edit protocols ospf area 0.0.0.0] user@R1# set interface fe-1/2/1.0 user@R1# set interface fe-1/2/0.0 user@R1# set interface lo0.0 passive
自律システム(AS)番号とルーターIDを設定します。
[edit routing-options] user@R1# set autonomous-system 64510 user@R1# set router-id 192.168.0.1
ルーティング ポリシーを設定します。
[edit policy-options policy-statement local-direct] user@R1# set from protocol [local direct] user@R1# set then accept
EBGPセッションを設定します。
[edit protocols bgp group external-peers] user@R1# set type external user@R1# set export local-direct user@R1# set peer-as 64511 user@R1# set neighbor 10.10.10.2
IBGP セッションを設定します。
[edit protocols bgp group internal-peers] user@R1# set type internal user@R1# set local-address 192.168.0.1 user@R1# set export local-direct user@R1# set neighbor 192.168.0.3
BGP エラー許容度を有効にします。
[edit protocols bgp] user@R1# set bgp-error-tolerance
(オプション)ログ間隔を設定します。
[edit protocols bgp bgp-error-tolerance] user@R1# set malformed-update-log-interval 10
(オプション)保存する非表示ルート数の制限を設定します。
[edit protocols bgp bgp-error-tolerance] user@R1# set malformed-route-limit 5
結果
設定モードから、 、 、 、 および 、 コマンドをshow interfaces
入力して設定をshow routing-options
確認します。 show policy-options
show protocols
出力に意図した設定が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@R1# show interfaces
fe-1/2/0 {
unit 0 {
description to-R0;
family inet {
address 172.16.10.6/30;
}
}
}
fe-1/2/1 {
unit 0 {
description to-R2;
family inet {
address 10.10.10.1/30;
}
}
}
lo0 {
unit 0 {
family inet {
address 192.168.0.1/32;
}
}
}
user@R1# show protocols
bgp {
bgp-error-tolerance {
malformed-update-log-interval 10;
malformed-route-limit 5;
}
group internal-peers {
type internal;
local-address 192.168.0.1;
export local-direct;
neighbor 192.168.0.3;
}
group external-peers {
type external;
export local-direct;
peer-as 64511;
neighbor 10.10.10.2;
}
}
ospf {
area 0.0.0.0 {
interface fe-1/2/1.0;
interface fe-1/2/0.0;
interface lo0.0 {
passive;
}
}
}
user@R1# show policy-options
policy-statement local-direct {
from protocol [local direct];
then accept;
}
user@R1# show routing-options
router-id 192.168.0.1;
autonomous-system 64510;
デバイスの設定が完了したら、設定モードから入力 commit
します。
検証
設定が正しく機能していることを確認します。
BGP ネイバー セッションの確認
目的
BGP エラー許容度が有効になっていることを確認し、異常なパス属性に関連するカウンターを表示します。
対処
user@R1# show bgp neighbor Peer: 10.10.10.2+50058 AS 64511 Local: 10.10.10.1+179 AS 64510 Type: External State: Established Flags: <Sync> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None Export: [ local-direct ] Options: <Preference PeerAS Refresh> Holdtime: 90 Preference: 170 Number of flaps: 0 Malformed attributes log interval: 10 route limit: 5 Attribute: ORIGIN(1) Last Received: 0 Total Received: 3 Attribute: LOCAL_PREF(5) Last Received: 0 Total Received: 2 Peer ID: 192.168.10.2 Local ID: 192.168.10.1 Active Holdtime: 90 Keepalive Interval: 30 Group index: 0 Peer index: 0 BFD: disabled, down Local Interface: fe-1/2/1.0 NLRI for restart configured on peer: inet-unicast NLRI advertised by peer: inet-unicast NLRI for this session: inet-unicast Peer supports Refresh capability (2) Stale routes from peer are kept for: 300 Peer does not support Restarter functionality NLRI that restart is negotiated for: inet-unicast NLRI of received end-of-rib markers: inet-unicast NLRI of all end-of-rib markers sent: inet-unicast Peer supports 4 byte AS extension (peer-as 64511) Peer does not support Addpath Table inet.0 Bit: 10000 RIB State: BGP restart is complete Send state: in sync Active prefixes: 0 Received prefixes: 3 Accepted prefixes: 0 Suppressed due to damping: 0 Advertised prefixes: 2 Last traffic (seconds): Received 25 Sent 17 Checked 73 Input messages: Total 2702 Updates 10 Refreshes 0 Octets 51652 Output messages: Total 2701 Updates 6 Refreshes 0 Octets 51571 Output Queue[0]: 0 Peer: 192.168.10.3+179 AS 64510 Local: 192.168.10.1+51127 AS 64510 Type: Internal State: Established Flags: <Sync> Last State: OpenConfirm Last Event: RecvKeepAlive Last Error: None Export: [ local-direct ] Options: <Preference LocalAddress Refresh> Local Address: 192.168.10.1 Holdtime: 90 Preference: 170 Number of flaps: 0 Malformed attributes log interval: 10 route limit: 5 Peer ID: 192.168.10.3 Local ID: 192.168.10.1 Active Holdtime: 90 Keepalive Interval: 30 Group index: 1 Peer index: 0 BFD: disabled, down NLRI for restart configured on peer: inet-unicast NLRI advertised by peer: inet-unicast NLRI for this session: inet-unicast Peer supports Refresh capability (2) Stale routes from peer are kept for: 300 Peer does not support Restarter functionality NLRI that restart is negotiated for: inet-unicast NLRI of received end-of-rib markers: inet-unicast NLRI of all end-of-rib markers sent: inet-unicast Peer supports 4 byte AS extension (peer-as 64510) Peer does not support Addpath Table inet.0 Bit: 10001 RIB State: BGP restart is complete Send state: in sync Active prefixes: 0 Received prefixes: 3 Accepted prefixes: 0 Suppressed due to damping: 0 Advertised prefixes: 2 Last traffic (seconds): Received 5 Sent 24 Checked 51 Input messages: Total 417 Updates 3 Refreshes 0 Octets 8006 Output messages: Total 421 Updates 2 Refreshes 0 Octets 8136 Output Queue[0]: 0
意味
[異常な属性] フィールドは、エラー許容度が有効になっていることを示しています。ログ間隔およびルート制限フィールドには、設定済みの値が表示されます。
属性カウンターは、EBGP 接続で、複数の異常な属性がデバイス R2 から受信したことを示しています。
非表示ルートのチェック
目的
非表示ルートに関する情報を表示し、非表示になっている理由を確認します。
対処
user@R1> show route hidden detail inet.0: 42 destinations, 45 routes (36 active, 0 holddown, 6 hidden) 10.0.0.0/32 (1 entry, 0 announced) BGP Next hop type: Router Address: 0x93d8b0c Next-hop reference count: 5 Source: 10.10.10.2 Next hop type: Router, Next hop index: 782 Next hop: via fe-1/2/1.0, selected Session Id: 0x1 State: <Hidden Ext> Local AS: 1 Peer AS: 1 Age: 5:32 Metric2: 1 Validation State: unverified Task: BGP_1.10.10.5.62+56218 AS path: I (MalformedAttr) Router ID: 192.168.0.2 10.0.0.1/32 (1 entry, 0 announced) BGP Next hop type: Router Address: 0x93d8b0c Next-hop reference count: 5 Source: 10.10.10.2 Next hop type: Router, Next hop index: 782 Next hop: via fe-1/2/1.0, selected Session Id: 0x1 Indirect next hop: 953c000 - INH Session ID: 0x3 State: <Hidden Int Ext> Local AS: 1 Peer AS: 1 Age: 5:32 Metric2: 1 Validation State: unverified Task: BGP_1.10.10.5.62+56218 AS path: I (MalformedAttr) Router ID: 192.168.0.2
意味
不正な形式の非表示ルートは、ASパスフィールドに不正なAttrとしてマークされます。
コマンドを実行すると、非表示ルートを clear bgp neighbor 10.10.10.2 malformed-route
削除できます。
非表示ルートの送信元の検証
目的
非表示ルートに関する情報を表示し、非表示になっている理由を確認します。
対処
user@R1> show route receive-protocol bgp 10.10.10.2 detail hidden inet.0: 42 destinations, 45 routes (36 active, 0 holddown, 6 hidden) 10.0.0.0/32 (1 entry, 0 announced) Nexthop: 10.10.10.2 Localpref: 100 AS path: I (MalformedAttr) 10.0.0.1/32 (1 entry, 0 announced) Nexthop: 10.10.10.2 Localpref: 100 AS path: I (MalformedAttr)
意味
Junos OSは、コマンドの出力のASパスフィールドに、異常なAttrを show route receive-protocol bgp 10.10.10.2 detail hidden
表示します。
コマンドを実行すると、非表示ルートを clear bgp neighbor 10.10.10.2 malformed-route
削除できます。