パケット転送動作の設定
間接ネクストホップを理解する
Junos OSは、間接的に接続されたネクストホップをサポートするすべてのルーティングプロトコル(サードパーティ製ネクストホップとも呼ばれる)について、間接ネクストホップの概念をサポートしています。
内部BGP(IBGP)などのルーティングプロトコルは、間接的に接続されたルートのルーティング情報を送信できるため、Junos OSは、AS内ルーティングプロトコル(OSPF、IS-IS、RIP、スタティック)からのルートに依存して、最適な直接接続のネクストホップを解決します。ルーティングエンジンは、直接接続された最適なネクストホップを決定するためのルート解決を行い、そのルートをパケット転送エンジンにインストールします。
デフォルトでは、Junos OSはパケット転送エンジン転送テーブルの転送ネクストホップバインディングへの間接ネクストホップのルートを維持しません。その結果、再ルーティングイベントが発生すると、転送ネクストホップバインディングへのルート数千が更新されなければならず、ルートコンバージェンス時間が長くなります。 図1 は、間接ネクストホップを無効にした状態で、ネクストホップバインディングを転送するまでのルートを示しています。
Junos OSを有効にして、パケット転送エンジン転送テーブル上の転送ネクストホップバインディングへの間接ネクストホップを転送テーブルに維持できます。その結果、更新する必要がある転送ネクストホップバインディングへのルートの数が少なくなり、ルートコンバージェンス時間が短縮されます。 図2 は、間接ネクストホップを有効にした状態でネクストホップバインディングを転送するまでのルートを示しています。
例:パケット転送エンジンで間接ネクストホップを有効にすることによるルート再コンバージェンスの最適化
この例では、ネットワーク トポロジーの変更が発生した場合に必要な転送テーブルの変更回数を減らすことで、間接ネクスト ホップを使用して(たとえば、BGP ネットワークにおいて)ネットワーク コンバージェンスの高速化を促進する方法を示します。
要件
この例を設定する前に、デバイスの初期化以外の特別な設定を行う必要はありません。
概要
この例では、複数のデバイスが不等コスト パスで接続されています。デバイスR1からデバイスR2へのパスは、デバイスR3を通過するパスは、デバイスR4を通過するパスよりも高いIGPメトリックを持ちます。デバイスR1には、デバイスR2への内部BGP接続があります。デバイスR0は複数のルートをネットワークに注入し、デバイスR1はそれらのルートをデバイスR2にアドバタイズします。デバイスR2はデバイスR1に直接接続されていないため、デバイスR2の転送テーブルには間接ネクストホップが含まれています。内部ゲートウェイプロトコル(この場合はOSPF)は、デバイスR1、R2、R3、R4間の内部リンクで実行されています。各ルーターは、そのループバック インターフェイス IPv4 アドレスをアドバタイズしています。
デバイスR2では、 indirect-next-hop ステートメントにより、Junos OSがパケット転送エンジン転送テーブル上の転送ネクストホップバインディングへの間接ネクストホップを維持できます。その結果、更新する必要がある転送ネクストホップバインディングへのルートの数が少なくなり、パスに障害が発生した場合のルートコンバージェンス時間が短縮されます。
設定
CLIクイックコンフィグレーション
この例をすばやく設定するには、以下のコマンドをコピーしてテキストファイルに貼り付け、改行を削除して、ネットワーク構成に合わせて必要な詳細を変更してから、コマンドを [edit] 階層レベルのCLIにコピー&ペーストします。
デバイスR0
set interfaces fe-1/2/0 unit 1 family inet address 10.0.0.1/30 set interfaces lo0 unit 1 family inet address 10.1.0.1/32 set interfaces lo0 unit 1 family inet address 10.1.0.2/32 set interfaces lo0 unit 1 family inet address 10.1.0.3/32 set interfaces lo0 unit 1 family inet address 10.1.0.4/32 set interfaces lo0 unit 1 family inet address 10.1.0.5/32 set interfaces lo0 unit 1 family inet address 10.1.0.6/32 set interfaces lo0 unit 1 family inet address 10.1.0.7/32 set interfaces lo0 unit 1 family inet address 10.1.0.8/32 set interfaces lo0 unit 1 family inet address 10.1.0.9/32 set routing-options static route 0.0.0.0/0 next-hop 10.0.0.2
デバイスR1
set interfaces fe-1/2/0 unit 2 family inet address 10.0.0.2/30 set interfaces fe-1/2/1 unit 5 family inet address 10.0.0.5/30 set interfaces fe-1/2/2 unit 9 family inet address 10.0.0.9/30 set interfaces lo0 unit 2 family inet address 10.1.1.1/32 set protocols bgp export send-local set protocols bgp export send-static set protocols bgp group int type internal set protocols bgp group int local-address 10.1.1.1 set protocols bgp group int neighbor 10.2.2.2 set protocols ospf area 0.0.0.0 interface fe-1/2/1.5 set protocols ospf area 0.0.0.0 interface fe-1/2/2.9 set protocols ospf area 0.0.0.0 interface lo0.2 set policy-options policy-statement send-local from protocol local set policy-options policy-statement send-local from protocol direct set policy-options policy-statement send-local then accept set policy-options policy-statement send-static from protocol static set policy-options policy-statement send-static then accept set routing-options static route 10.1.0.2/32 next-hop 10.0.0.1 set routing-options static route 10.1.0.1/32 next-hop 10.0.0.1 set routing-options static route 10.1.0.3/32 next-hop 10.0.0.1 set routing-options static route 10.1.0.4/32 next-hop 10.0.0.1 set routing-options static route 10.1.0.5/32 next-hop 10.0.0.1 set routing-options static route 10.1.0.6/32 next-hop 10.0.0.1 set routing-options static route 10.1.0.7/32 next-hop 10.0.0.1 set routing-options static route 10.1.0.8/32 next-hop 10.0.0.1 set routing-options static route 10.1.0.9/32 next-hop 10.0.0.1 set routing-options autonomous-system 65500
デバイスR2
set interfaces fe-1/2/0 unit 14 family inet address 10.0.0.14/30 set interfaces fe-1/2/1 unit 18 family inet address 10.0.0.18/30 set interfaces fe-1/2/2 unit 21 family inet set interfaces lo0 unit 3 family inet address 10.2.2.2/32 set protocols bgp export send-local set protocols bgp group int type internal set protocols bgp group int local-address 10.2.2.2 set protocols bgp group int family inet unicast set protocols bgp group int family inet-vpn unicast set protocols bgp group int neighbor 10.1.1.1 set protocols ospf area 0.0.0.0 interface fe-1/2/0.14 set protocols ospf area 0.0.0.0 interface fe-1/2/1.18 set protocols ospf area 0.0.0.0 interface lo0.3 set policy-options policy-statement send-local from protocol local set policy-options policy-statement send-local from protocol direct set policy-options policy-statement send-local then accept set routing-options autonomous-system 65500 set routing-options forwarding-table indirect-next-hop
デバイスR3
set interfaces fe-1/2/0 unit 6 family inet address 10.0.0.6/30 set interfaces fe-1/2/1 unit 13 family inet address 10.0.0.13/30 set interfaces lo0 unit 4 family inet address 10.3.3.3/32 set protocols ospf area 0.0.0.0 interface fe-1/2/0.6 metric 5000 set protocols ospf area 0.0.0.0 interface fe-1/2/1.13 metric 5000 set protocols ospf area 0.0.0.0 interface lo0.4
デバイスR4
set interfaces fe-1/2/0 unit 10 family inet address 10.0.0.10/30 set interfaces fe-1/2/1 unit 17 family inet address 10.0.0.17/30 set interfaces lo0 unit 5 family inet address 10.4.4.4/32 set protocols ospf area 0.0.0.0 interface fe-1/2/0.10 set protocols ospf area 0.0.0.0 interface fe-1/2/1.17 set protocols ospf area 0.0.0.0 interface lo0.5
デバイスR5
set interfaces fe-1/2/0 unit 22 family inet address 10.0.0.22/30 set interfaces lo0 unit 6 family inet address 10.5.5.5/32
デバイスR0の設定
ステップバイステップの手順
次の例では、設定階層のさまざまなレベルに移動する必要があります。CLIのナビゲーションについては、『Junos OS CLIユーザーガイド』の「設定モードでのCLIエディターの使用」を参照してください。
デバイスR0を設定するには:
-
デモンストレーション目的でネットワークに注入できる複数のルートを含むインターフェイスを設定します。
[edit interfaces] user@R0# set fe-1/2/0 unit 1 family inet address 10.0.0.1/30 user@R0# set lo0 unit 1 family inet address 10.1.0.1/32 user@R0# set lo0 unit 1 family inet address 10.1.0.2/32 user@R0# set lo0 unit 1 family inet address 10.1.0.3/32 user@R0# set lo0 unit 1 family inet address 10.1.0.4/32 user@R0# set lo0 unit 1 family inet address 10.1.0.5/32 user@R0# set lo0 unit 1 family inet address 10.1.0.6/32 user@R0# set lo0 unit 1 family inet address 10.1.0.7/32 user@R0# set lo0 unit 1 family inet address 10.1.0.8/32 user@R0# set lo0 unit 1 family inet address 10.1.0.9/32
-
ネットワーク到達可能性のための静的デフォルトルートを設定します。
[edit routing-options] user@R0# set static route 0.0.0.0/0 next-hop 10.0.0.2
-
デバイスの設定が完了したら、設定をコミットします。
[edit] user@R0# commit
デバイスR1の設定
ステップバイステップの手順
次の例では、設定階層のさまざまなレベルに移動する必要があります。CLIのナビゲーションについては、『Junos OS CLIユーザーガイド』の「設定モードでのCLIエディターの使用」を参照してください。
デバイスR1を設定するには:
-
デモンストレーション目的でネットワークに注入できる複数のルートを含むインターフェイスを設定します。
[edit interfaces] user@R1# set fe-1/2/0 unit 2 family inet address 10.0.0.2/30 user@R1# set fe-1/2/1 unit 5 family inet address 10.0.0.5/30 user@R1# set fe-1/2/2 unit 9 family inet address 10.0.0.9/30 user@R1# set lo0 unit 2 family inet address 10.1.1.1/32
-
BGPを設定します。
[edit protocols] user@R1# set bgp export send-local user@R1# set bgp export send-static user@R1# set bgp group int type internal user@R1# set bgp group int local-address 10.1.1.1 user@R1# set bgp group int neighbor 10.2.2.2
-
OSPFを設定します。
[edit protocols] user@R1# set ospf area 0.0.0.0 interface fe-1/2/1.5 user@R1# set ospf area 0.0.0.0 interface fe-1/2/2.9 user@R1# set ospf area 0.0.0.0 interface lo0.2
-
ルーティングポリシーを設定します。
[edit] user@R1# set policy-options policy-statement send-local from protocol local user@R1# set policy-options policy-statement send-local from protocol direct user@R1# set policy-options policy-statement send-local then accept user@R1# set policy-options policy-statement send-static from protocol static user@R1# set policy-options policy-statement send-static then accept
-
デバイスR0に設定されたインターフェイスのセットへのスタティックルートのセットを設定します。
[edit] user@R1# set routing-options static route 10.1.0.2/32 next-hop 10.0.0.1 user@R1# set routing-options static route 10.1.0.1/32 next-hop 10.0.0.1 user@R1# set routing-options static route 10.1.0.3/32 next-hop 10.0.0.1 user@R1# set routing-options static route 10.1.0.4/32 next-hop 10.0.0.1 user@R1# set routing-options static route 10.1.0.5/32 next-hop 10.0.0.1 user@R1# set routing-options static route 10.1.0.6/32 next-hop 10.0.0.1 user@R1# set routing-options static route 10.1.0.7/32 next-hop 10.0.0.1 user@R1# set routing-options static route 10.1.0.8/32 next-hop 10.0.0.1 user@R1# set routing-options static route 10.1.0.9/32 next-hop 10.0.0.1
-
自律システム(AS)識別子を設定します。
[edit] user@R1# set routing-options autonomous-system 65500
-
デバイスの設定が完了したら、設定をコミットします。
[edit] user@R1# commit
デバイスR2の設定
ステップバイステップの手順
次の例では、設定階層のさまざまなレベルに移動する必要があります。CLIのナビゲーションについては、『Junos OS CLIユーザーガイド』の「設定モードでのCLIエディターの使用」を参照してください。
デバイスR2を設定するには:
-
デモンストレーション目的でネットワークに注入できる複数のルートを含むインターフェイスを設定します。
[edit interfaces] user@R2# set fe-1/2/0 unit 14 family inet address 10.0.0.14/30 user@R2# set fe-1/2/1 unit 18 family inet address 10.0.0.18/30 user@R2# set fe-1/2/2 unit 21 family inet address 10.0.0.21/30; user@R2# set lo0 unit 3 family inet address 10.2.2.2/32
-
BGPを設定します。
[edit] user@R2# set protocols bgp export send-local user@R2# set protocols bgp group int type internal user@R2# set protocols bgp group int local-address 10.2.2.2 user@R2# set protocols bgp group int family inet unicast user@R2# set protocols bgp group int family inet-vpn unicast user@R2# set protocols bgp group int neighbor 10.1.1.1
-
OSPFを設定します。
[edit] user@R2# set protocols ospf area 0.0.0.0 interface fe-1/2/0.14 user@R2# set protocols ospf area 0.0.0.0 interface fe-1/2/1.18 user@R2# set protocols ospf area 0.0.0.0 interface lo0.3
-
ルーティングポリシーを設定します。
[edit] user@R2# set policy-options policy-statement send-local from protocol local user@R2# set policy-options policy-statement send-local from protocol direct user@R2# set policy-options policy-statement send-local then accept
-
AS識別子を設定します。
[edit] user@R2# set routing-options autonomous-system 65500
-
転送プレーンで間接ネクストホップを有効にします。
[edit] user@R2# set routing-options forwarding-table indirect-next-hop
-
デバイスの設定が完了したら、設定をコミットします。
[edit] user@R2# commit
結果
show interfaces、show protocols、show policy-options、show routing-optionsコマンドを発行して、設定を確認します。出力に意図した設定が表示されない場合は、この例の手順を繰り返して設定を修正します。
デバイスR0
user@R0# show interfaces
fe-1/2/0 {
unit 1 {
family inet {
address 10.0.0.1/30;
}
}
}
lo0 {
unit 1 {
family inet {
address 10.1.0.1/32;
address 10.1.0.2/32;
address 10.1.0.3/32;
address 10.1.0.4/32;
address 10.1.0.5/32;
address 10.1.0.6/32;
address 10.1.0.7/32;
address 10.1.0.8/32;
address 10.1.0.9/32;
}
}
}
user@R0# show routing-options
static {
route 0.0.0.0/0 next-hop 10.0.0.2;
}
デバイスR1
user@R1# show interfaces
fe-1/2/0 {
unit 2 {
family inet {
address 10.0.0.2/30;
}
}
}
fe-1/2/1 {
unit 5 {
family inet {
address 10.0.0.5/30;
}
}
}
fe-1/2/2 {
unit 9 {
family inet {
address 10.0.0.9/30;
}
}
}
lo0 {
unit 2 {
family inet {
address 10.1.1.1/32;
}
}
}
user@R1# show protocols
bgp {
export [ send-local send-static ];
group int {
type internal;
local-address 10.1.1.1;
neighbor 10.2.2.2;
}
}
ospf {
area 0.0.0.0 {
interface fe-1/2/1.5;
interface fe-1/2/2.9;
interface lo0.2;
}
}
user@R1# show policy-options
policy-statement send-local {
from protocol [ local direct ];
then accept;
}
policy-statement send-static {
from protocol static;
then accept;
}
user@R1# show routing-options
static {
route 10.1.0.2/32 next-hop 10.0.0.1;
route 10.1.0.1/32 next-hop 10.0.0.1;
route 10.1.0.3/32 next-hop 10.0.0.1;
route 10.1.0.4/32 next-hop 10.0.0.1;
route 10.1.0.5/32 next-hop 10.0.0.1;
route 10.1.0.6/32 next-hop 10.0.0.1;
route 10.1.0.7/32 next-hop 10.0.0.1;
route 10.1.0.8/32 next-hop 10.0.0.1;
route 10.1.0.9/32 next-hop 10.0.0.1;
}
autonomous-system 65500;
デバイスR2
user@R2# show interfaces
fe-1/2/0 {
unit 14 {
family inet {
address 10.0.0.14/30;
}
}
}
fe-1/2/1 {
unit 18 {
family inet {
address 10.0.0.18/30;
}
}
}
fe-1/2/2 {
unit 21 {
family inet {
address 10.0.0.21/30
}
}
}
lo0 {
unit 3 {
family inet {
address 10.2.2.2/32;
}
}
}
user@R2# show protocols
bgp {
export send-local;
group int {
type internal;
local-address 10.2.2.2;
family inet {
unicast;
}
family inet-vpn {
unicast;
}
neighbor 10.1.1.1;
}
}
ospf {
area 0.0.0.0 {
interface fe-1/2/0.14;
interface fe-1/2/1.18;
interface lo0.3;
}
}
user@R2# show policy-options
policy-statement send-local {
from protocol [ local direct ];
then accept;
}
user@R2# show routing-options
autonomous-system 65500;
forwarding-table {
indirect-next-hop;
}
CLIクイック設定に示されているように、デバイスR3、デバイスR4、デバイスR5を設定します。
検証
設定が正常に機能していることを確認します。
ルートに期待されるindirect-next-hopフラグがあることを確認する
目的
デバイスR2が、パケット転送エンジン転送テーブルで転送ネクストホップバインディングへの間接ネクストホップを維持するように設定されていることを確認します。
アクション
user@R2> show krt indirect-next-hop
show krt indirect-next-hop
Indirect Nexthop:
Index: 1048575 Protocol next-hop address: 10.255.3.1
RIB Table: __mpls-oam__.mpls.0
Label: Swap 299968
Policy Version: 0 References: 1
Locks: 2 0x95bc514
Flags: 0x3
INH Session ID: 0xa
INH Version ID: 1
Ref RIB Table: unknown
Next hop: 10.50.244.9 via ge-2/0/2.0
Label operation: Swap 299968, Push 299792(top)
Label TTL action: no-prop-ttl, no-prop-ttl(top)
Session Id: 0x9
IGP FRR Interesting proto count : 0
意味
出力の0x3フラグは、デバイスR2がパケット転送エンジン転送テーブル上の転送ネクストホップバインディングへの間接ネクストホップを維持するように設定されていることを示しています。indirect-next-hopステートメントが設定から削除または非アクティブ化されると、このフラグは0x2に変更されます。Trio MPC(モジュラーポートコンセントレータ)チップセットを搭載したJunos MXシリーズルーターは、デフォルトで間接ネクストホップをサポートしており、無効にすることはできません。したがって、forwarding-optionsでindirect-next-hopが設定されていない場合でも、この機能はデフォルトで動作します。したがって、0x3フラグはTrio MPC(モジュラーポートコンセントレータ)には適用されません。
show krt indirect-next-hopコマンドは非表示であるため、文書化されていません。show krt indirect-next-hopコマンドがここに表示されているのは、これが間接ネクストホップ機能を検証する唯一のコマンドだからです。もちろん、最良の検証方法は、パス障害後の再コンバージェンス中にネットワークパフォーマンスを監視することです。
