このドキュメントでは、IPv6 用のスタティック ルートを設定する方法について説明します。スタティック ルートは、2 つのデバイス間の明示的なパスを定義する、手動で設定されたルートです。ネットワークでトポロジを変更した場合、スタティック ルートはダイナミック プロトコルのルートのように自動的に更新されないので、手動で再設定する必要があります。スタティック ルートは、外部ネットワークへのパスが 1 つしかない、より小さいネットワークで有用です。
スタティック ルートを使用する場合の主な欠点は、トポロジを変更した場合に自動的に設定されないことです。強い制御が必要となる別のネットワークに対する、特定の種類のトラフィックにセキュリティを提供するように、スタティック ルートを実装することもあります。スタティック ルートの使用で考慮すべき制限事項は、冗長性がないこと、および大規模ネットワークではルートの手動再設定が大きな管理コストになる可能性があることです。
スタティックルーティングを設定するには、ipv6 routeコマンドを使用します。スタティックIPv6ルートでルータを設定する前に、グローバルコンフィギュレーションモードでipv6 unicast-routing コマンドを使用して、IPv6パケットの転送を有効にする必要があります。
この設定を行う前に、次の要件が満たされていることを確認します。
IPv4 スタティック ルートの知識
IPv6 アドレッシング スキームの知識
このドキュメントの情報は、Cisco IOS® ソフトウェア リリース 12.4 (15)T 13 の Cisco 3700 シリーズ ルータに基づきます。
このドキュメントの情報は、特定のラボ環境にあるデバイスに基づいて作成されました。このドキュメントで使用するすべてのデバイスは、クリアな(デフォルト)設定で作業を開始しています。対象のネットワークが実稼働中である場合には、どのようなコマンドについても、その潜在的な影響について確実に理解しておく必要があります。
表記法の詳細については、『シスコ テクニカル ティップスの表記法』を参照してください。
このセクションでは、このドキュメントで説明する機能を設定するために必要な情報を提供しています。
注: このドキュメントで使用されているコマンドの詳細を調べるには、Command Lookup Tool(登録ユーザ専用)を使用してください。
このドキュメントでは、次のネットワーク セットアップを使用します。
このドキュメントでは、次のコンフィギュレーションを使用します。
次のビデオへのリンクを参照してください(Cisco サポート コミュニティ で利用可能)。Cisco IOS ルータで IPv6 ネットワーク用にスタティック ルートを設定する方法が説明されています。
Cisco IOS で IPv6 用にスタティック ルートを設定する
ルータ R1 |
---|
version 12.4 ! hostname R1 ! ip cef ! ipv6 unicast-routing !--- Enables the forwarding of IPv6 packets. ! interface Loopback1 no ip address ipv6 address 1010::1/128 ! interface FastEthernet0/0 no ip address duplex auto speed auto ipv6 address 2000::1/126 ! ip forward-protocol nd ! ipv6 route 2001::/126 2000::2 ipv6 route 2020::1/128 2000::2 ipv6 route 3030::1/128 2000::2 !--- Static routes are configured in router R1, !--- to reach the networks in router R2 and R3. !--- This is done when you specify !--- the next-hop address, which in this case is !--- 2000::2 from which the output interface !--- is automatically derived. ! end |
ルータ R2 |
---|
version 12.4 ! hostname R2 ! ip cef ! ipv6 unicast-routing ! interface Loopback2 no ip address ipv6 address 2020::1/128 ! interface FastEthernet0/0 no ip address duplex auto speed auto ipv6 address 2000::2/126 ! interface FastEthernet0/1 no ip address duplex auto speed auto ipv6 address 2001::1/126 ! ip forward-protocol nd ! ipv6 route 1010::1/128 2000::1 ipv6 route 3030::1/128 2001::2 !--- Static routes are configured to reach !--- routers R1 and R3 loopback address when you !--- specify the corresponding interface address. ! end |
ルータ R3 |
---|
version 12.4 ! hostname R3 ! ip cef ! ipv6 unicast-routing ! interface Loopback3 no ip address ipv6 address 3030::1/128 ! interface FastEthernet0/0 no ip address duplex auto speed auto ipv6 address 2001::2/126 ! ip forward-protocol nd ! ipv6 route 1010::1/128 2001::1 ipv6 route 2000::/126 2001::1 ipv6 route 2020::1/128 2001::1 !--- For router 3, to reach R1 and R2, !--- static routes are configured when you !--- mention 2001::1 as the next-hop address. ! end |
このセクションでは、設定が正常に動作していることを確認します。
Output Interpreter Tool(OIT)(登録ユーザ専用)では、特定の show コマンドがサポートされています。OIT を使用して show コマンド出力の解析を表示します。
IPv6ルーティングテーブルの内容を表示するには、show ipv6 route static コマンドを使用します。出力は次のようになります。
show ipv6 route static |
---|
ルータ R1 内 R1#show ipv6 route static IPv6 Routing Table - 7 entries Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP U - Per-user Static route, M - MIPv6 I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 D - EIGRP, EX - EIGRP external S 2001::/126 [1/0] via 2000::2 S 2020::1/128 [1/0] via 2000::2 S 3030::1/128 [1/0] via 2000::2 !--- Displays the static routes learnt by router R1 through 2000::2.ルータ R3 内 R3#show ipv6 route static IPv6 Routing Table - 7 entries Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP U - Per-user Static route, M - MIPv6 I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 D - EIGRP, EX - EIGRP external S 1010::1/128 [1/0] via 2001::1 S 2000::/126 [1/0] via 2001::1 S 2020::1/128 [1/0] via 2001::1 !--- Displays the static routes learnt by router R3 through 2001::1. |
ルータ R1 にはルータ R2 と R3 へのルートがあるので、ルータ R1 はルータ R2 のループバック アドレスおよびルータ R3 を ping できます。ping コマンドを使用し、これを確認します。
ルータ R1 内 |
---|
ルータ R2 のループバック アドレスの ping R1#ping 2020::1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2020::1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/36/104 ms !--- Router R1 is successfully able to ping !--- router R2's loopback address.ルータ R3 の ping R1#ping 2001::2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2001::2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 12/40/116 ms R1#ping 3030::1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 3030::1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 8/32/84 ms !--- Similarly R1 is also able to reach R3, !--- for example, ping to R3's interface address !--- and loopback address from router R1 is successful. |
注:同様に、ルータR3もルータR1のFa0/0アドレス2000::1と、そのループバックアドレス1010::1に到達できます。
現在のルーティングテーブルの内容を表示するにはshow ipv6 static コマンドを使用し、詳細情報を表示するにはdetail 構文を使用します。この構文については、次の例で説明します。
show ipv6 static |
---|
ルータ R1 内 R1#show ipv6 static IPv6 Static routes Code: * - installed in RIB * 2001::/126 via nexthop 2000::2, distance 1 * 2020::1/128 via nexthop 2000::2, distance 1 * 3030::1/128 via nexthop 2000::2, distance 1 !--- Displays the routes that are installed in !--- the IPv6 Routing Information Base(RIB) marked with *! |
ユーザが detailキーワードが指定されている場合は、追加情報が表示されます。次の出力例を参考にしてください。
show ipv6 static detail |
---|
ルータ R2 内 R2#show ipv6 static detail IPv6 Static routes Code: * - installed in RIB * 1010::1/128 via nexthop 2000::1, distance 1 Resolves to 1 paths (max depth 1) !--- Displays the output path set, and maximum !--- resolution depth, which in this case is 1. via FastEthernet0/0 * 3030::1/128 via nexthop 2001::2, distance 1 Resolves to 1 paths (max depth 1) via FastEthernet0/1 !--- Displays that the route is received through !--- the next-hop 2000::1 through interface fa0/0. |
注:無効なルートの場合は、次の情報が表示されます。
無効な再帰ルートの場合は、ルートが有効でない理由
無効なダイレクト ルートまたは完全指定のルートの場合は、ルートが有効でない理由
改定 | 発行日 | コメント |
---|---|---|
1.0 |
16-Dec-2011 |
初版 |