BGP マルチホップ セッション
EBGPマルチホップについて
BGPは、異なる自律システム(AS)内のルーター間でルーティング情報を交換するために使用される外部ゲートウェイプロトコル(EGP)です。ルーター間で EBGP マルチホップを確立する 2 つの方法を以下に示します。
外部BGP(EBGP)ピアが相互に直接接続されていない場合、相互に到達するには1つ以上の非BGPルーターを通過する必要があります。
マルチホップ EBGP を設定することで、ピアが他のルーターを通過してピア関係を形成し、更新メッセージを交換できるようになります。このタイプの設定は、通常、ジュニパーネットワークスのルーティングデバイスが、2つのEBGPピアの直接接続を許可しないサードパーティ製ルーターでEBGPを実行する必要がある場合に使用されます。EBGP マルチホップは、直接接続されていない 2 つの EBGP ピア間のネイバー接続を可能にします。
EBGP 接続のデフォルトの動作は、ピアの物理インターフェイス アドレスを使用して、単一の物理ホップをピアリングすることです。場合によっては、このデフォルトのワンホップの物理ピアリングEBGPの動作を変更すると便利です。そのようなケースの 1 つが、複数の物理リンクが EBGP ピアとなる 2 つのルーターを接続する場合です。この場合、ポイントツーポイント リンクの 1 つに障害が発生しても、代替リンクでの到達可能性は存在します。

図1では、ルーターR1はAS 1に属し、ルーターR2はAS 2に属しています。このルーター間の2つの物理リンクが、ロードバランシングに使用されます。EBGPマルチホップピアリングは、1つの物理リンクでも機能します。
以下の設定例は、これらの複数の物理リンク間に単一のBGPピアリングセッションを確立するのに役立ちます。
各ルーターは、リモートルーターのループバックアドレスでピアリングセッションを確立する必要があります。BGPパケットのピアアドレスヘッダー情報を変更する
local-addressステートメントを使用して、このセッションを設定できます。ネイバーの物理アドレスのデフォルト使用を変更するには、
multihopステートメントを使用します。さらに、BGP パケットにTTL(Time-to-live)値を指定して、パケットの伝播距離を制御することもできます。TTL値1を使用して、ネットワーク内の他のバックドアリンク間でセッションを確立できないようにします。注:マルチホップが設定されている場合、Junos OSはTTL値をデフォルトで64に設定します。
TTL 値 1 は、直接接続されたネイバーのループバックアドレスへの EBGP セッションを有効にするのに十分です。
各ルーターには、リモート ルーターのループバック アドレスへの IP ルーティング機能が必要です。この機能は、多くの場合、スタティックルートを使用してループバックアドレスをインターフェイスの物理アドレスにマッピングすることで実現されます。
[edit protocols bgp group ext-peers]
type external;
local-address 192.168.3.4;
neighbor 172.16.128.1 {
multihop ttl 1;
}
[edit routing-options]
static {
route 172.16.128.1 next-hop (10.10.1.1 | 10.10.2.1);
}
関連項目
例:EBGP マルチホップ セッションの設定
この例では、ローカルルーターから1ホップ以上離れた外部BGP(EBGP)ピアを設定する方法を示します。このタイプのセッションは、 マルチホップ BGPセッションと呼ばれます。
要件
この例を構成する前に、デバイスの初期化以上の特別な構成は必要ありません。
概要
マルチホップ EBGP セッションを有効にするための設定には、2 つの EBGP ピア間の接続が必要です。この例では、スタティック ルートを使用してデバイス間の接続を提供しています。
neighbor ステートメントで物理アドレスが通常使用される直接接続 EBGP セッションとは異なり、間接的に接続されたピアのループバック インターフェイス アドレスを指定することで、マルチホップ EBGP のループバック インターフェイス アドレスを使用する必要があります。このように、EBGPマルチホップは内部BGP(IBGP)に似ています。
最後に、 multihop ステートメントを追加する必要があります。オプションで、 ttl ステートメントでTTL(最大有効期限)値を設定できます。TTLはBGPパケットのIPヘッダーで伝送されます。TTL 値を指定しない場合は、システムのデフォルトの最大 TTL 値が使用されます。マルチホップEBGPセッションのデフォルトTTL値は64です。また、 no-nexthop-change ステートメントを含めることで、ルート広告の BGP ネクストホップ値を保持する方法もあります。
図 2 は、典型的な EBGP マルチホップ ネットワークを示しています。
デバイスCとデバイスEには、確立されたEBGPセッションがあります。デバイス D は BGP 対応デバイスではありません。すべてのデバイスは、スタティックルートを介して接続されています。

設定
CLIクイック構成
この例をすばやく設定するには、次のコマンドをコピーしてテキストファイルに貼り付け、改行を削除して、ネットワーク構成に合わせて必要な詳細を変更し、[edit]階層レベルのCLIにコマンドをコピー&ペーストしてください。
1 デバイスC 1
set interfaces fe-1/2/0 unit 9 description to-D set interfaces fe-1/2/0 unit 9 family inet address 10.10.10.9/30 set interfaces lo0 unit 3 family inet address 192.168.40.4/32 set protocols bgp group external-peers type external set protocols bgp group external-peers multihop ttl 2 set protocols bgp group external-peers local-address 192.168.40.4 set protocols bgp group external-peers export send-static set protocols bgp group external-peers peer-as 18 set protocols bgp group external-peers neighbor 192.168.6.7 set policy-options policy-statement send-static term 1 from protocol static set policy-options policy-statement send-static term 1 then accept set routing-options static route 10.10.10.14/32 next-hop 10.10.10.10 set routing-options static route 192.168.6.7/32 next-hop 10.10.10.10 set routing-options router-id 192.168.40.4 set routing-options autonomous-system 17
1 デバイスD 1
set interfaces fe-1/2/0 unit 10 description to-C set interfaces fe-1/2/0 unit 10 family inet address 10.10.10.10/30 set interfaces fe-1/2/1 unit 13 description to-E set interfaces fe-1/2/1 unit 13 family inet address 10.10.10.13/30 set interfaces lo0 unit 4 family inet address 192.168.6.6/32 set routing-options static route 192.168.40.4/32 next-hop 10.10.10.9 set routing-options static route 192.168.6.7/32 next-hop 10.10.10.14 set routing-options router-id 192.168.6.6
1 デバイスE 1
set interfaces fe-1/2/0 unit 14 description to-D set interfaces fe-1/2/0 unit 14 family inet address 10.10.10.14/30 set interfaces lo0 unit 5 family inet address 192.168.6.7/32 set protocols bgp group external-peers multihop ttl 2 set protocols bgp group external-peers local-address 192.168.6.7 set protocols bgp group external-peers export send-static set protocols bgp group external-peers peer-as 17 set protocols bgp group external-peers neighbor 192.168.40.4 set policy-options policy-statement send-static term 1 from protocol static set policy-options policy-statement send-static term 1 then accept set routing-options static route 10.10.10.8/30 next-hop 10.10.10.13 set routing-options static route 192.168.40.4/32 next-hop 10.10.10.13 set routing-options router-id 192.168.6.7 set routing-options autonomous-system 18
1 デバイスC 1
ステップバイステップでの手順
次の例では、設定階層のいくつかのレベルに移動する必要があります。CLIのナビゲーションについては、Junos OS CLIユーザーガイドの 設定モードでCLIエディターを使用する を参照してください。
デバイスCを設定するには:
直接接続されたデバイス(to-D)へのインターフェイスを設定し、ループバックインターフェイスを設定します。
[edit interfaces fe-1/2/0 unit 9] user@C# set description to-D user@C# set family inet address 10.10.10.9/30 [edit interfaces lo0 unit 3] user@C# set family inet address 192.168.40.4/32
デバイス E との EBGP セッションを設定します。
neighborステートメントは、デバイスEのループバックインターフェイスを指しています。[edit protocols bgp group external-peers] user@C# set type external user@C# set local-address 192.168.40.4 user@C# set export send-static user@C# set peer-as 18 user@C# set neighbor 192.168.6.7
マルチホップステートメントを設定して、デバイスCとデバイスEがEBGPピアになれるようにします。
ピアは互いに 2 ホップ離れているため、この例では
ttl 2ステートメントを使用します。[edit protocols bgp group external-peers] user@C# set multihop ttl 2
スタティックルートを使用して、デバイス E への接続を構成します。
ループバックインターフェイスのアドレスと物理インターフェイスのアドレスの両方へのルートを設定する必要があります。
[edit routing-options] user@C# set static route 10.10.10.14/32 next-hop 10.10.10.10 user@C# set static route 192.168.6.7/32 next-hop 10.10.10.10
ローカルルーターIDおよび自律システム(AS)番号を設定します。
[edit routing-options] user@C# set router-id 192.168.40.4 user@C# set autonomous-system 17
直接ルートを受け入れるポリシーを設定します。
このシナリオの他の有用なオプションは、OSPF またはローカル ルートで学習したルートを受け入れることかもしれません。
[edit policy-options policy-statement send-static term 1] user@C# set from protocol static user@C# set then accept
結果
設定モードから、show interfaces 、show protocols、show policy-options、およびshow routing-options のコマンドを入力して設定を確認します。出力結果に意図した設定内容が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@C# show interfaces
fe-1/2/0 {
unit 9 {
description to-D;
family inet {
address 10.10.10.9/30;
}
}
}
lo0 {
unit 3 {
family inet {
address 192.168.40.4/32;
}
}
}
user@C# show protocols
bgp {
group external-peers {
type external;
multihop {
ttl 2;
}
local-address 192.168.40.4;
export send-static;
peer-as 18;
neighbor 192.168.6.7;
}
}
user@C# show policy-options
policy-statement send-static {
term 1 {
from protocol static;
then accept;
}
}
user@C# show routing-options
static {
route 10.10.10.14/32 next-hop 10.10.10.10;
route 192.168.6.7/32 next-hop 10.10.10.10;
}
router-id 192.168.40.4;
autonomous-system 17;
デバイスの設定が完了したら、設定モードから commit を入力します。 トポロジー内のすべての BGP セッションについて、これらのステップを繰り返します。
デバイス D の設定
ステップバイステップでの手順
次の例では、設定階層のいくつかのレベルに移動する必要があります。CLIのナビゲーションについては、Junos OS CLIユーザーガイドの 設定モードでCLIエディターを使用する を参照してください。
デバイス D を設定するには:
CLI をデバイス D に設定します。
user@host> set cli logical-system D
直接接続されたデバイスへのインターフェイスを設定し、ループバックインターフェイスを設定します。
[edit interfaces fe-1/2/0 unit 10] user@D# set description to-C user@D# set family inet address 10.10.10.10/30 [edit interfaces fe-1/2/1 unit 13] user@D# set description to-E user@D# set family inet address 10.10.10.13/30 [edit interfaces lo0 unit 4] user@D# set family inet address 192.168.6.6/32
ループバックインターフェイスアドレスへのスタティックルートを使用して、他のデバイスへの接続を設定します。
機器 D は機器 C および機器 E に直接接続されているため、物理アドレスへのスタティック ルートは必要ありません。
[edit routing-options] user@D# set static route 192.168.40.4/32 next-hop 10.10.10.9 user@D# set static route 192.168.6.7/32 next-hop 10.10.10.14
ローカルルーターIDを設定します。
[edit routing-options] user@D# set router-id 192.168.6.6
結果
設定モードから、show interfaces および show routing-options コマンドを入力して設定を確認します。出力結果に意図した設定内容が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@D# show interfaces
fe-1/2/0 {
unit 10 {
description to-C;
family inet {
address 10.10.10.10/30;
}
}
}
fe-1/2/1 {
unit 13 {
description to-E;
family inet {
address 10.10.10.13/30;
}
}
}
lo0 {
unit 4 {
family inet {
address 192.168.6.6/32;
}
}
}
user@D# show protocols
user@D# show routing-options
static {
route 192.168.40.4/32 next-hop 10.10.10.9;
route 192.168.6.7/32 next-hop 10.10.10.14;
}
router-id 192.168.6.6;
デバイスの設定が完了したら、設定モードから commit を入力します。 トポロジー内のすべての BGP セッションについて、これらのステップを繰り返します。
デバイス E の設定
ステップバイステップでの手順
次の例では、設定階層のいくつかのレベルに移動する必要があります。CLIのナビゲーションについては、Junos OS CLIユーザーガイドの 設定モードでCLIエディターを使用する を参照してください。
デバイス E を設定するには:
CLI をデバイス E に設定します。
user@host> set cli logical-system E
直接接続されたデバイス(to-D)へのインターフェイスを設定し、ループバックインターフェイスを設定します。
[edit interfaces fe-1/2/0 unit 14] user@E# set description to-D user@E# set family inet address 10.10.10.14/30 [edit interfaces lo0 unit 5] user@E# set family inet address 192.168.6.7/32
デバイス E との EBGP セッションを設定します。
neighborステートメントは、機器 C のループバック インターフェイスを指しています。[edit protocols bgp group external-peers] user@E# set local-address 192.168.6.7 user@E# set export send-static user@E# set peer-as 17 user@E# set neighbor 192.168.40.4
multihopステートメントを設定して、デバイス C とデバイス E を EBGP ピアになるようにします。ピアは互いに 2 ホップ離れているため、この例では
ttl 2ステートメントを使用します。[edit protocols bgp group external-peers] user@E# set multihop ttl 2
スタティックルートを使用して、デバイス E への接続を構成します。
ループバックインターフェイスのアドレスと物理インターフェイスのアドレスの両方へのルートを設定する必要があります。
[edit routing-options] user@E# set static route 10.10.10.8/30 next-hop 10.10.10.13 user@E# set static route 192.168.40.4/32 next-hop 10.10.10.13
ローカルルーターIDおよび自律システム(AS)番号を設定します。
[edit routing-options] user@E# set router-id 192.168.6.7 user@E# set autonomous-system 18
直接ルートを受け入れるポリシーを設定します。
このシナリオの他の有用なオプションは、OSPF またはローカル ルートで学習したルートを受け入れることかもしれません。
[edit policy-options policy-statement send-static term 1] user@E# set from protocol static user@E# set then accept
結果
設定モードから、show interfaces 、show protocols、show policy-options、およびshow routing-options のコマンドを入力して設定を確認します。出力結果に意図した設定内容が表示されない場合は、この例の手順を繰り返して設定を修正します。
user@E# show interfaces
fe-1/2/0 {
unit 14 {
description to-D;
family inet {
address 10.10.10.14/30;
}
}
}
lo0 {
unit 5 {
family inet {
address 192.168.6.7/32;
}
}
}
user@E# show protocols
bgp {
group external-peers {
multihop {
ttl 2;
}
local-address 192.168.6.7;
export send-static;
peer-as 17;
neighbor 192.168.40.4;
}
}
user@E# show policy-options
policy-statement send-static {
term 1 {
from protocol static;
then accept;
}
}
user@E# show routing-options
static {
route 10.10.10.8/30 next-hop 10.10.10.13;
route 192.168.40.4/32 next-hop 10.10.10.13;
}
router-id 192.168.6.7;
autonomous-system 18;
デバイスの設定が完了したら、設定モードから commit を入力します。
検証
設定が正常に機能していることを確認します。
接続の確認
目的
デバイスCがデバイスEにpingできることを確認し、pingリクエストのソースとしてループバックインターフェイスアドレスを指定します。
ループバック インターフェイス アドレスは、BGP が使用する送信元アドレスです。
アクション
動作モードから、機器Cから ping 10.10.10.14 source 192.168.40.4 コマンドを、機器Eから ping 10.10.10.9 source 192.168.6.7 コマンドを入力します。
user@C> ping 10.10.10.14 source 192.168.40.4 PING 10.10.10.14 (10.10.10.14): 56 data bytes 64 bytes from 10.10.10.14: icmp_seq=0 ttl=63 time=1.262 ms 64 bytes from 10.10.10.14: icmp_seq=1 ttl=63 time=1.202 ms ^C --- 10.10.10.14 ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/stddev = 1.202/1.232/1.262/0.030 ms
user@E> ping 10.10.10.9 source 192.168.6.7 PING 10.10.10.9 (10.10.10.9): 56 data bytes 64 bytes from 10.10.10.9: icmp_seq=0 ttl=63 time=1.255 ms 64 bytes from 10.10.10.9: icmp_seq=1 ttl=63 time=1.158 ms ^C --- 10.10.10.9 ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/stddev = 1.158/1.206/1.255/0.049 ms
意味
pingsが機能する場合、静的ルートは機能しています。
BGP セッションが確立されていることの確認
目的
BGP セッションが起動していることを確認します。
アクション
動作モードからshow bgp summaryコマンドを入力します。
user@C> show bgp summary Groups: 1 Peers: 1 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 2 0 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 192.168.6.7 18 147 147 0 1 1:04:27 0/2/2/0 0/0/0/0
user@E> show bgp summary Groups: 1 Peers: 1 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 2 0 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 192.168.40.4 17 202 202 0 1 1:02:18 0/2/2/0 0/0/0/0
意味
出力は、両方のデバイスにそれぞれ1つのピアがあることを示しています。ピアがダウンしていません。
アドバタイズされたルートの表示
目的
ルートがBGPによってアドバタイズされていることを確認してください。
アクション
動作モードからshow route advertising-protocol bgp neighborコマンドを入力します。
user@E> show route advertising-protocol bgp 192.168.6.7 inet.0: 5 destinations, 7 routes (5 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 10.10.10.14/32 Self I * 192.168.6.7/32 Self I
user@C> show route advertising-protocol bgp 192.168.40.4 inet.0: 5 destinations, 7 routes (5 active, 0 holddown, 0 hidden) Prefix Nexthop MED Lclpref AS path * 10.10.10.8/30 Self I * 192.168.40.4/32 Self I
意味
send-staticルーティングポリシーは、ルーティングテーブルからスタティックルートをBGPにエクスポートしています。BGPピアセッションが確立されているため、BGPはピア間でこれらのルートをアドバタイズしています。