Question #1361

SIMULATION - Guidelines - This is a lab item in which tasks will be performed on virtual devices: • Refer to the Tasks tab to view the tasks for this lab item. • Refer to the Topology tab to access the device console(s) and perform the tasks. • Console access is available for all required devices by clicking the device icon or using the tab(s) above the console window. • All necessary pre-configurations have been applied. • Do not remove any existing configurations from the devices, only those necessary to make the appropriate changes required to fulfill the listed tasks. • Do not change the enable password or hostname for any device. • Save your configurations to NVRAM before moving to the next item. • Click Next at the bottom of the screen to submit this lab and move to the next question. • When Next is clicked, the lab closes and cannot be reopened. Topology - Tasks - Reference Topology Diagram and table. Configure IPv4 and IPv6 between the two routers. Task 1: • Configure R1 with the first usable host IP address in the IPv4 network. • Configure R2 with the last usable host IP address in the IPv4 network. • Verify connectivity using ping. Task 2: • Do not assign the subnet router anycast address to either router. • Configure R1 with the first usable host IP address in the IPv6 network. • Configure R2 with the last usable host IP address in the IPv6 network. • Verify connectivity using ping.
English
This question is a practical simulation task commonly found in the Cisco Certified Network Associate (CCNA) exam. It assesses your ability to configure basic IPv4 and IPv6 addressing on Cisco routers and verify connectivity. ## Detailed Analysis of the Simulation Question The simulation requires you to configure two Cisco routers, R1 and R2, which are directly connected via their `e0/0` interfaces. You need to apply both IPv4 and IPv6 addresses to these interfaces based on specific subnet information provided in a table. Finally, you must verify connectivity between the routers for both IP versions. ### **Topology Overview** * **R1** and **R2**: Two routers. * **e0/0**: The interface on both R1 and R2 used for the direct connection. * **Connectivity**: A single link connecting `R1(e0/0)` to `R2(e0/0)`. ### **IP Information Provided** The table specifies the networks to be used: * **IPv4**: `10.0.12.4/30` * **IPv6**: `2001:db8:12::/126` ### **Guidelines for Simulation Questions** The guidelines provided are standard for Cisco lab items: * Use the "Tasks" tab to see what needs to be done. * Use the "Topology" tab to access device consoles. * Do not remove existing configurations. * Do not change hostname or enable password. * **Crucially, save your configurations to NVRAM (`copy running-config startup-config`) before proceeding.** This ensures your changes persist if the device reloads and is often a mandatory step for completion credit in exams. --- ### **Task 1: Configure IPv4 Addressing** **Objective:** * Configure R1 with the first usable host IP address in the IPv4 network `10.0.12.4/30`. * Configure R2 with the last usable host IP address in the IPv4 network. * Verify connectivity using `ping`. **1. IPv4 Subnet Calculation (`10.0.12.4/30`)** * **CIDR Notation (`/30`)**: This indicates that the first 30 bits of the 32-bit IPv4 address are used for the network portion, and the remaining 2 bits are for the host portion. * **Number of Host Bits**: `32 - 30 = 2` bits. * **Number of Possible IP Addresses**: `2^2 = 4` addresses in total. * **Number of Usable Host IP Addresses**: `2^2 - 2 = 4 - 2 = 2` usable host addresses. (We subtract 2 because one address is reserved for the network identifier and one for the broadcast address). * **Subnet Mask**: For a `/30` prefix, the subnet mask is `255.255.255.252`. * (Binary: `11111111.11111111.11111111.11111100`) * **Network Address**: `10.0.12.4` (This is the identifier for the network, not assignable to a host). * **First Usable Host IP Address**: `10.0.12.5` * **Last Usable Host IP Address**: `10.0.12.6` * **Broadcast Address**: `10.0.12.7` (Used to send data to all devices on the segment, not assignable to a host). **2. Configuration Commands for Task 1** The goal is to assign `10.0.12.5` to R1 and `10.0.12.6` to R2, both with the subnet mask `255.255.255.252` on their `e0/0` interfaces. **On R1:** ``` configure terminal interface e0/0 ip address 10.0.12.5 255.255.255.252 no shutdown end copy running-config startup-config ``` * `configure terminal`: Enters global configuration mode. * `interface e0/0`: Selects the Ethernet 0/0 interface for configuration. * `ip address 10.0.12.5 255.255.255.252`: Assigns the IP address `10.0.12.5` and its subnet mask `255.255.255.252` to the interface. * `no shutdown`: Activates the interface. By default, router interfaces are administratively down. * `end`: Exits configuration modes and returns to privileged EXEC mode. * `copy running-config startup-config`: Saves the active configuration (running-config) to non-volatile RAM (NVRAM) so it persists across reloads. **On R2:** ``` configure terminal interface e0/0 ip address 10.0.12.6 255.255.255.252 no shutdown end copy running-config startup-config ``` * The commands are identical to R1, except for the assigned IP address, which is `10.0.12.6` as per the task requirements for the last usable host IP. **3. Verification for Task 1 (IPv4 Connectivity)** After configuring both routers, you need to verify that they can communicate using `ping`. `ping` sends ICMP (Internet Control Message Protocol) echo request packets and expects echo reply packets. **From R1:** ``` ping 10.0.12.6 ``` * This command attempts to reach R2's IP address from R1. A successful `ping` (usually indicated by `!!!!` or `.` followed by `Success rate is X percent`) means R1 can reach R2. **From R2:** ``` ping 10.0.12.5 ``` * This command attempts to reach R1's IP address from R2. A successful `ping` confirms two-way connectivity. --- ### **Task 2: Configure IPv6 Addressing** **Objective:** * **Do not assign the subnet router anycast address to either router.** * Configure R1 with the first usable host IP address in the IPv6 network `2001:db8:12::/126`. * Configure R2 with the last usable host IP address in the IPv6 network. * Verify connectivity using `ping`. **1. IPv6 Subnet Calculation (`2001:db8:12::/126`)** * **CIDR Notation (`/126`)**: This means the first 126 bits of the 128-bit IPv6 address are for the network prefix, and the remaining 2 bits are for the interface ID (host portion). * **Number of Host Bits**: `128 - 126 = 2` bits. * **Number of Possible Interface IDs**: `2^2 = 4`. * **Addresses in the `2001:db8:12::/126` subnet**: * `2001:db8:12::0` * `2001:db8:12::1` * `2001:db8:12::2` * `2001:db8:12::3` * **Subnet Router Anycast Address**: In IPv6, the address where all interface ID bits are zero (e.g., `2001:db8:12::0` for a `/126` prefix) is reserved as the "Subnet-Router Anycast Address" (RFC 4291). The task explicitly states **not** to assign this address to either router. This leaves `::1`, `::2`, and `::3` as potential unicast host addresses. * **"First usable host IP address" for R1**: `2001:db8:12::1` * **"Last usable host IP address" for R2**: For a point-to-point link requiring two addresses, and with `::0` reserved, the addresses commonly used are `::1` and `::2`. While `::3` is technically the numerically last address in the `/126` range *not* reserved for anycast, `::2` is conventionally used as the second endpoint address in such a link. In the context of the solution, `::2` is considered the "last" of the two addresses assigned to the hosts on the link. **2. Configuration Commands for Task 2** Before configuring IPv6 addresses on interfaces, IPv6 unicast routing must be enabled globally on the router. **On R1:** ``` configure terminal ipv6 unicast-routing interface e0/0 ipv6 address 2001:db8:12::1/126 no shutdown end copy running-config startup-config ``` * `ipv6 unicast-routing`: Enables IPv6 routing globally on the router. This command is crucial for the router to process and forward IPv6 packets. * `ipv6 address 2001:db8:12::1/126`: Assigns the IPv6 address `2001:db8:12::1` with a `/126` prefix length to interface `e0/0`. **On R2:** ``` configure terminal ipv6 unicast-routing interface e0/0 ipv6 address 2001:db8:12::2/126 no shutdown end copy running-config startup-config ``` * `ipv6 unicast-routing`: Also enabled on R2. * `ipv6 address 2001:db8:12::2/126`: Assigns `2001:db8:12::2` with a `/126` prefix length to interface `e0/0`. **3. Verification for Task 2 (IPv6 Connectivity)** **From R1:** ``` ping ipv6 2001:db8:12::2 ``` * To `ping` an IPv6 address, you typically specify `ipv6` before the address in privileged EXEC mode, especially if the source address might be ambiguous or if you want to explicitly use the IPv6 ping utility. This verifies R1's connectivity to R2's IPv6 address. **From R2:** ``` ping ipv6 2001:db8:12::1 ``` * This command verifies R2's connectivity to R1's IPv6 address. --- ### **Technical Terms Explained** * **Router (R1, R2)**: A network device that forwards data packets between computer networks. It performs the "routing" of traffic. * **Interface (e0/0)**: A physical or logical connection point on a network device (like a router) through which it sends and receives data. `e0/0` typically refers to Ethernet interface 0, slot 0. * **IP Address**: A numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. There are two main versions: * **IPv4**: A 32-bit address (e.g., `10.0.12.5`). * **IPv6**: A 128-bit address (e.g., `2001:db8:12::1`). * **Subnet / Subnetting**: The practice of dividing a network into two or more smaller networks. This improves network efficiency and security. * **CIDR (Classless Inter-Domain Routing)**: A method for allocating IP addresses and IP routing. It uses a variable-length subnet mask (e.g., `/30`, `/126`) to define the network and host portions of an IP address more flexibly than classful addressing. * **Subnet Mask (IPv4)**: A 32-bit number that distinguishes the network address from the host address within an IPv4 address. (e.g., `255.255.255.252` for `/30`). * **Prefix Length (IPv6)**: Similar to a subnet mask in IPv4, but directly indicates the number of bits in the network portion of the IPv6 address (e.g., `/126`). * **Network Address (IPv4)**: The first address in a subnet, used to identify the network itself. It's not assigned to a host. * **Broadcast Address (IPv4)**: The last address in a subnet, used to send data to all devices on that specific network segment. It's not assigned to a host. * **Usable Host IP Address**: An IP address within a subnet that can be assigned to an end device (like a computer, server, or router interface). * **Subnet Router Anycast Address (IPv6)**: A special IPv6 address within a subnet (all host bits are zero) that can be assigned to multiple routers. Packets sent to this address are delivered to the nearest router with the address. It's generally not assigned to individual host interfaces for normal unicast communication. * **`configure terminal`**: A command to enter global configuration mode, where you can make changes that affect the entire router. * **`interface`**: A command used to select a specific interface for configuration. * **`ip address`**: Command to assign an IPv4 address and subnet mask to an interface. * **`ipv6 address`**: Command to assign an IPv6 address and prefix length to an interface. * **`no shutdown`**: Command to administratively enable an interface (bring it "up"). Interfaces are typically `shutdown` by default. * **`ipv6 unicast-routing`**: A global configuration command that enables the router to forward IPv6 packets. Without this, the router won't route IPv6 traffic, even if interfaces have IPv6 addresses. * **`end`**: Command to exit the current configuration mode and return to privileged EXEC mode. * **`copy running-config startup-config`**: Command to save the configuration currently in RAM (running-config) to NVRAM (startup-config) so it is loaded when the router restarts. * **`ping`**: A command-line utility used to test the reachability of a host on an Internet Protocol (IP) network and to measure the round-trip time for messages sent from the originating host to a destination computer. --- This detailed analysis covers all aspects of the simulation question, including subnet calculations, command explanations, and verification steps, making it understandable for a beginner.
日本語
## CCNA試験問題解説 - IPv4/IPv6ルーティング設定シミュレーション 皆さん、こんにちは!Ciscoの技術スタッフです。この試験問題は、ルーティングの基本中の基本である、ルーター間のIPv4およびIPv6アドレス設定と疎通確認に関するシミュレーション問題です。ネットワークを構築する上で非常に重要なスキルですので、一緒にステップバイステップで見ていきましょう。 ### 導入 このシミュレーション問題では、2つのルーター「R1」と「R2」が直接接続されており、与えられたIPv4とIPv6のサブネット情報に基づいて、それぞれのインターフェースに適切なIPアドレスを設定し、正しく通信できることを確認することが求められます。 ### トポロジーと要件の確認 まず、提供された図と表を確認しましょう。 **トポロジー:** * **R1** と **R2** という2台のルーターがあります。 * 両方のルーターは `e0/0` というインターフェース(ポート)で直接ケーブル接続されています。 **IPアドレス情報:** | IP | Subnet | | :----- | :------------------ | | IPv4 | `10.0.12.4/30` | | IPv6 | `2001:db8:12::/126` | この表は、R1とR2の間で使用するネットワークのアドレス範囲を示しています。 **重要ガイドライン:** * 既存の設定は削除しないこと。 * `enable`パスワードやホスト名は変更しないこと。 * 設定後は必ず `copy running-config startup-config` で設定を保存すること。 ### Task 1: IPv4アドレス設定 #### 1.1 概念説明: `/30` サブネットとは? まず、`10.0.12.4/30` という表記について理解しましょう。 * `10.0.12.4` はネットワークアドレスの候補です。 * `/30` は「**プレフィックス長**」と呼ばれ、IPアドレスの最初の30ビットがネットワーク部分であることを示します。IPv4アドレスは全部で32ビットなので、`32 - 30 = 2` ビットがホスト部分(デバイスに割り当てられる部分)に利用できます。 2ビットで表現できるアドレスの数は `2^2 = 4` 個です。 この4つのアドレスにはそれぞれ役割があります。 1. **ネットワークアドレス (Network Address):** そのネットワーク自体を識別するためのアドレス。ホスト部分がすべて0。 2. **利用可能なホストアドレス (Usable Host Address):** 実際にデバイス(ルーターのインターフェースやPCなど)に割り当てられるアドレス。 3. **ブロードキャストアドレス (Broadcast Address):** そのネットワーク内のすべてのデバイスに一斉送信するために使われるアドレス。ホスト部分がすべて1。 `10.0.12.4/30` の場合の具体的なアドレスは以下のようになります。 * **ネットワークアドレス:** `10.0.12.4` (ホスト部が `00` の場合) * **最初の利用可能なホストアドレス:** `10.0.12.5` (ホスト部が `01` の場合) * **最後の利用可能なホストアドレス:** `10.0.12.6` (ホスト部が `10` の場合) * **ブロードキャストアドレス:** `10.0.12.7` (ホスト部が `11` の場合) `/30` の**サブネットマスク**は `255.255.255.252` になります。これは、最後のオクテットで`11111100`(252)となるためです。 #### 1.2 アドレス割り当ての指示 * **R1:** 最初の利用可能なホストIPアドレスを設定。 * 上記計算から `10.0.12.5` を割り当てます。 * **R2:** 最後の利用可能なホストIPアドレスを設定。 * 上記計算から `10.0.12.6` を割り当てます。 #### 1.3 設定コマンドと解説 **R1の設定:** ``` R1#configure terminal R1(config)#interface e0/0 R1(config-if)#ip address 10.0.12.5 255.255.255.252 R1(config-if)#no shutdown R1(config-if)#end R1#copy running-config startup-config ``` **R2の設定:** ``` R2#configure terminal R2(config)#interface e0/0 R2(config-if)#ip address 10.0.12.6 255.255.255.252 R2(config-if)#no shutdown R2(config-if)#end R2#copy running-config startup-config ``` **コマンド詳細解説:** * `configure terminal`: * **グローバルコンフィグレーションモード**に入ります。ルーター全体の設定を行うためのモードです。 * `interface e0/0`: * インターフェース `e0/0` (イーサネット0/0)の設定を行うための**インターフェースコンフィグレーションモード**に入ります。 * `ip address [IPアドレス] [サブネットマスク]`: * 選択したインターフェースにIPv4アドレスとサブネットマスクを割り当てます。 * R1では `10.0.12.5 255.255.255.252`、R2では `10.0.12.6 255.255.255.252` を設定します。 * `no shutdown`: * インターフェースを有効化(電源を入れるイメージ)します。デフォルトでは、Ciscoルーターのインターフェースは「shutdown(シャットダウン)」状態(無効化)になっています。 * `end`: * 現在のコンフィグレーションモードを終了し、特権EXECモードに戻ります。 * `copy running-config startup-config`: * 現在動作中の設定 (`running-config`) を、ルーターが起動時に読み込む設定ファイル (`startup-config`) に保存します。これを忘れると、ルーターが再起動したときに設定が消えてしまいますので、非常に重要です。 #### 1.4 疎通確認 (IPv4 Connectivity) 設定後、お互いのルーターが通信できるか `ping` コマンドで確認します。 **R1からR2へのping:** ``` R1#ping 10.0.12.6 ``` **R2からR1へのping:** ``` R2#ping 10.0.12.5 ``` 成功すると、通常は `!!!!!` または `Success rate is 100 percent` のような表示が出ます。 ### Task 2: IPv6アドレス設定 #### 2.1 概念説明: `/126` サブネットとAnycastアドレス 次に、IPv6 `2001:db8:12::/126` について理解しましょう。 * `2001:db8:12::` はIPv6のネットワークアドレスの候補です。`::` は `0000:0000:0000:0000` を省略した形です。 * `/126` はIPv6の**プレフィックス長**で、IPv6アドレスの最初の126ビットがネットワーク部分であることを示します。IPv6アドレスは全部で128ビットなので、`128 - 126 = 2` ビットがホスト部分(Interface ID)に利用できます。 IPv4の`/30`と同様に、2ビットで表現できるアドレスは `2^2 = 4` 個です。 1. **ネットワークアドレス:** `2001:db8:12::` (または `2001:db8:12::0`) (ホスト部が `00` の場合) 2. **最初の利用可能なホストアドレス:** `2001:db8:12::1` (ホスト部が `01` の場合) 3. **最後の利用可能なホストアドレス:** `2001:db8:12::2` (ホスト部が `10` の場合) 4. **サブネットルーターAnycastアドレス:** `2001:db8:12::3` (ホスト部が `11` の場合) ここで重要なのは、**「Do not assign the subnet router anycast address to either router.」**という指示です。 IPv6では、特定のサブネット内の最後のIPアドレス(今回の場合は`::3`)が「**サブネットルーターAnycastアドレス**」として予約されています。これは、そのサブネット内の任意のルーターにパケットを送るための特殊なアドレスです。通常、ポイントツーポイントリンクのインターフェースには割り当てません。 そのため、今回のケースで「最後の利用可能なホストIPアドレス」は `2001:db8:12::2` となります。 #### 2.2 アドレス割り当ての指示 * **R1:** 最初の利用可能なホストIPアドレスを設定。 * 上記計算から `2001:db8:12::1` を割り当てます。 * **R2:** 最後の利用可能なホストIPアドレスを設定。 * 上記計算とAnycastアドレスの制約から `2001:db8:12::2` を割り当てます。 #### 2.3 設定コマンドと解説 **R1の設定:** ``` R1#configure terminal R1(config)#ipv6 unicast-routing R1(config)#interface e0/0 R1(config-if)#ipv6 address 2001:db8:12::1/126 R1(config-if)#no shutdown R1(config-if)#end R1#copy running-config startup-config ``` **R2の設定:** ``` R2#configure terminal R2(config)#ipv6 unicast-routing R2(config)#interface e0/0 R2(config-if)#ipv6 address 2001:db8:12::2/126 R2(config-if)#no shutdown R2(config-if)#end R2#copy running-config startup-config ``` **コマンド詳細解説:** * `ipv6 unicast-routing`: * これはIPv6アドレスを設定する**前に**、ルーターがIPv6パケットのルーティング(転送)を行えるようにするための**グローバルコマンド**です。これを設定しないと、ルーターはIPv6パケットを正しく扱えない場合があります。 * `ipv6 address [IPv6アドレス]/[プレフィックス長]`: * 選択したインターフェースにIPv6アドレスとプレフィックス長を割り当てます。IPv4のように別途サブネットマスクを指定する必要はありません。 * R1では `2001:db8:12::1/126`、R2では `2001:db8:12::2/126` を設定します。 * その他のコマンド (`configure terminal`, `interface`, `no shutdown`, `end`, `copy running-config startup-config`) はIPv4設定と同じ意味です。 #### 2.4 疎通確認 (IPv6 Connectivity) IPv6アドレスの設定後も、お互いのルーターが通信できるか `ping` コマンドで確認します。 **R1からR2へのping:** ``` R1#ping ipv6 2001:db8:12::2 ``` **R2からR1へのping:** ``` R2#ping ipv6 2001:db8:12::1 ``` IPv6アドレスへのpingは、`ping ipv6` の後にアドレスを指定します。 ### 全般的な注意事項 * **設定の保存を忘れないでください!** `copy running-config startup-config` はラボ問題で非常に重要です。 * **既存設定の変更禁止:** 今回の問題では特に既存の設定変更は求められていませんが、実環境や他のラボ問題では、誤って既存の重要な設定を削除しないように注意が必要です。 * **コマンド入力の正確さ:** スペルミスやタイプミスはエラーの原因となります。慎重に入力しましょう。 * **`no shutdown`:** インターフェースを設定したら、必ず `no shutdown` で有効化してください。 ### まとめ このシミュレーション問題は、CiscoルーターにおけるIPv4とIPv6の基本的なインターフェースアドレス設定、サブネット計算の理解、そして疎通確認の方法を問うものでした。特にIPv6では、`ipv6 unicast-routing` の有効化や、Subnet Router Anycastアドレスの扱いなど、IPv4とは異なる点に注意が必要です。これらの基礎をしっかりと身につけることで、より複雑なネットワーク設定にも対応できるようになります。 頑張ってください! --- ### 専門用語解説 * **ルーター (Router):** 異なるネットワーク間(サブネット間)でデータ(パケット)を転送するネットワーク機器です。 * **インターフェース (Interface):** ルーターやスイッチなどのネットワーク機器が他の機器と接続するための物理的なポート(差込口)や論理的な接続点のことです。`e0/0` は「Ethernet 0/0」という名前のインターフェースを指します。 * **IPv4 (Internet Protocol version 4):** 現在広く利用されているIPアドレスの規格の一つで、32ビットの数字で表現されます(例: 192.168.1.1)。 * **IPv6 (Internet Protocol version 6):** IPv4の後継として開発されたIPアドレスの規格で、128ビットの数字で表現されます(例: 2001:db8::1)。アドレス枯渇問題の解決やセキュリティ強化などを目的としています。 * **サブネットマスク (Subnet Mask):** IPv4アドレスにおいて、どの部分がネットワークアドレスで、どの部分がホストアドレスであるかを区別するために使用される32ビットの数字です(例: 255.255.255.0)。 * **プレフィックス長 (Prefix Length):** IPv4(CIDR)やIPv6アドレスにおいて、ネットワークアドレス部分のビット数を示す表記です。`/24` や `/64` のようにスラッシュ記号の後に数字で表されます。 * **ネットワークアドレス (Network Address):** 特定のIPネットワーク全体を識別するアドレスです。 * **ブロードキャストアドレス (Broadcast Address):** 特定のネットワーク内のすべてのデバイスに同時にデータを送信するための特殊なIPv4アドレスです。 * **ホストアドレス (Host Address):** ネットワーク内の個々のデバイス(PC、サーバー、ルーターのインターフェースなど)に割り当てられるIPアドレスです。 * **Anycastアドレス (Anycast Address):** IPv6におけるアドレスタイプの一つ。特定のグループに属する複数のインターフェースに同じアドレスを割り当て、そのうちの「最も近い」インターフェース一つにパケットをルーティングします。 * **グローバルコンフィグレーションモード (Global Configuration Mode):** ルーター全体の一般的な設定(ホスト名、ルーティングプロトコルの有効化など)を行うためのCisco IOSの操作モードです。コマンドプロンプトは `(config)#` と表示されます。 * **インターフェースコンフィグレーションモード (Interface Configuration Mode):** 特定のインターフェースに特化した設定(IPアドレスの割り当て、速度設定など)を行うためのCisco IOSの操作モードです。コマンドプロンプトは `(config-if)#` と表示されます。 * **`no shutdown`:** インターフェースを有効化するコマンドです。 * **NVRAM (Non-Volatile RAM):** 電源を切ってもデータが消えないRAMのことです。Ciscoルーターでは、起動時に読み込む設定ファイル(`startup-config`)がNVRAMに保存されます。 * **`ping`:** 特定のIPアドレスを持つデバイスとのネットワーク接続性を確認するためのコマンドです。 * **`running-config`:** ルーターが現在メモリ上で使用している設定です。電源を切ると失われます。 * **`startup-config`:** ルーターのNVRAMに保存されている設定で、ルーター起動時に読み込まれます。
繁體中文
好的,身為 Cisco 的專業技術人員,我將針對這個模擬考試題目,以剛學習網路技術的學員能理解的方式,為您進行詳細的解析。 --- ## CCNA 考試題目解析:路由器 IPv4 與 IPv6 基本設定 ### 考試類型 這是一道 **實作題 (SIMULATION)**。這表示您需要在模擬器環境中,透過命令列介面 (CLI) 實際操作路由器來完成指定的設定任務。這類題目主要考察您的動手能力和對網路協定配置的理解。 ### 題目概述 這個題目要求您在兩個路由器 (R1 和 R2) 之間建立基本的 IPv4 和 IPv6 連線。您需要根據提供的網路拓撲圖和子網路資訊表,計算出正確的 IP 位址,並將它們配置到路由器的介面上,最後驗證連線是否成功。 ### 拓撲說明 (Topology Explanation) * **設備 (Devices):** 兩個路由器,分別命名為 R1 和 R2。 * **介面 (Interfaces):** 兩個路由器都使用 `e0/0` 這個介面(通常代表 Ethernet 0/0 或 GigabitEthernet 0/0,是路由器的實體網路埠)。 * **連線 (Connection):** R1 的 `e0/0` 介面與 R2 的 `e0/0` 介面直接透過一條線路連接。這表示它們位於同一個網路區段 (segment) 或稱為子網路 (subnet) 中。 * **IP 資訊表 (IP Information Table):** * **IPv4 網路:** `10.0.12.4/30` * **IPv6 網路:** `2001:db8:12::/126` ### 任務解析 (Task Analysis) 接下來,我們將逐一解析每個任務的要求、如何計算所需的 IP 位址以及對應的指令。 --- ### 任務 1: IPv4 設定與驗證 #### 任務目標 * **R1:** 配置為 IPv4 網路中「第一個可用的主機 IP 位址」。 * **R2:** 配置為 IPv4 網路中「最後一個可用的主機 IP 位址」。 * 驗證兩台路由器之間的連線是否正常 (使用 `ping` 命令)。 #### 關鍵點分析:IPv4 子網路計算 `10.0.12.4/30` 理解 `/30` 這個子網路遮罩 (Subnet Mask) 是關鍵。 * **子網路遮罩 (Subnet Mask):** 用來區分 IP 位址中,哪些部分屬於「網路位址 (Network Address)」,哪些部分屬於「主機位址 (Host Address)」。 * **前綴長度 (Prefix Length) / CIDR (無類別域間路由):** `/30` 表示子網路遮罩有 30 個連續的 `1`。一個 IPv4 位址總共有 32 位元。 * `30` 個位元用於網路部分。 * `32 - 30 = 2` 個位元用於主機部分。 * **可用 IP 位址數量:** 由於有 2 個位元用於主機部分,所以總共有 `2^2 = 4` 個可能的 IP 位址。 * **子網路位址的特性:** 在 IPv4 中,一個子網路的 IP 位址有以下固定用途: 1. **網路位址 (Network Address):** 這是子網路的第一個位址,不能分配給任何裝置。它代表了整個子網路。在我們的例子中,是 `10.0.12.4` (因為這是 /30 的起始點)。 2. **廣播位址 (Broadcast Address):** 這是子網路的最後一個位址,也不能分配給任何裝置。它用於向子網路內的所有裝置發送訊息。 3. **可用的主機 IP 位址 (Usable Host IP Address):** 介於網路位址和廣播位址之間的所有位址。這些才是我們可以分配給路由器介面、電腦或其他網路設備的 IP 位址。 #### 計算步驟 1. **子網路位址 (Network Address):** `10.0.12.4` (題目已給定)。 2. **計算廣播位址 (Broadcast Address):** * 在 `/30` 的情況下,一個子網路有 4 個 IP 位址。 * 如果第一個是 `10.0.12.4`,那麼接下來的位址就是 `10.0.12.5`、`10.0.12.6`。 * 第四個位址就是廣播位址:`10.0.12.7`。 3. **確認可用主機 IP 位址:** * 第一個可用的主機 IP 位址: `10.0.12.5` (分配給 R1) * 最後一個可用的主機 IP 位址: `10.0.12.6` (分配給 R2) 4. **子網路遮罩轉換:** `/30` 對應的點分十進位 (dotted-decimal) 子網路遮罩是 `255.255.255.252`。 #### R1 配置指令解析 ``` R1#configure terminal // 進入全域設定模式 (Global Configuration Mode) R1(config)#interface e0/0 // 進入介面設定模式 (Interface Configuration Mode),選擇 e0/0 介面 R1(config-if)#ip address 10.0.12.5 255.255.255.252 // 設定 IPv4 位址和子網路遮罩 R1(config-if)#no shutdown // 啟用介面 (如果介面預設是關閉的,必須使用此命令才能使其運作) R1(config-if)#end // 返回特權模式 (Privileged EXEC Mode) R1#copy running-config startup-config // 將目前記憶體中的設定存入非揮發性隨機存取記憶體 (NVRAM),確保重啟後設定不丟失。 ``` #### R2 配置指令解析 ``` R2#configure terminal R2(config)#interface e0/0 R2(config-if)#ip address 10.0.12.6 255.255.255.252 // 設定 IPv4 位址為最後一個可用 IP R2(config-if)#no shutdown R2(config-if)#end R2#copy running-config startup-config ``` #### 驗證 (IPv4 連線) * **從 R1 測試:** `ping 10.0.12.6` (嘗試連線到 R2 的 IPv4 位址) * **從 R2 測試:** `ping 10.0.12.5` (嘗試連線到 R1 的 IPv4 位址) 如果 `ping` 命令成功,通常會顯示 `!!!!` 或 `.` 後面跟 `Success rate is 100 percent` 類似的訊息,表示連線正常。 --- ### 任務 2: IPv6 設定與驗證 #### 任務目標 * **R1:** 配置為 IPv6 網路中「第一個可用的主機 IP 位址」。 * **R2:** 配置為 IPv6 網路中「最後一個可用的主機 IP 位址」。 * **重要注意事項:** 「不要將子網路路由器任播位址 (subnet router anycast address) 分配給任何路由器。」 * 驗證兩台路由器之間的連線是否正常 (使用 `ping` 命令)。 #### 關鍵點分析:IPv6 子網路計算 `2001:db8:12::/126` 理解 `/126` 這個前綴長度是關鍵。 * **前綴長度 (Prefix Length):** `/126` 表示 IPv6 位址中,有 126 個位元用於網路前綴 (Network Prefix)。一個 IPv6 位址總共有 128 位元。 * `126` 個位元用於網路前綴。 * `128 - 126 = 2` 個位元用於介面識別碼 (Interface ID),類似於 IPv4 的主機部分。 * **可用 IP 位址數量:** 由於有 2 個位元用於介面識別碼,所以總共有 `2^2 = 4` 個可能的 IP 位址。 * **IPv6 位址的特性:** 與 IPv4 不同,IPv6 沒有廣播位址。 1. **子網路位址 (Subnet Address):** `2001:db8:12::` (或 `2001:db8:12::0`),代表整個子網路。 2. **子網路路由器任播位址 (Subnet Router Anycast Address):** 這是 IPv6 子網路中的**第一個有效主機位址** (通常是 Interface ID 全為 0),但它被定義為任播位址。題目明確要求「不要分配給任何路由器」。任播位址是一種特殊位址,可以分配給多個裝置,封包會路由到離發送端最近的那個。 3. **可用的主機 IP 位址 (Usable Host IP Address):** 扣除子網路路由器任播位址後,其餘的可分配位址。 #### 計算步驟 1. **子網路前綴 (Network Prefix):** `2001:db8:12::/126` 2. **分析介面識別碼 (Interface ID) 的 2 個位元:** * `00` (對應 `::0`): 這是子網路路由器任播位址。**根據題目要求,不能使用。** * `01` (對應 `::1`): 第一個可用的主機 IP 位址 (給 R1)。 * `10` (對應 `::2`): 第二個可用的主機 IP 位址 (給 R2)。 * `11` (對應 `::3`): 第三個可用的主機 IP 位址 (如果有需要,這條鏈路通常只會用兩個 IP)。 3. **確認可用主機 IP 位址:** * 第一個可用的主機 IP 位址 (排除任播位址): `2001:db8:12::1` (分配給 R1) * 最後一個可用的主機 IP 位址 (在此範圍內): `2001:db8:12::2` (分配給 R2) #### R1 配置指令解析 ``` R1#configure terminal R1(config)#ipv6 unicast-routing // 啟用 IPv6 單播路由功能。在路由器上要啟用 IPv6 路由,這個命令是必不可少的。 R1(config)#interface e0/0 R1(config-if)#ipv6 address 2001:db8:12::1/126 // 設定 IPv6 位址和前綴長度 R1(config-if)#no shutdown R1(config-if)#end R1#copy running-config startup-config ``` #### R2 配置指令解析 ``` R2#configure terminal R2(config)#ipv6 unicast-routing // R2 也需要啟用 IPv6 單播路由 R2(config)#interface e0/0 R2(config-if)#ipv6 address 2001:db8:12::2/126 // 設定 IPv6 位址 R2(config-if)#no shutdown R2(config-if)#end R2#copy running-config startup-config ``` #### 驗證 (IPv6 連線) * **從 R1 測試:** `ping ipv6 2001:db8:12::2` (嘗試連線到 R2 的 IPv6 位址) * **注意:** `ping` 命令後面需要加上 `ipv6` 關鍵字來指定您要 ping 的是 IPv6 位址。 * **從 R2 測試:** `ping ipv6 2001:db8:12::1` (嘗試連線到 R1 的 IPv6 位址) 如果 `ping` 命令成功,表示 IPv6 連線也正常。 --- ### 專業名詞解釋 (Glossary of Technical Terms) * **路由器 (Router):** 網路設備,負責在不同網路之間轉發數據包 (data packets)。 * **介面 (Interface):** 路由器或交換器上的實體連接埠 (例如:Ethernet 0/0, GigabitEthernet 0/0),用於連接其他網路設備或網路線。 * **IPv4 (Internet Protocol version 4):** 網際網路通訊協定第四版,最常用的網路層協定,使用 32 位元位址 (例如:192.168.1.1)。 * **IPv6 (Internet Protocol version 6):** 網際網路通訊協定第六版,為了解決 IPv4 位址耗盡問題而設計,使用 128 位元位址 (例如:2001:db8::1)。 * **子網路 (Subnet):** 將一個較大的網路分割成若干個較小的、可管理的網路區塊。 * **子網路遮罩 (Subnet Mask):** 一個 32 位元的數字,與 IPv4 位址配合使用,用來識別 IP 位址中哪部分是網路位址,哪部分是主機位址 (例如:255.255.255.0)。 * **前綴長度 (Prefix Length):** 在 CIDR (Classless Inter-Domain Routing,無類別域間路由) 表示法中,用斜線 `/` 後面跟一個數字表示子網路遮罩的長度 (例如:`/24` 等同於 `255.255.255.0`)。IPv6 中則直接使用前綴長度。 * **網路位址 (Network Address):** 一個子網路中的第一個位址,用來代表整個子網路,不能分配給單一設備。 * **廣播位址 (Broadcast Address):** 在 IPv4 子網路中,用來向該子網路內所有設備發送訊息的特殊位址,也不能分配給單一設備。IPv6 沒有廣播位址。 * **可用主機 IP 位址 (Usable Host IP Address):** 除了網路位址和廣播位址 (IPv4) 或特殊保留位址 (IPv6) 之外,可以分配給網路設備的 IP 位址。 * **ping (Packet Internet Groper):** 一個常用的網路工具,用於測試網路主機之間的可達性和連線品質。它發送 ICMP 回送請求包 (Echo Request) 並等待回送應答包 (Echo Reply)。 * **全域設定模式 (Global Configuration Mode):** 路由器的主要設定模式,可以從這裡進入其他子模式進行更詳細的設定 (例如:`configure terminal`)。 * **介面設定模式 (Interface Configuration Mode):** 針對特定介面進行設定的模式 (例如:`interface e0/0`)。 * **特權執行模式 (Privileged EXEC Mode):** 路由器的管理模式,可以執行各種顯示和管理命令,也可以進入設定模式。 * **`no shutdown`:** 命令,用於啟用路由器的介面。介面預設可能處於關閉 (shutdown) 狀態。 * **`copy running-config startup-config`:** 命令,用於將路由器當前在記憶體中運行的配置 (running-config) 保存到非揮發性隨機存取記憶體 (NVRAM) 中的啟動配置 (startup-config) 中。這樣,當路由器重啟時,這些設定才不會丟失。 * **`ipv6 unicast-routing`:** 命令,用於在路由器上啟用 IPv6 單播路由功能。如果沒有啟用,即使介面配置了 IPv6 位址,路由器也不會處理 IPv6 數據包的轉發。 * **子網路路由器任播位址 (Subnet Router Anycast Address):** 在 IPv6 中,一個子網路中的特定位址(通常是 Interface ID 全為 0),可以分配給子網路中的多個路由器。當有數據包發送到這個任播位址時,它會被路由到離發送者最近的路由器,而不是像單播一樣發送到唯一一台設備。題目要求不將其分配為普通接口地址,避免誤用。 ### 考試策略與注意事項 1. **仔細閱讀題目:** 務必確認每個任務的所有要求,特別是像 IPv6 任務中「不分配子網路路由器任播位址」這樣的細節。 2. **理解子網路計算:** IPv4 的 `/30` 和 IPv6 的 `/126` 都只提供 2 個可用的主機 IP,需要精確計算。 3. **啟用介面:** 許多新手會忘記在介面設定後使用 `no shutdown` 命令。 4. **啟用 IPv6 路由:** 在路由器上設定 IPv6 位址後,別忘了在全域設定模式下啟用 `ipv6 unicast-routing`。 5. **儲存配置:** 在完成所有任務後,**務必**使用 `copy running-config startup-config` 命令儲存您的配置。如果沒有儲存,系統會認為您沒有完成任務。 6. **驗證連線:** 配置完成後,一定要使用 `ping` 命令來驗證連線是否成功。這是確認設定正確的最終步驟。 7. **熟悉命令列:** 練習在 Cisco 設備的 CLI 下快速輸入和切換模式。 8. **錯誤排查:** 如果 `ping` 不成功,可能是以下原因: * IP 位址或子網路遮罩設定錯誤。 * 介面未啟用 (`no shutdown` 未執行)。 * IPv6 路由未啟用 (`ipv6 unicast-routing` 未執行)。 * R1 和 R2 之間的介面不匹配 (雖然這個題目不太可能發生)。 * 可以嘗試使用 `show ip interface brief` 或 `show ipv6 interface brief` 命令來檢查介面的狀態和 IP 位址。 --- 希望這份詳細的解析能幫助您完全理解這個 CCNA 考試題目,並在未來的考試中取得好成績!
简体中文
你好!我是来自 Cisco 的技术专家。很高兴能为你解析这道 CCNA 实验题。 这道题考察的是网络工程师最基础也最重要的技能:**接口的 IP 地址配置(IPv4 和 IPv6)以及连通性测试**。对于刚接触网络的小白来说,理解“子网划分”和“可用地址”是解题的关键。 下面我将分步骤为你拆解这个实验。 --- ### 💡 核心知识点先行 在开始配置前,我们需要先理解题目给出的两个网段: 1. **IPv4 网段:`10.0.12.4/30`** * **/30 掩码**:这意味着子网掩码是 `255.255.255.252`。这种掩码常用于两个路由器点对点的连接,因为它只提供 2 个可用的主机地址。 * **网络地址**:`10.0.12.4` * **第一个可用地址**:`10.0.12.5` (R1 使用) * **最后一个可用地址**:`10.0.12.6` (R2 使用) * **广播地址**:`10.0.12.7` 2. **IPv6 网段:`2001:db8:12::/126`** * **/126 掩码**:在 IPv6 中,这表示前 126 位是网络部分,剩下 2 位给主机。 * **地址范围**:从 `::0` 到 `::3`(共 4 个地址)。 * **Subnet Router Anycast 地址**:即 `::0`。题目明确要求不要使用它。 * **第一个可用地址**:`2001:db8:12::1` (R1 使用) * **最后一个可用地址**:`2001:db8:12::2` (R2 使用,注:虽然 ::3 也可以,但通常在 /126 中习惯使用 1 和 2) --- ### 🛠️ 任务一:IPv4 配置解析 #### R1 配置步骤: ```bash R1#configure terminal # 进入全局配置模式 R1(config)#interface e0/0 # 进入连接 R2 的 e0/0 接口 R1(config-if)#ip address 10.0.12.5 255.255.255.252 # 配置第一个可用地址 R1(config-if)#no shutdown # 开启接口(默认接口是关闭的) R1(config-if)#end # 退回特权模式 R1#copy running-config startup-config # 保存配置到 NVRAM(考试必备动作!) ``` #### R2 配置步骤: ```bash R2#configure terminal R2(config)#interface e0/0 R2(config-if)#ip address 10.0.12.6 255.255.255.252 # 配置最后一个可用地址 R2(config-if)#no shutdown R2(config-if)#end R2#copy running-config startup-config ``` --- ### 🛠️ 任务二:IPv6 配置解析 **注意**:在 Cisco 路由器上配置 IPv6 时,必须先开启 IPv6 路由功能。 #### R1 配置步骤: ```bash R1#configure terminal R1(config)#ipv6 unicast-routing # 开启 IPv6 单播路由转发功能 R1(config)#interface e0/0 R1(config-if)#ipv6 address 2001:db8:12::1/126 # 配置 IPv6 地址 R1(config-if)#no shutdown R1(config-if)#end R1#copy running-config startup-config ``` #### R2 配置步骤: ```bash R2#configure terminal R2(config)#ipv6 unicast-routing R2(config)#interface e0/0 R2(config-if)#ipv6 address 2001:db8:12::2/126 # 配置 IPv6 地址 R2(config-if)#no shutdown R2(config-if)#end R2#copy running-config startup-config ``` --- ### ✅ 验证连通性 (Verification) 配置完成后,必须使用 `ping` 命令测试。如果看到 `!!!!!` (五个感叹号),说明配置成功。 * **在 R1 上输入**:`ping 10.0.12.6` 和 `ping ipv6 2001:db8:12::2` * **在 R2 上输入**:`ping 10.0.12.5` 和 `ping ipv6 2001:db8:12::1` --- ### 📖 专业名词小贴士 1. **Subnet (子网)**:将一个大的网络划分成若干个小的网络,以便更好地管理和节省 IP 地址。 2. **NVRAM (非易失性存储器)**:路由器关机后数据不会丢失的地方。执行 `copy running-config startup-config` 就是把当前正在运行的配置存入这里。 3. **no shutdown**:Cisco 路由器的物理接口默认是 `shutdown` (关闭) 状态,必须手动输入此命令才能让接口变绿起效。 4. **Anycast (任播) 地址**:IPv6 特有。题目提到的 "Subnet Router Anycast" 是指该网段的第一个地址(全 0),通常用于寻址该链路上的任何路由器。 5. **Unicast (单播)**:指从一个源到一个目的地的点对点传输。 ### 🌟 专家提醒 在 CCNA 考试中,**保存配置**(`copy run start` 或简写 `write`)是非常关键的一步,很多考生虽然配置正确但忘记保存,导致实验题丢分。请一定要养成随手保存的好习惯! 希望这个解析能帮你顺利掌握 IP 配置!加油!