パケット転送動作の設定
間接ネクストホップを理解する
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パケット転送エンジン転送テーブル上の転送ネクストホップバインディングへの間接ネクストホップを維持できます。その結果、更新が必要なルートから転送ネクストホップへのバインディングが少なくなり、パスに障害が発生した場合のルートコンバージェンス時間が改善されます。
位相幾何学
図 3 は、サンプルのネットワークを示しています。
[CLI Quick Configuration] セクションは、図 3 のすべてのデバイスの完全な設定を示しています。それ以外の場合、この例ではデバイスR0、デバイスR1、デバイスR2に焦点を当てています。
構成
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エディターを使用する を参照してください。
Device 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 Modular Port Concentrator(MPC)チップセットを搭載した Junos MX シリーズ ルーターは、デフォルトで indirect-next-hop をサポートしており、無効にすることはできません。したがって、forwarding-optionsでindirect-next-hopが設定されていない場合でも、この機能はデフォルトで動作します。そのため、0x3フラグは Trio Modular Port Concentrator(MPC)には適用されません。
show krt indirect-next-hopコマンドは非表示になっているため、文書化されていません。ここで show krt indirect-next-hop コマンドを表示しているのは、これが間接ネクストホップ機能を検証する唯一のコマンドだからです。もちろん、最善の検証方法は、パス障害後の再コンバージェンス中のネットワーク パフォーマンスを監視することです。