Question #1357

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 preconfigurations have been applied. • 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 - IP connectivity between the three routers is established. IP Services must be configured in the order presented to complete the implementation. 1. Configure dynamic one-to-one address mapping on R2 using a standard list named XLATE, which allows all traffic to translate the source address of R3 to a pool named test_pool using the 10.10.10.0/24 network for traffic sent from R3 to R1. Avoid using an NVI configuration. Verify reachability by sending a ping to 192.168.100.1 from R3. 2. Configure R3 to dynamically receive an IP address on Ethernet0/2 from the DHCP server. 3. Configure R1 as an NTP server and R2 as a client, not as a peer, using the IP address 10.1.2.1. 4. Configure SSH access from R1 to R3, while excluding access via other remote connection protocols using the user root and password s3cret on router R3 using RSA. Verify connectivity from router R1 to R3 using a destination address assigned to interface E0/2 on R3.
English
This is a comprehensive simulation question designed to test various fundamental IP services configurations on Cisco routers. It requires careful attention to detail, understanding of network topologies, and the ability to apply specific commands. Let's break down each task. ## **Detailed Analysis of the Simulation Question** ### **Overall Goal** The simulation aims to establish a fully functional IP network across three routers (R1, R2, R3) by configuring essential IP services like Network Address Translation (NAT), DHCP client functionality, Network Time Protocol (NTP), and Secure Shell (SSH) access. The tasks must be completed in the specified order as some configurations depend on previous steps. ### **Topology Overview** * **R1:** * `Loopback0 (Lo0)`: `192.168.100.1` * `Ethernet0/0 (E0/0)`: `10.1.2.1` (connected to R2) * `Ethernet0/2 (E0/2)`: `10.1.3.1` (connected to R3) * **R2:** * `Loopback0 (Lo0)`: `192.168.200.1` * `Ethernet0/0 (E0/0)`: `10.1.2.2` (connected to R1) * `Ethernet0/1 (E0/1)`: `10.2.3.2` (connected to R3) * **R3:** * `Loopback0 (Lo0)`: `192.168.3.1` * `Ethernet0/2 (E0/2)`: `10.1.3.11` (currently static, but will change in Task 2) (connected to R1) * `Ethernet0/1 (E0/1)`: `10.2.3.3` (connected to R2) ### **Task 1: Configure Dynamic One-to-One Address Mapping (NAT) on R2** **Concept Explanation:** * **Network Address Translation (NAT):** NAT is a technology that allows devices with private IP addresses (addresses not routable on the internet, like `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to communicate with devices on public networks (like the internet) by translating their private IP addresses to public ones. * **Dynamic One-to-One NAT:** In dynamic NAT, a pool of public IP addresses is reserved. When a device with a private IP address needs to communicate with the outside, an available public IP address from the pool is assigned to it for the duration of the communication. "One-to-one" implies that each private IP address is mapped to a *unique* public IP address from the pool, meaning if R3's Loopback0 `192.168.3.1` uses `10.10.10.10`, then `10.10.10.10` is reserved for it until the translation expires. * **Inside/Outside Interfaces:** Routers performing NAT distinguish between "inside" interfaces (facing the private network) and "outside" interfaces (facing the public network or another network where translated addresses will be seen). * **Standard Access List:** A standard access list is used here to identify which *source* IP addresses are permitted to be translated. * **NAT Pool:** A range of IP addresses that the router will use for translation. These are the "public" or "global" addresses. **Requirements Breakdown:** * **On R2:** R2 is the router performing NAT. * **Standard list named XLATE:** This access list will define the *inside local* addresses (R3's private addresses) that need translation. * **Allows all traffic to translate the source address of R3:** This means any traffic originating from R3's IP addresses should be translated. The provided `permit` statements in the reference commands specifically cover R3's Lo0 (`192.168.3.1`), E0/1 (`10.2.3.3`), and E0/2 (`10.1.3.11`) interfaces. These are the "inside local" addresses. * **To a pool named test_pool using the 10.10.10.0/24 network:** This defines the "inside global" addresses for translation. The pool will contain addresses from this range. * **For traffic sent from R3 to R1:** This helps determine the inside and outside interfaces. Traffic from R3 (inside) goes through R2 and then to R1 (outside). Therefore, R2's interface connecting to R3 (E0/1) will be the `ip nat inside` interface, and R2's interface connecting to R1 (E0/0) will be the `ip nat outside` interface. * **Avoid using an NVI configuration:** This simply means to use the traditional `ip nat inside` and `ip nat outside` interface commands, rather than the newer NAT Virtual Interface method. **Commands and Explanations:** ``` R2(config)# ip access-list standard XLATE ``` * Creates a standard IP access list named `XLATE`. This list will be used to identify which internal IP addresses are allowed to be translated. ``` R2(config-std-nacl)# permit 192.168.3.1 R2(config-std-nacl)# permit 10.2.3.3 R2(config-std-nacl)# permit 10.1.3.11 ``` * These commands add entries to the `XLATE` access list. They permit traffic originating from R3's Loopback0 address (`192.168.3.1`), R3's E0/1 address (`10.2.3.3`), and R3's E0/2 address (`10.1.3.11`). These are the **inside local** addresses that will be translated. ``` R2(config)# interface Ethernet0/1 R2(config-if)# ip nat inside ``` * Configures R2's `Ethernet0/1` interface (connected to R3) as the **inside** NAT interface. Traffic entering this interface from R3 will be considered for translation. ``` R2(config)# interface Ethernet0/0 R2(config-if)# ip nat outside ``` * Configures R2's `Ethernet0/0` interface (connected to R1) as the **outside** NAT interface. Translated traffic will exit this interface, and return traffic will enter this interface. ``` R2(config)# ip nat pool test_pool 10.10.10.1 10.10.10.254 netmask 255.255.255.0 ``` * Defines a NAT pool named `test_pool`. This pool contains the **inside global** IP addresses (`10.10.10.1` to `10.10.10.254`) that will be used to translate the inside local addresses. The `netmask` specifies the subnet mask for these addresses. ``` R2(config)# ip nat inside source list XLATE pool test_pool ``` * This is the core NAT configuration command. It tells R2 to: * Perform NAT for traffic coming from the **inside** interface. * Translate the **source** IP addresses. * Identify which source addresses to translate using the access **list XLATE**. * Translate these addresses to an available IP address from the **pool test_pool**. **Verification:** ``` R3# ping 192.168.100.1 source Loopback0 ``` * This command tests end-to-end reachability. R3 sends a ping to R1's Loopback0 (`192.168.100.1`), specifically sourcing the ping from its own Loopback0 interface (`192.168.3.1`). * **Expected Behavior:** When the ping packet reaches R2 from R3, R2's NAT configuration should translate R3's source IP (`192.168.3.1`) to an IP address from the `test_pool` (`10.10.10.x`). R1 will then see the ping coming from `10.10.10.x` and reply. R2 will then reverse-translate the reply back to `192.168.3.1` for R3. A successful ping confirms NAT is working correctly. * **Additional verification (not in task but good to know):** `show ip nat translations` on R2 would display the active NAT mappings. ### **Task 2: Configure R3 to Dynamically Receive an IP Address on Ethernet0/2 from the DHCP server** **Concept Explanation:** * **DHCP (Dynamic Host Configuration Protocol):** DHCP is a network protocol that allows a server to automatically assign IP addresses and other network configuration parameters (like subnet mask, default gateway, DNS servers) to devices (clients) on a network. This simplifies network administration and prevents IP address conflicts. * **DHCP Client:** A device configured as a DHCP client sends requests to a DHCP server to obtain network configuration dynamically. **Requirements Breakdown:** * **R3 to dynamically receive an IP address:** R3 will act as a DHCP client. * **On Ethernet0/2:** The interface E0/2 on R3 is the one that needs to obtain an IP address via DHCP. The current IP (`10.1.3.11`) will be replaced. **Commands and Explanations:** ``` R3(config)# interface Ethernet0/2 ``` * Enters interface configuration mode for `Ethernet0/2` on R3. ``` R3(config-if)# ip address dhcp ``` * This command configures the `Ethernet0/2` interface to obtain its IP address, subnet mask, and other IP parameters dynamically from a DHCP server. It will send a DHCP Discover message. ``` R3(config-if)# no shutdown ``` * Ensures that the interface is administratively up. While often enabled by default, it's good practice to include it, especially if an interface was previously shut down. **Verification:** ``` R3# show ip interface brief ``` * Displays a summary of all interfaces, their IP addresses, and their status. You should see a new IP address assigned to `Ethernet0/2` (likely from the `10.1.3.0/24` network, if R1 is the DHCP server). ``` R3# show dhcp lease ``` * Shows details about the DHCP lease obtained by the client, including the assigned IP address, lease expiration time, and the DHCP server's IP address. ### **Task 3: Configure R1 as an NTP server and R2 as a client, not as a peer, using the IP address 10.1.2.1** **Concept Explanation:** * **NTP (Network Time Protocol):** NTP is a protocol used to synchronize the clocks of computer systems over a network. Accurate time is crucial for logging, security, and correlation of events across multiple devices. * **NTP Server:** An NTP server provides time synchronization to other devices. * **NTP Client:** An NTP client requests time synchronization from an NTP server. * **NTP Peer:** An NTP peer both provides and requests time synchronization from another peer, allowing for redundant time sources and better accuracy. The task specifically says "not as a peer", meaning R2 should only be a client. **Requirements Breakdown:** * **R1 as an NTP server:** R1 will be the source of time for R2. * **R2 as a client:** R2 will obtain its time from R1. * **Not as a peer:** R2 should only be configured to receive time, not to also provide time back to R1 or other devices as an authoritative source. * **Using the IP address 10.1.2.1:** This is the IP address of R1's `Ethernet0/0` interface, which is directly connected to R2. R2 will use this as its NTP server address. **Commands and Explanations:** * **On R1 (NTP Server):** ``` R1(config)# ntp master ``` * This command configures R1 to act as an authoritative NTP server. Without an external time source, `ntp master` causes the router to consider its own clock as authoritative, using stratum 8 (a lower stratum number indicates a more accurate time source, 1 being the most authoritative). If R1 were connected to a more accurate NTP server, it would sync with that server and then provide time to its clients. * **On R2 (NTP Client):** ``` R2(config)# ntp server 10.1.2.1 ``` * This command configures R2 to synchronize its clock with the NTP server located at `10.1.2.1` (R1's `Ethernet0/0` interface). **Verification:** * **On R2:** ``` R2# show ntp status ``` * Displays the NTP synchronization status of R2. It should show that the clock is synchronized and which server it's synchronized with. ``` R2# show ntp associations ``` * Shows a list of configured NTP associations (servers or peers) and their current state. You should see `10.1.2.1` listed, and after a short period, it should show a synchronized status (e.g., `*` next to the server address). ### **Task 4: Configure SSH access from R1 to R3, while excluding access via other remote connection protocols using the user root and password s3cret on router R3 using RSA. Verify connectivity from router R1 to R3 using a destination address assigned to interface E0/2 on R3.** **Concept Explanation:** * **SSH (Secure Shell):** SSH is a cryptographic network protocol for secure remote access to network devices. It encrypts all traffic, including passwords, unlike Telnet which sends everything in plain text. * **Telnet:** An older, insecure protocol for remote access that sends data, including authentication credentials, in plain text. The task asks to exclude other remote connection protocols, effectively meaning "use SSH, not Telnet". * **RSA Keys:** Rivest-Shamir-Adleman (RSA) is an algorithm used for generating public and private key pairs, essential for secure encryption in SSH. The router generates these keys for its SSH server functionality. * **VTY Lines:** Virtual Teletype (VTY) lines are logical interfaces used for remote access (Telnet, SSH). **Requirements Breakdown:** * **Configure SSH access from R1 to R3:** R3 will be the SSH server, R1 will be the SSH client. * **Excluding access via other remote connection protocols:** This means configuring the VTY lines on R3 to *only* accept SSH connections. * **Using the user root and password s3cret on router R3:** A local user account `root` with password `s3cret` needs to be created on R3 for authentication. * **Using RSA:** R3 needs to generate RSA cryptographic keys to support SSH. * **Verify connectivity from router R1 to R3 using a destination address assigned to interface E0/2 on R3:** This is critical. In Task 2, R3's E0/2 obtained its IP address via DHCP. So, for verification, you must first determine what IP address E0/2 received on R3 (e.g., using `show ip interface brief` on R3), then use that IP address as the destination for the SSH command from R1. **Commands and Explanations:** * **On R3 (SSH Server):** ``` R3(config)# ip domain-name cisco.com ``` * A domain name is required before generating RSA cryptographic keys for SSH. You can use any valid domain name. ``` R3(config)# username root secret s3cret ``` * Creates a local user account named `root` with the encrypted password `s3cret`. This user will be used for SSH authentication. ``` R3(config)# crypto key generate rsa ``` * Generates the RSA public and private key pair. When prompted, a key modulus (strength) of 1024 or 2048 bits is generally recommended for production. The default is usually 512, which is acceptable for lab environments if not specified. ``` R3(config)# line vty 0 4 ``` * Enters configuration mode for the virtual terminal lines (VTY 0 to 4), which are used for remote access. ``` R3(config-line)# transport input ssh ``` * This is crucial. It restricts remote access to these VTY lines to *only* SSH connections. Any Telnet attempts will be denied. ``` R3(config-line)# login local ``` * Configures the VTY lines to use the local user database (the `username root` account created earlier) for authentication. ``` R3(config-line)# exit ``` * Exits line configuration mode. **Verification:** * **On R3 (to find the E0/2 IP):** ``` R3# show ip interface brief ``` * Find the IP address assigned to `Ethernet0/2` after Task 2. Let's assume it's `10.1.3.50` for this example. * **On R1 (to connect via SSH):** ``` R1# ssh -l root 10.1.3.50 ``` * Initiates an SSH connection from R1 to R3, using the username `root` and the dynamically assigned IP address of R3's `Ethernet0/2` interface (substitute `10.1.3.50` with the actual IP address obtained by R3 in Task 2). * You will be prompted for the password `s3cret`. If successful, you will gain access to R3's command-line interface, confirming SSH connectivity. ### **Important Notes for a Simulation Exam:** * **Save Configuration:** Always remember to save your configurations to NVRAM (`copy running-config startup-config` or `write mem`) after completing each task or before moving to the next question. The guidelines explicitly state this. * **Order of Operations:** The tasks are explicitly stated to be in order. Do not skip or reorder them, as dependencies exist (e.g., DHCP client on R3's E0/2 affects the SSH verification step). * **Exact Matching:** Pay close attention to names (e.g., `XLATE` for the access list, `test_pool` for the NAT pool, `root` for the username). Any deviation might cause the automated grading system to mark it incorrect. * **Verify Each Task:** Use the provided verification commands for each task to ensure it's correctly implemented before proceeding. If a verification step fails, troubleshoot and correct the configuration. * **Console Access:** The simulation environment provides console access to all devices. Use the tabs or click device icons to switch between router consoles. * **No Pre-configurations:** While it states "All necessary preconfigurations have been applied," this usually refers to basic routing and interface IP addressing for initial connectivity (which is good, as stated "IP connectivity between the three routers is established"). Your job is to add the *IP services* on top of this. * **Do Not Change Enable Password or Hostname:** Adhere strictly to these rules. By following this detailed analysis and understanding the underlying concepts, a beginner can successfully approach and complete this type of CCNA simulation question.
日本語
はい、承知いたしました。Ciscoのネットワーク技術者として、このCCNAの実装問題について、初心者の方にも分かりやすく、専門用語を説明しながら解説します。Markdown形式で出力します。 --- ## CCNA模擬試験問題:ルーティングとサービス設定の解析 この試験は、Ciscoルーターにおける基本的なルーティングと様々なネットワークサービスの設定能力を問う実践的なシミュレーション問題です。ネットワーク図(トポロジー)を参考に、指定されたタスクを順番に実行していく必要があります。 ### 全体的なガイドラインの理解 まず、問題の冒頭にあるガイドラインを理解することが重要です。 * **SIMULATION**: これは仮想デバイス上でタスクを実行する実機操作問題です。 * **Tasksタブ/Topologyタブ**: 問題文と設定を行うコンソール画面は別々に提供されています。適宜切り替えて使用します。 * **デバイスコンソールへのアクセス**: 各ルーターのアイコンをクリックするか、コンソールウィンドウ上部のタブを使ってアクセスできます。 * **必要な事前設定は完了済み**: 基本的なIPアドレス設定やルーティングは既にされているので、今回のタスクに集中できます。 * **Enableパスワードやホスト名の変更禁止**: これらの設定は採点対象外であり、変更すると問題が発生する可能性があるので触らないでください。 * **NVRAMへの設定保存**: 各タスクを完了したら、忘れずに`copy running-config startup-config`コマンドで設定を保存しましょう。これを忘れると、次へ進んだ際に設定が失われ、不合格になる可能性があります。 * **Nextボタン**: 全てのタスクが完了したら、このボタンで提出します。一度提出すると戻れないので注意が必要です。 ### ネットワークトポロジーの確認 下図が今回のネットワーク構成です。各ルーターのインターフェース名とIPアドレス、そしてループバックインターフェースのIPアドレスを確認しておきましょう。 ``` Lo1: 192.168.100.1 | +-----+ | R1 | +-----+ / E0/0 \ E0/2 10.1.2.1 10.1.3.1 | | | | | | | | | E0/0 | E0/2 +-----+ +-----+ | R2 |-----| R3 | +-----+ E0/1 +-----+ 10.1.2.2 10.2.3.2 10.1.3.11 E0/1 Lo1: 192.168.3.1 \ E0/1 / 10.2.3.3 \ / \ / \ / Lo1: 192.168.200.1 ``` **各ルーターの主要インターフェースとIPアドレス:** * **R1:** * Loopback0 (Lo1): `192.168.100.1` * Ethernet0/0 (E0/0): `10.1.2.1` * Ethernet0/2 (E0/2): `10.1.3.1` * **R2:** * Loopback0 (Lo1): `192.168.200.1` * Ethernet0/0 (E0/0): `10.1.2.2` (R1と接続) * Ethernet0/1 (E0/1): `10.2.3.2` (R3と接続) * **R3:** * Loopback0 (Lo1): `192.168.3.1` * Ethernet0/2 (E0/2): `10.1.3.11` (R1と接続、**ただしタスク2で変更される**ことに注意) * Ethernet0/1 (E0/1): `10.2.3.3` (R2と接続) 「IP connectivity between the three routers is established.」とあるので、R1, R2, R3間での基本的なルーティングは既に確立されていることを前提としています。 --- ### タスクの解析と設定手順 各タスクについて、目的、専門用語、設定手順、ポイント、確認方法を詳しく見ていきましょう。 --- #### タスク1:R2での動的ワンツーワンアドレスマッピング(NAT)の設定 **目的:** R3からR1への通信において、R3の送信元IPアドレスを、R2上のNATプールで定義されたIPアドレスに変換するようにR2を設定します。これにより、R1から見るとR3からの通信がR2の別のアドレスから来たように見えます。NVI(NAT Virtual Interface)は使用しないように指示されています。 **専門用語解説:** * **IPアドレス変換 (NAT - Network Address Translation):** プライベートIPアドレスとグローバルIPアドレスを相互に変換する技術です。通常、組織内のプライベートネットワーク(限られた範囲で自由に使用できるIPアドレス)のデバイスがインターネット(グローバルな公開ネットワーク)にアクセスする際に、限られたグローバルIPアドレスを効率的に利用するために使われます。 * **プライベートIPアドレス:** 組織内部でのみ使用されるIPアドレス。インターネット上ではルーティングされません。例:`192.168.x.x`、`10.x.x.x`、`172.16.x.x`〜`172.31.x.x`。 * **グローバルIPアドレス:** インターネット上で公開され、一意に識別されるIPアドレス。 * **動的ワンツーワンアドレスマッピング (Dynamic One-to-One Address Mapping):** これはNATの一種で、内部の特定のプライベートIPアドレスが、動的にグローバルIPアドレスプールから1対1で割り当てられて変換される方式です。ただし、今回の問題では「pool named test_pool using the 10.10.10.0/24 network」とあり、これは一般的に**動的NAT (Dynamic NAT)** または**ダイナミックPAT (Dynamic Port Address Translation)** を指すことが多いです。動的NATは、内部ネットワークの複数のデバイスが、グローバルIPアドレスのプールから空いているアドレスを順番に使用する方式です。問題文の「one-to-one address mapping」は、個々のセッションに対してユニークな変換が行われるという意味合いで使われている可能性が高いです。 * **標準アクセスリスト (Standard Access List):** IPアドレスフィルタリング(どの通信を許可/拒否するか)を行うためのリストです。標準アクセスリストは主に送信元IPアドレスに基づいて判断します。NATでは、「どの送信元IPアドレスを変換対象とするか」を定義するために使われます。 * **NAT Inside/Outsideインターフェース:** NATを行うルーターにおいて、 * **Insideインターフェース:** プライベートネットワーク側(内部)のインターフェースです。変換前のプライベートIPアドレスを持つ通信がここから入ってきます。 * **Outsideインターフェース:** グローバルネットワーク側(外部)のインターフェースです。変換後のグローバルIPアドレスを持つ通信がここから出ていきます。 * **NATプール (NAT Pool):** NAT変換に使用するグローバルIPアドレスの範囲(集合)を定義したものです。内部のプライベートIPアドレスは、このプールから割り当てられたグローバルIPアドレスに変換されます。 * **NVI (NAT Virtual Interface):** NATの設定方法の一つで、特定の物理インターフェースにInside/Outsideの指定をせず、VLANインターフェースなどでNATを行う方式です。今回は「避けるように」と指示されているため、従来のInside/Outsideインターフェース指定方式を使用します。 **設定手順とコマンド (R2):** 1. **標準アクセスリスト `XLATE` の作成:** R3のIPアドレス(Loopback0、E0/2、E0/1)を変換対象として許可します。 ``` R2(config)# ip access-list standard XLATE R2(config-std-nacl)# permit 192.168.3.1 // R3のLoopback0アドレス R2(config-std-nacl)# permit 10.2.3.3 // R3のE0/1アドレス R2(config-std-nacl)# permit 10.1.3.11 // R3のE0/2アドレス R2(config-std-nacl)# exit ``` * **ポイント:** `permit` コマンドで、変換対象としたい送信元IPアドレスを指定します。`10.1.3.11`は元々R3のE0/2のアドレスですが、タスク2でDHCPでIPアドレスを取得することになります。しかし、問題の指示とリファレンスコマンドに従ってこのアドレスを含めるのが正しいアプローチです。もしタスク1の前にタスク2が実行された場合、このIPはすでに存在しない可能性がありますが、試験の指示は通常順番に解くことを前提としています。 2. **NATプールの定義:** 変換後のグローバルIPアドレスとして使用する範囲を `test_pool` という名前で定義します。 ``` R2(config)# ip nat pool test_pool 10.10.10.1 10.10.10.254 netmask 255.255.255.0 ``` * **ポイント:** `test_pool`という名前で、`10.10.10.1`から`10.10.10.254`までのIPアドレスを変換用に使用し、サブネットマスクは`/24`(`255.255.255.0`)であることを指定します。 3. **インターフェースのInside/Outside設定:** R2のインターフェースに、NATの内側と外側を指定します。 * R2 E0/1 はR3(内部ネットワーク側)に接続しているので `ip nat inside`。 * R2 E0/0 はR1(外部ネットワーク側)に接続しているので `ip nat outside`。 ``` R2(config)# interface Ethernet0/1 R2(config-if)# ip nat inside R2(config-if)# exit R2(config)# interface Ethernet0/0 R2(config-if)# ip nat outside R2(config-if)# exit ``` 4. **NAT変換ルールの適用:** `XLATE`で許可された送信元アドレスを、`test_pool`のアドレスに変換するように設定します。 ``` R2(config)# ip nat inside source list XLATE pool test_pool ``` * **ポイント:** これがNATの中心となる設定です。「`inside`から来た通信の`source`アドレスが、`XLATE`というリストにマッチしたら、`test_pool`からアドレスを使って変換しなさい」という意味になります。 **確認方法:** * R3からR1のLoopback0アドレスへPingを送信します。 ``` R3# ping 192.168.100.1 source Loopback0 ``` * **期待される結果:** Pingが成功するはずです。 * R2でNAT統計情報を確認します。 ``` R2# show ip nat translations R2# show ip nat statistics ``` * **期待される結果:** `show ip nat translations`で、R3のLoopback0アドレス(`192.168.3.1`)が、`test_pool`のIPアドレスに変換されているエントリが表示されていれば成功です。 --- #### タスク2:R3のEthernet0/2インターフェースのDHCPクライアント設定 **目的:** R3のEthernet0/2インターフェースが、ネットワーク上のDHCPサーバーから動的にIPアドレスを取得するように設定します。 **専門用語解説:** * **DHCP (Dynamic Host Configuration Protocol):** ネットワークに接続されたデバイス(PC、サーバー、ルーターなど)に、IPアドレス、サブネットマスク、デフォルトゲートウェイ、DNSサーバーアドレスといった必要なネットワーク設定情報を自動的に割り当てるためのプロトコルです。これにより、手動での設定作業の手間が省け、IPアドレスの重複などのミスも防げます。 * **DHCPクライアント:** DHCPサーバーからIPアドレスなどの情報を自動的に取得する側のデバイスです。 * **DHCPサーバー:** DHCPクライアントにIPアドレスなどの情報を割り当てる側のデバイスです。今回の問題では、R3がクライアントになるため、どこかにDHCPサーバーが既に存在していると想定されます。 **設定手順とコマンド (R3):** 1. **Ethernet0/2インターフェースの設定モードへ:** ``` R3(config)# interface Ethernet0/2 ``` 2. **IPアドレスの動的取得設定:** DHCPサーバーからIPアドレスを取得するように設定します。 ``` R3(config-if)# ip address dhcp ``` 3. **インターフェースの有効化:** インターフェースがシャットダウン状態(無効)の場合は有効化します。 ``` R3(config-if)# no shutdown R3(config-if)# exit ``` * **ポイント:** `no shutdown`は、物理的な接続が確立されていても、インターフェースが論理的に有効でないと通信できません。通常、新しいインターフェースや設定変更後には必ず実行するコマンドです。 **確認方法:** * インターフェースのIPアドレス情報を確認します。 ``` R3# show ip interface brief ``` * **期待される結果:** Ethernet0/2インターフェースのIPアドレスが、DHCPサーバーから割り当てられたアドレス(例: `10.1.3.x`など、元の`10.1.3.11`ではない新しいアドレス)になっていることを確認します。`Status`と`Protocol`が`up`になっていることも重要です。 * DHCPリース情報を確認します。 ``` R3# show dhcp lease ``` * **期待される結果:** 割り当てられたIPアドレス、リース期間、DHCPサーバーのIPアドレスなどが表示されていれば成功です。 --- #### タスク3:R1をNTPサーバー、R2をNTPクライアントとして設定 **目的:** R1をネットワークタイムプロトコル(NTP)のサーバーとして動作させ、R2をR1から時刻情報を取得するクライアントとして設定します。R2はR1のピア(対等な関係)ではなく、あくまでクライアントとして設定する必要があります。 **専門用語解説:** * **NTP (Network Time Protocol):** コンピューターネットワーク上のデバイス間で時刻を同期させるためのプロトコルです。正確な時刻同期は、ログの整合性、認証システムの正常な動作、時刻ベースのアクセス制御など、多くのネットワーク機能にとって非常に重要です。 * **NTPサーバー:** 自身の持つ正確な時刻情報を他のデバイスに提供する役割を持つデバイスです。 * **NTPクライアント:** NTPサーバーから時刻情報を受け取り、自身の時計を同期させる役割を持つデバイスです。 * **NTPピア (NTP Peer):** 複数のNTPサーバーが相互に時刻情報を交換し、より信頼性の高い時刻を共有し合う関係です。この問題では、R2はR1のピアではなくクライアントとして設定するように指示されています。 **設定手順とコマンド:** 1. **R1をNTPサーバーとして設定:** R1が自身の時計を権威ある時刻源として提供するように設定します。 ``` R1(config)# ntp master R1(config)# exit ``` * **ポイント:** `ntp master`コマンドは、そのルーターをNTPサーバーとして機能させ、自らの時刻をNTPストラタム(階層)8として提供します。ストラタム8は、通常は外部のより正確な時刻源(GPS、原子時計など)から同期できない場合に、そのルーターが信頼できる時刻源として機能するためのものです。 2. **R2をR1のNTPクライアントとして設定:** R2がR1のE0/0インターフェースのIPアドレス(`10.1.2.1`)をNTPサーバーとして使用するように設定します。 ``` R2(config)# ntp server 10.1.2.1 R2(config)# exit ``` * **ポイント:** `ntp server `コマンドは、指定されたIPアドレスのNTPサーバーから時刻情報を取得するように設定します。これにより、R2はR1のクライアントになります。 **確認方法 (R2):** * NTPの同期状態を確認します。 ``` R2# show ntp status ``` * **期待される結果:** `Clock is synchronized`または`Synchronized to NTP clock`のようなメッセージと、R1の`10.1.2.1`が表示されていれば成功です。`stratum`(階層)も確認します。R1がmasterでストラタム8なので、R2はストラタム9として表示されるはずです。 * NTPアソシエーション(接続情報)を確認します。 ``` R2# show ntp associations ``` * **期待される結果:** R1の`10.1.2.1`との接続情報が表示され、`status`カラムに`*`(同期中)や`#`(選択済み)のマークがあれば成功です。 --- #### タスク4:R1からR3へのSSHアクセス設定(Telnetなど他プロトコルは除外) **目的:** R3に対して、R1からSSH (Secure Shell) を使って安全にリモートアクセスできるように設定します。Telnetのようなセキュリティの低い他のリモート接続プロトコルは許可しないようにします。SSH認証にはユーザー名 `root` とパスワード `s3cret` を使用し、RSAキーペアを生成します。 **専門用語解説:** * **SSH (Secure Shell):** ネットワーク上で安全なリモート接続を提供するためのプロトコルです。通信内容が暗号化されるため、パスワードやコマンド、データなどが盗聴されるリスクが低減されます。 Telnetとは異なり、セキュリティが非常に高いのが特徴です。 * **Telnet:** SSHと同様にリモート接続を提供するプロトコルですが、通信内容が一切暗号化されません。パスワードやデータが平文でネットワーク上を流れるため、セキュリティが低く、現代ではSSHの使用が強く推奨されます。 * **RSA (Rivest-Shamir-Adleman):** 公開鍵暗号方式の一種で、SSHでサーバーとクライアント間のセキュアな通信を確立するために使用されるキーペア(公開鍵と秘密鍵)を生成する際に利用されます。 * **ドメイン名 (Domain Name):** ネットワーク上のデバイスを一意に識別するための名前です。SSHのRSAキーペアを生成する際には、通常、デバイスのホスト名とドメイン名を組み合わせた完全修飾ドメイン名 (FQDN) が使用されます。 * **VTY回線 (Virtual Teletype Line):** Ciscoルーターにおける仮想端末回線のことです。TelnetやSSHなどのリモート接続を受け付けるための論理的な接続チャネルです。`line vty 0 4`は、同時に最大5つのリモート接続を許可することを意味します(`0`から`4`までの5本)。 * **`transport input ssh`:** VTY回線で受け付けるリモート接続プロトコルをSSHのみに限定するコマンドです。これにより、Telnetなどの他のプロトコルは拒否されます。 * **`login local`:** VTY回線での認証に、ルーターのローカルユーザーデータベース(`username`コマンドで設定したユーザー名とパスワード)を使用するように設定するコマンドです。 **設定手順とコマンド (R3):** 1. **ドメイン名の設定:** SSHのRSAキーを生成するためにドメイン名が必要です。 ``` R3(config)# ip domain-name cisco.com ``` 2. **ローカルユーザーアカウントの作成:** SSH接続時の認証に使用するユーザー名 `root` とパスワード `s3cret` を作成します。 ``` R3(config)# username root secret s3cret ``` * **ポイント:** `secret`キーワードを使用すると、パスワードはMD5ハッシュで暗号化されて保存されるため、セキュリティが高まります。 3. **RSAキーペアの生成:** SSH通信を暗号化するために必要なRSAキーペアを生成します。 ``` R3(config)# crypto key generate rsa ``` * プロンプトが表示されたら、キーのサイズ(ビット数)を入力します。通常は`1024`か`2048`ビットを選択します。問題に指定がない場合は、デフォルト値または推奨値(例えば`1024`)でEnterを押して構いません。 4. **VTY回線の設定:** リモート接続(SSH)に関する設定を行います。 ``` R3(config)# line vty 0 4 R3(config-line)# transport input ssh // SSH接続のみを許可 R3(config-line)# login local // ローカルユーザーデータベースで認証 R3(config-line)# exit ``` * **ポイント:** `transport input ssh` が非常に重要です。これを設定しないと、デフォルトではTelnetも許可されてしまい、問題の「excluding access via other remote connection protocols」という要件を満たせません。 **確認方法 (R1):** * R1からR3へSSH接続を試みます。宛先IPアドレスは、**タスク2でR3のEthernet0/2にDHCPで割り当てられたIPアドレス**を使用します。`show ip interface brief`で確認したIPアドレスを使用してください。 ``` R1# ssh -l root ``` * **例:** もしR3のE0/2に`10.1.3.50`が割り当てられていれば、`ssh -l root 10.1.3.50` と入力します。 * **期待される結果:** `password:`と表示され、`s3cret`と入力してEnterを押すと、R3のCLIプロンプト(`R3>`)にログインできれば成功です。 * **Telnetの拒否確認 (任意):** R1からR3のE0/2へTelnet接続を試みて、接続が拒否されることを確認するのも良いでしょう。 ``` R1# telnet ``` * **期待される結果:** `Connection refused by remote host`のようなエラーメッセージが表示されるはずです。 --- ### まとめと試験へのアドバイス この問題は、CCNAで問われる主要なネットワークサービス設定を幅広くカバーしています。 * **NAT**: ネットワークセキュリティとIPアドレスの効率的利用の基本。 * **DHCP**: IPアドレス管理の自動化。 * **NTP**: ネットワーク時刻同期の重要性。 * **SSH**: 安全なリモート管理。 これらの概念と設定コマンドをしっかりと理解し、それぞれのタスクで「何を」「どこに」「どのように」設定するのかを正確に把握することが重要です。特に、インターフェースの役割(NATのinside/outsideなど)や、関連する補助設定(ドメイン名、ユーザーアカウントなど)を見落とさないように注意してください。 各タスク完了後には必ず`copy running-config startup-config`で設定を保存し、`show`コマンドで設定内容や動作状況を確認する習慣をつけましょう。 頑張ってください!
繁體中文
你好!我是 Cisco 的技術專家。很高興能為你解析這題 CCNA 的實作模擬題。 這道題目非常經典,它涵蓋了網路工程師在日常工作中必備的四項基本技能:**NAT 網路位址轉換**、**DHCP 自動取得位址**、**NTP 時間同步**以及 **SSH 安全遠端登入**。 我將會把這四個任務拆解開來,用最白話的方式解釋給你聽。 --- ### 任務 1:設定 NAT (網路位址轉換) **目標:** 在 R2 路由上設定 NAT,讓來自 R3 的流量在經過 R2 去找 R1 時,會把原本的 IP 換成我們指定的「地址池」中的 IP。 #### 💡 專業名詞解釋: * **NAT (Network Address Translation):** 就像是社區的大樓管理員。內部住戶(私有 IP)要寄信出去時,管理員會把寄件人改成社區的正式地址(公有 IP)。 * **ACL (Access Control List):** 存取控制清單。在這裡像是一張「名單」,用來告訴路由器:哪些人的 IP 需要被轉換。 * **NAT Pool:** 地址池。這是一組可以拿來替換用的 IP 地址預備軍。 * **Inside / Outside Interface:** 內部與外部介面。你要告訴路由器,哪邊是「家裡(內網)」,哪邊是「外面(外網)」。 #### 解析步驟: 1. **建立 ACL 名單 (XLATE):** 我們要把 R3 相關的網段都放進這張名單,告訴 R2 這些流量需要轉換。 2. **定義地址池 (test_pool):** 告訴路由器,轉換時要從 `10.10.10.1` 到 `10.10.10.254` 隨機挑一個來用。 3. **指定內外介面:** R2 的 `E0/1` 面對 R3(內部),`E0/0` 面對 R1(外部)。 4. **啟動轉換:** 將名單 (ACL) 與地址池 (Pool) 綁定在一起。 --- ### 任務 2:設定 DHCP 戶端 (DHCP Client) **目標:** 讓 R3 的 `Ethernet0/2` 介面不要手動設定 IP,而是自動跟別人(DHCP 伺服器)「要」一個 IP。 #### 💡 專業名詞解釋: * **DHCP (Dynamic Host Configuration Protocol):** 動態主機設定協定。就像是你去餐廳,服務生會自動分配一個桌號給你,你不需要自己找。 #### 解析步驟: 1. 進入介面後輸入 `ip address dhcp`。 2. 記得下 `no shutdown` 指令,確保介面是開啟的。 --- ### 任務 3:設定 NTP (網路時間協定) **目標:** 讓全公司的設備時間都一致。R1 當作「時間老師 (Master)」,R2 當作「學生 (Client)」。 #### 💡 專業名詞解釋: * **NTP (Network Time Protocol):** 網路時間協定。確保所有網路設備的時間都是準確且同步的,這對查 Log(日誌)非常重要。 * **Master / Server:** 提供正確時間的來源。 * **Client:** 接收並同步時間的角色。 #### 解析步驟: 1. **R1 設定:** 下達 `ntp master`,宣告自己就是標準時間來源。 2. **R2 設定:** 使用 `ntp server 10.1.2.1` 指向 R1 的 IP,告訴它「去跟 R1 對時」。 --- ### 任務 4:設定 SSH 安全存取 **目標:** 讓 R1 可以遠端連線管理 R3,但為了安全,我們禁止傳統的 Telnet(明碼傳輸),只准用加密的 SSH,並設定帳號密碼。 #### 💡 專業名詞解釋: * **SSH (Secure Shell):** 安全外殼協定。遠端管理設備時會將內容加密,就像是在保險箱裡傳信。 * **RSA:** 一種加密演算法。在開啟 SSH 前,路由器必須產生一組 RSA 金鑰來負責加密。 * **VTY (Virtual Teletype):** 虛擬終端介面。這指的是路由器「提供遠端連線的通道」。 * **Transport input ssh:** 這行指令最關鍵,它代表「只允許 SSH 進來,拒絕 Telnet」。 #### 解析步驟: 1. **設定網域名稱 (Domain Name):** RSA 金鑰產生時需要一個網域名稱作為種子。 2. **建立使用者:** 建立一個名叫 `root`,密碼是 `s3cret` 的使用者。 3. **產生加密金鑰:** 執行 `crypto key generate rsa`。 4. **限制連線方式:** 在 `line vty 0 4` 下設定 `transport input ssh`,這能完成題目要求「排除其他通訊協定」的條件。 --- ### 專家總結 這份考題測試的是你對**基礎網路服務**的整合能力: * **NAT** 解決了位址不足與隱藏內部 IP 的問題。 * **DHCP** 簡化了 IP 管理。 * **NTP** 確保了管理維護時的時間一致性。 * **SSH** 提供了安全的管理管道。 在實作題中,最後別忘了輸入 `copy running-config startup-config` (或簡寫 `wr`) 來存檔,否則在考試系統中可能會不予計分喔!加油!祝你順利通過 CCNA 認證。
简体中文
作为一名Cisco技术专家,我很乐意为您解析这道CCNA考试中的模拟题。这道题考察了路由器上多种重要的IP服务配置,包括NAT、DHCP客户端、NTP和SSH。我们将一步一步地来分析,确保每个概念都清晰易懂。 --- ## 考题解析 ### 概述 这道题是一个实验(Simulation)题,要求您在虚拟路由器上进行实际配置。您将面对一个包含三台路由器(R1, R2, R3)的网络拓扑,并需要按照指定顺序完成四项IP服务配置任务。重要的是,所有必要的预配置(如接口IP地址和基本路由)已经完成,您只需要专注于完成任务要求即可。 在开始之前,请记住以下几点: * **不要更改设备的主机名和enable密码。** * **完成每个任务后,请务必保存配置到NVRAM (Non-Volatile RAM)。** 这就像电脑关机前保存文件一样,防止配置丢失。命令通常是 `copy running-config startup-config` 或 `write mem`。 * **按顺序完成任务。** 有些任务可能依赖于前一个任务的完成。 ### 拓扑图概览 让我们先看看这个网络拓扑: * **R1**: 拥有一个环回接口Lo1 (192.168.100.1),连接到R2 (E0/0接口 10.1.2.1) 和R3 (E0/2接口 10.1.3.1)。 * **R2**: 拥有一个环回接口Lo1 (192.168.200.1),连接到R1 (E0/0接口 10.1.2.2) 和R3 (E0/1接口 10.2.3.2)。 * **R3**: 拥有一个环回接口Lo1 (192.168.3.1),连接到R1 (E0/2接口 10.1.3.11) 和R2 (E0/1接口 10.2.3.3)。 **专业名词解释:** * **环回接口 (Loopback Interface)**:一种虚拟的、逻辑上的接口,永远不会“down”(关闭)。它常用于路由器自身的服务(如路由协议源地址、NTP源地址、管理地址等),因为它提供了高可用性。 * **接口 (Interface)**:路由器上的物理或逻辑端口,用于连接其他网络设备。例如,`Ethernet0/0` 表示以太网接口的第0槽位的第0个端口。 * **IP地址 (IP Address)**:网络设备的唯一标识,用于在网络中定位和通信。 * **子网掩码 (Subnet Mask)**:与IP地址一起使用,用于区分IP地址的网络部分和主机部分。例如,`/24` 表示子网掩码是 `255.255.255.0`。 --- ### 任务解析 #### 任务 1: 在R2上配置动态一对一地址映射 (NAT) **目标 (Goal):** 配置R2,使得R3发送给R1的流量,其源IP地址(即发出数据包的地址)在R2上会被翻译(转换)成一个来自`test_pool`地址池的IP地址。这个翻译过程是“动态的”,并且需要使用一个名为`XLATE`的访问控制列表(ACL)来指定哪些流量需要被翻译。避免使用NVI配置。最后,从R3向R1的`192.168.100.1`(R1的环回接口)发送ping来验证。 **知识点 (Key Concepts):** * **网络地址转换 (NAT - Network Address Translation)**:一种将私有IP地址(内部网络使用的地址)转换为公共IP地址(在互联网上可路由的地址)的技术。它允许多个内部设备共享一个或少数几个公共IP地址访问外部网络,节省了公共IP地址资源,也提供了基本的安全隔离。 * **动态NAT (Dynamic NAT)**:当内部设备发起连接时,动态地从一个预定义的公共IP地址池中选择一个可用的IP地址进行翻译。这里题目要求是“一对一映射”,但又提到了“地址池”,意味着内部的一个IP地址会被映射到池中的一个IP地址,这个映射关系是动态建立的,而不是预先固定好的。 * **NAT内部接口 (ip nat inside)**:连接到需要进行地址转换的“内部”网络的路由器接口。 * **NAT外部接口 (ip nat outside)**:连接到“外部”网络(比如互联网或另一个网络)的路由器接口,数据包从这里出去后,其源地址已经被转换。 * **访问控制列表 (ACL - Access Control List)**:一组规则,用于匹配流量并决定是允许(permit)还是拒绝(deny)该流量。在这里,ACL用于识别哪些内部IP地址需要进行NAT。 * **标准ACL (Standard ACL)**:只基于源IP地址进行匹配。 * **地址池 (Address Pool)**:一组连续的IP地址,NAT将从这个池中选择IP地址进行转换。 * **NVI (NAT Virtual Interface)**:NAT虚拟接口,是Cisco IOS中一种更灵活的NAT配置方式,但题目明确要求避免使用,因此我们将使用传统的`ip nat inside/outside`配置。 **配置步骤与解析 (Configuration Steps and Analysis):** 1. **创建标准ACL `XLATE` 来识别需要进行NAT的流量:** ``` R2(config)# ip access-list standard XLATE R2(config-std-nacl)# permit 192.168.3.1 R2(config-std-nacl)# permit 10.2.3.3 R2(config-std-nacl)# permit 10.1.3.11 R2(config-std-nacl)# exit ``` * `ip access-list standard XLATE`: 创建一个名为`XLATE`的标准ACL。 * `permit 192.168.3.1`: 允许R3的环回接口IP地址(`192.168.3.1`)进行NAT。 * `permit 10.2.3.3`: 允许R3的E0/1接口IP地址(`10.2.3.3`)进行NAT。 * `permit 10.1.3.11`: 允许R3的E0/2接口IP地址(`10.1.3.11`)进行NAT。 * **解析**: 题目要求翻译“R3的源地址”,所以我们需要允许R3上所有可能作为源地址的接口IP。 2. **定义NAT地址池 `test_pool`:** ``` R2(config)# ip nat pool test_pool 10.10.10.1 10.10.10.254 netmask 255.255.255.0 ``` * `ip nat pool test_pool 10.10.10.1 10.10.10.254 netmask 255.255.255.0`: 定义一个名为`test_pool`的地址池,包含从`10.10.10.1`到`10.10.10.254`的IP地址,子网掩码为`255.255.255.0`。 * **解析**: 这些地址将用于替换R3流量的源IP地址。 3. **配置R2的NAT内部和外部接口:** ``` R2(config)# interface Ethernet0/1 R2(config-if)# ip nat inside R2(config-if)# exit R2(config)# interface Ethernet0/0 R2(config-if)# ip nat outside R2(config-if)# exit ``` * `interface Ethernet0/1`: 进入R2的E0/1接口配置模式。R2的E0/1连接到R3 (10.2.3.2 <-> 10.2.3.3)。从R3发出的流量首先到达R2的E0/1,因此它是**内部接口**。 * `ip nat inside`: 将E0/1接口标记为NAT内部接口。 * `interface Ethernet0/0`: 进入R2的E0/0接口配置模式。R2的E0/0连接到R1 (10.1.2.2 <-> 10.1.2.1)。翻译后的流量将从R2的E0/0发送到R1,因此它是**外部接口**。 * `ip nat outside`: 将E0/0接口标记为NAT外部接口。 * **解析**: 正确识别NAT的内部和外部接口是NAT配置成功的关键。 4. **将ACL和地址池应用于NAT规则:** ``` R2(config)# ip nat inside source list XLATE pool test_pool ``` * `ip nat inside source list XLATE pool test_pool`: 这条命令是NAT的核心。它告诉路由器:对于从内部接口(E0/1)进入的、源IP地址匹配ACL `XLATE`的流量,将其源地址替换为从`test_pool`中动态分配的IP地址,然后从外部接口(E0/0)发送出去。 * **解析**: 这条命令将之前定义好的ACL和地址池关联起来,形成了完整的动态NAT规则。 **验证 (Verification):** 在R3上执行ping命令,指定源地址为R3的Loopback0接口,目标为R1的Loopback0接口: ``` R3# ping 192.168.100.1 source Loopback0 ``` * 如果ping成功,说明R3的Loopback0地址`192.168.3.1`成功被R2上的NAT转换,并且R1能够接收并响应。 * 您也可以在R2上使用`show ip nat translations`命令查看NAT转换表,确认是否有条目生成。 #### 任务 2: 配置R3动态获取IP地址 **目标 (Goal):** 配置R3的Ethernet0/2接口,使其能从DHCP服务器动态获取IP地址。 **知识点 (Key Concepts):** * **动态主机配置协议 (DHCP - Dynamic Host Configuration Protocol)**:一种网络协议,用于集中管理和分配网络中的IP地址、子网掩码、默认网关等网络配置信息。当设备配置为DHCP客户端时,它会自动向DHCP服务器请求这些信息。 * **DHCP客户端 (DHCP Client)**:请求IP地址和其他网络配置信息的设备。 **配置步骤与解析 (Configuration Steps and Analysis):** 1. **进入R3的Ethernet0/2接口配置模式:** ``` R3(config)# interface Ethernet0/2 ``` * **解析**: 我们需要对E0/2接口进行操作,所以首先要进入它的配置模式。 2. **配置接口为DHCP客户端并确保接口开启:** ``` R3(config-if)# ip address dhcp R3(config-if)# no shutdown R3(config-if)# exit ``` * `ip address dhcp`: 这条命令告诉R3的E0/2接口不要使用静态IP地址,而是通过DHCP协议从网络中的DHCP服务器获取IP地址。 * `no shutdown`: 这条命令用于确保接口是开启状态(“no shutdown”意味着“不关闭”)。虽然在实验中接口通常默认是开启的,但在真实环境中或者进行接口配置后,显式地执行`no shutdown`是一个很好的习惯,以防接口处于关闭状态。 * **解析**: 完成这两步后,R3的E0/2接口会发送DHCP发现报文,尝试获取IP地址。 **验证 (Verification):** ``` R3# show ip interface brief R3# show dhcp lease ``` * `show ip interface brief`: 查看所有接口的简要信息,重点检查Ethernet0/2接口是否成功获取到IP地址,以及其状态是否为“up/up”。 * `show dhcp lease`: 查看DHCP客户端租约的详细信息,包括获取到的IP地址、租约时长等。 #### 任务 3: 配置NTP服务器和客户端 **目标 (Goal):** 配置R1作为NTP服务器,R2作为NTP客户端,并且R2使用R1的IP地址`10.1.2.1`进行同步。R2不作为对等体(peer)。 **知识点 (Key Concepts):** * **网络时间协议 (NTP - Network Time Protocol)**:用于同步网络中计算机时间的协议。准确的时间对于日志记录、认证和故障排除都非常重要。 * **NTP服务器 (NTP Server)**:提供时间同步服务的设备。 * **NTP客户端 (NTP Client)**:从NTP服务器获取时间并同步自身时钟的设备。 * **对等体 (Peer)**:在NTP中,两个设备互为对等体,它们可以相互提供时间同步服务,并且会选择更优的源。题目要求R2不作为对等体,意味着它只从R1获取时间,而不向R1提供时间。 * **Stratum (层级)**:NTP服务器的准确性和可靠性级别。Stratum 1是最准确的,直接连接到原子钟或GPS等。Stratum值越小,时间源越准确。 **配置步骤与解析 (Configuration Steps and Analysis):** 1. **在R1上配置为NTP主服务器:** ``` R1(config)# ntp master ``` * `ntp master`: 这条命令将R1配置为NTP主服务器。默认情况下,它将把自己设定为Stratum 8(可以被其他设备信任并同步的时间源)。 * **解析**: R1现在可以为网络中的其他设备提供时间同步服务了。 2. **在R2上配置为NTP客户端,并指定R1作为时间服务器:** ``` R2(config)# ntp server 10.1.2.1 ``` * `ntp server 10.1.2.1`: 这条命令告诉R2,它应该将IP地址为`10.1.2.1`的设备(即R1的E0/0接口)作为其NTP服务器,并从该服务器同步时间。 * **解析**: R2会主动联系`10.1.2.1`来获取并同步时间。`ntp server`是客户端模式,而不是对等体模式,符合题目要求。 **验证 (Verification):** 在R2上执行以下命令: ``` R2# show ntp status R2# show ntp associations ``` * `show ntp status`: 查看NTP的同步状态。如果成功同步,您应该看到类似“Clock is synchronized, stratum X”的字样,其中X是R1的Stratum值(默认为8)。 * `show ntp associations`: 查看NTP关联信息,确认R2是否成功与`10.1.2.1`建立了NTP连接。星号`*`通常表示当前正在同步的时间源。 #### 任务 4: 配置SSH访问R3 **目标 (Goal):** 配置R3,允许R1通过SSH协议访问R3,并且排除其他远程连接协议(如Telnet)。使用本地用户`root`和密码`s3cret`进行认证,并使用RSA加密算法。最后,从R1验证到R3的E0/2接口的SSH连接。 **知识点 (Key Concepts):** * **安全外壳协议 (SSH - Secure Shell)**:一种加密的网络协议,用于在不安全的网络上安全地进行远程命令行操作。它提供了加密的通信通道,防止信息被窃听或篡改。 * **Telnet**: 另一种远程连接协议,但它以明文传输数据,不安全。题目要求排除其他协议,所以我们需要确保只允许SSH。 * **RSA (Rivest-Shamir-Adleman)**:一种非对称加密算法,广泛用于数据加密和数字签名,也是SSH中密钥生成的一种方式。 * **域名 (Domain Name)**:在路由器上配置域名是生成SSH所需的RSA加密密钥的前提条件。 * **本地用户认证 (Local User Authentication)**:路由器通过查找本地用户数据库来验证用户的身份。 * **虚拟终端线路 (VTY Lines)**:路由器上的虚拟端口,用于管理目的的远程连接(如Telnet或SSH)。 **配置步骤与解析 (Configuration Steps and Analysis):** 1. **在R3上配置域名和本地用户账户:** ``` R3(config)# ip domain-name cisco.com R3(config)# username root secret s3cret ``` * `ip domain-name cisco.com`: 配置R3的域名。这是生成RSA密钥的必要条件。这里的域名可以任意,只要有即可。 * `username root secret s3cret`: 创建一个名为`root`的本地用户,其密码是加密存储的`s3cret`。SSH连接时将使用此用户进行认证。 * **解析**: 域名用于密钥生成,用户账户用于登录认证。 2. **在R3上生成RSA加密密钥:** ``` R3(config)# crypto key generate rsa ``` * `crypto key generate rsa`: 这条命令会提示您选择密钥的模块大小(通常默认值即可,或者您可以输入一个推荐值,如1024或2048)。生成RSA密钥是启用SSH服务的关键一步。 * **解析**: 密钥生成成功后,R3就具备了使用RSA加密进行SSH通信的能力。 3. **配置R3的VTY线路,只允许SSH连接并使用本地认证:** ``` R3(config)# line vty 0 4 R3(config-line)# transport input ssh R3(config-line)# login local R3(config-line)# exit ``` * `line vty 0 4`: 进入VTY线路0到4的配置模式。这些是用于远程连接的虚拟线路。 * `transport input ssh`: **这条命令至关重要!** 它明确指示VTY线路只接受SSH协议的入站连接。这意味着Telnet和其他非SSH协议的远程连接将被拒绝,符合题目要求“排除访问其他远程连接协议”。 * `login local`: 告诉VTY线路使用路由器本地的用户数据库进行认证(即使用我们之前创建的`root`用户)。 * **解析**: 这些配置确保了只有经过加密的SSH连接才能访问R3,并且使用本地创建的用户名和密码进行身份验证。 **验证 (Verification):** 1. **首先,确保R1可以ping通R3的E0/2接口:** ``` R1# ping 10.1.3.11 ``` * 如果Task 2配置了R3的E0/2为DHCP客户端,那么`10.1.3.11`可能是DHCP服务器分配给它的地址(图中所示)。如果ping不通,请先检查Task 2的DHCP分配是否成功。 2. **从R1尝试SSH连接到R3的E0/2接口:** ``` R1# ssh -l root 10.1.3.11 ``` * `-l root`: 指定登录的用户名为`root`。 * `10.1.3.11`: R3的E0/2接口的IP地址。 * 如果配置成功,您将被提示输入密码`s3cret`。输入正确后,您应该能够成功登录到R3的命令行界面,这表示SSH连接成功建立。 --- ### 总结与提醒 完成所有任务后,请务必在每台受影响的路由器上执行以下命令,将运行配置保存到启动配置中,以防设备重启后配置丢失: ``` R1# copy running-config startup-config R2# copy running-config startup-config R3# copy running-config startup-config ``` 或者简写为: ``` R1# write mem R2# write mem R3# write mem ``` **再强调一次:** 严格按照题目给出的顺序完成任务,因为某些配置可能互相关联或有依赖性。例如,Task 2中R3的E0/2接口获取的IP地址会影响Task 4的SSH验证。 希望这份详细的解析能帮助您更好地理解和完成这道CCNA模拟题!祝您考试顺利!