Question #49

You are configuring your edge routers interface with a public IP address for Internet connectivity. The router needs to obtain the IP address from the service provider dynamically. Which command is needed on interface FastEthernet 0/0 to accomplish this?
A
ip default-gateway
B
ip route
C
ip default-network
D
ip address dhcp
E
ip address dynamic
English
This question tests your understanding of how Cisco routers obtain IP addresses dynamically, particularly when connecting to an Internet Service Provider (ISP). --- ### Question Breakdown * **"You are configuring your edge router's interface..."**: An "edge router" is a router located at the boundary of your network, connecting your internal network to an external network, typically the internet. * **"...with a public IP address for Internet connectivity."**: A "public IP address" is an IP address that is globally unique and routable on the internet. It allows your network to communicate with other devices on the internet. * **"The router needs to obtain the IP address from the service provider dynamically."**: This is the core requirement. "Dynamically" means the IP address, subnet mask, and potentially other network settings (like the default gateway and DNS servers) are not manually entered (static) but are automatically assigned by another device, in this case, the Service Provider's (ISP's) server. The most common protocol for dynamic IP assignment is **DHCP (Dynamic Host Configuration Protocol)**. * **"Which command is needed on interface FastEthernet 0/0 to accomplish this?"**: We need the specific Cisco IOS (Internetwork Operating System) command that enables an interface to request an IP address dynamically. ### Core Concept: DHCP Client on a Router When a router needs to obtain an IP address dynamically from an ISP, it acts as a **DHCP client**. The ISP runs a **DHCP server** on its network, which is configured to assign IP addresses from a pool to its customers' equipment. The router interface will send a DHCP request, and the server will respond with an IP address lease. ### Analyzing the Options Let's examine each option: 1. **`ip default-gateway`** * **What it does:** This command is primarily used on **Cisco switches** (Layer 2 devices) to specify the IP address of the default gateway when the switch needs to send management traffic (like Telnet, SSH, or SNMP) to a different network. Switches don't typically participate in routing decisions like a router. * **Why it's incorrect:** * It's for switches, not routers, for defining a default route. * It has nothing to do with *obtaining* an IP address dynamically. Routers use `ip route 0.0.0.0 0.0.0.0 [next-hop-ip]` to define a default route. 2. **`ip route`** * **What it does:** This command is used to configure **static routes** on a router. A route tells the router how to reach a specific network or host. A common use is to configure a **default route** (`ip route 0.0.0.0 0.0.0.0 [next-hop-ip or exit-interface]`), which is used for all traffic for which there isn't a more specific route. * **Why it's incorrect:** * While crucial for routing traffic, `ip route` defines *how to forward traffic*, not *how to obtain an IP address*. It doesn't enable dynamic IP address assignment. 3. **`ip default-network`** * **What it does:** This is an older, largely deprecated command used in conjunction with classful routing protocols (like IGRP, EIGRP, RIPv1) to mark a network as a "default network." If a routing protocol learned a route to a default network, it would install a default route in the routing table. It's rarely used in modern networks, which prefer `ip route 0.0.0.0 0.0.0.0`. * **Why it's incorrect:** * It's an outdated command for influencing default route propagation, not for dynamically obtaining an IP address. 4. **`ip address dhcp`** * **What it does:** This is the correct command! When configured on an interface (e.g., `interface FastEthernet 0/0`, then `ip address dhcp`), it tells the router interface to act as a **DHCP client**. The interface will broadcast a DHCP request, and if a DHCP server (like the one run by your ISP) is available, it will reply with an IP address, subnet mask, and usually the default gateway and DNS server information. * **Why it's correct:** This command directly fulfills the requirement of "obtain the IP address from the service provider dynamically." 5. **`ip address dynamic`** * **What it does:** While the concept of "dynamic" is correct, this specific command syntax is **not a valid Cisco IOS command** for configuring an interface to obtain an IP address via DHCP. The correct syntax for a DHCP client is `ip address dhcp`. * **Why it's incorrect:** It's a plausible-sounding but incorrect command. Cisco IOS commands are specific. ### Correct Answer Explanation The command `ip address dhcp` is placed within the interface configuration mode. When applied, the router's FastEthernet 0/0 interface will initiate a DHCP discovery process. It sends out a DHCP request, and the ISP's DHCP server, upon receiving this request, will assign a public IP address, subnet mask, and often the default gateway to the router's interface. This is the standard method for a router to get its external IP address from an ISP dynamically. **Example Configuration:** ``` Router> enable Router# configure terminal Router(config)# interface FastEthernet 0/0 Router(config-if)# ip address dhcp Router(config-if)# no shutdown Router(config-if)# end ``` After these commands, the interface FastEthernet 0/0 will attempt to get an IP address from a DHCP server. --- The final answer is **ip address dhcp**
日本語
CCNA試験対策として、この問題の技術的な背景と正解に至るプロセスを詳細に解説します。 --- # CCNA 試験問題解析 ## 1. 問題の概要 **シナリオ**: エッジルータのインターフェース(FastEthernet 0/0)に、インターネット接続用のパブリックIPアドレスを設定しようとしています。 **要件**: サービスプロバイダー(ISP)から、**動的(Dynamically)**にIPアドレスを取得する必要があります。 **問い**: この設定を実現するために、インターフェース FastEthernet 0/0 で必要なコマンドはどれか。 --- ## 2. 正解 **コマンド**: `ip address dhcp` --- ## 3. 技術解説 ネットワークエンジニアの視点から、この設定が必要な理由と動作の仕組みを解説します。 ### A. DHCPクライアント機能 通常、DHCP(Dynamic Host Configuration Protocol)といえば、ルータがPCなどにIPアドレスを「配布する側(サーバー)」として動作することを想像しますが、Ciscoルータのインターフェースは**「受け取る側(クライアント)」**として動作させることも可能です。 ISPから動的にIPアドレスを取得する一般的なケース(家庭用ブロードバンド接続や小規模拠点のエッジ接続など)では、この `ip address dhcp` コマンドを使用します。 ### B. コマンドの動作 このコマンドをインターフェースに適用すると、ルータはそのインターフェースから **DHCP Discover** メッセージを送信します。ISP側のDHCPサーバーから応答があれば、以下の情報を自動的に取得・設定します。 1. **IPアドレス**(パブリックIP) 2. **サブネットマスク** 3. **デフォルトゲートウェイ**(オプションとしてルーティングテーブルに反映) 4. **DNSサーバーのアドレス** --- ## 4. 設定手順(CLI) 実際の運用現場や試験のシミュレーション問題では、以下のように設定します。 ```bash Router# configure terminal Router(config)# interface FastEthernet 0/0 Router(config-if)# ip address dhcp <-- これが正解のコマンド Router(config-if)# no shutdown <-- インターフェースを有効化 ``` --- ## 5. 確認コマンド 設定後、正しくIPアドレスが取得できたかを確認するには、以下のコマンドを使用します。 ```bash Router# show ip interface brief ``` **出力例の確認ポイント**: `Method` 項目が **DHCP** と表示され、`Status` が **up**、`Protocol` が **up** になっていることを確認します。 --- ## 6. 試験対策のポイント(比較) 試験では他の選択肢と迷わせる場合があります。以下の違いを整理しておきましょう。 * **`ip address [IPアドレス] [マスク]`**: ISPから「固定(Static)」のIPアドレスが指定されている場合に使用します。今回の問題は「Dynamic」なので不適切です。 * **`ip address pppoe set-client`**: PPPoEを使用して接続する場合の関連コマンドですが、IPアドレス取得そのもののコマンドは `ip address negotiated` などが使われます。 * **DHCPサーバー設定との混同**: `service dhcp` や `ip dhcp pool` は、ルータがIPを「配る」側の設定です。今回は「受け取る」設定なので間違いです。 ## 結論 エッジルータがISPから動的にIPを取得する場合、対象インターフェースで **`ip address dhcp`** を入力するのが正解です。これはCCNAにおいて、小規模拠点(SOHO)接続のセクションで非常に重要な知識となります。
繁體中文
這是一題典型的 CCNA 網路基礎實作題,考察的是網路工程師對於 **Cisco IOS 介面配置**以及 **DHCP 用戶端(DHCP Client)** 功能的掌握。 以下是針對此考題的專業解析: --- ### 📋 考題分析與核心概念 **題目情境:** 你正在配置邊緣路由器(Edge Router)的介面(FastEthernet 0/0),該介面連接至網際網路。目標是讓該介面能**動態地(Dynamically)**從服務供應商(ISP)獲取公網 IP 位址。 **核心考點:** 1. **DHCP Client 功能**:在 Cisco 路由器上,介面預設是沒有 IP 的,若要自動取得 IP,必須啟用 DHCP 用戶端功能。 2. **指令辨析**:區分「手動配置靜態 IP」與「自動獲取動態 IP」的指令差異。 --- ### ✅ 正確答案 在 `interface FastEthernet 0/0` 模式下,應輸入以下指令: ```bash Router(config-if)# ip address dhcp ``` --- ### 🔍 深度解析 #### 1. 指令功能說明 * **`ip address dhcp`**:此指令告訴路由器,該介面不使用手動指定的 IP,而是發送 DHCP 請求(DHCP Discover),向連線的 ISP 伺服器要求分配一個 IP 位址、子網路遮罩(Subnet Mask)以及預設閘道(Default Gateway)。 #### 2. 為什麼不是其他指令? * **`ip address [IP] [Mask]`**:這是用於配置「靜態 IP(Static IP)」。題目要求的是「動態獲取(Dynamically)」,因此不適用。 * **`ip address negotiated`**:這通常用於 **PPP** 或 **PPPoE** 連線(如撥接上網),雖然也是動態獲取,但題目明確指出是乙太網路介面(FastEthernet),且在標準 CCNA 範疇中,從 ISP 獲取 IP 的標準乙太網方式是 DHCP。 #### 3. 運作流程(DORA 過程) 當你在介面輸入 `ip address dhcp` 並執行 `no shutdown` 後,路由器會啟動以下 DHCP 流程: 1. **D**iscover:路由器發送廣播尋找 DHCP 伺服器。 2. **O**ffer:ISP 的 DHCP 伺服器回應可用的 IP 資訊。 3. **R**equest:路由器請求使用該 IP。 4. **A**ck:伺服器確認分配,介面正式獲得 IP 並生效。 --- ### 💻 實務配置範例 在實際工作環境中,除了獲取 IP,通常還需要開啟介面。完整的配置步驟如下: ```config Router> enable Router# configure terminal Router(config)# interface FastEthernet 0/0 Router(config-if)# description WAN_Link_to_ISP Router(config-if)# ip address dhcp <-- 核心指令:動態獲取 IP Router(config-if)# no shutdown <-- 必須開啟介面 Router(config-if)# exit ``` --- ### 🛠️ 驗證指令 (Verification) 配置完成後,網路工程師應使用以下指令確認是否成功取得 IP: 1. **查看介面狀態:** ```bash Router# show ip interface brief ``` *如果成功,你會在 IP Address 欄位看到 ISP 分配的數值,且 Method 欄位會顯示為 **DHCP**。* 2. **查看詳細 DHCP 租約資訊:** ```bash Router# show dhcp lease ``` *此指令可以查看 IP 的租約時間(Lease Time)以及提供 IP 的 Server 位址。* --- ### 💡 專家總結 在企業邊緣端,若連接的是一般商業光纖或寬頻,使用 `ip address dhcp` 是最常見的做法。這不僅簡化了管理,也能讓路由器自動獲取 DNS 伺服器與預設路由(Default Route),是 CCNA 認證中必須熟練掌握的基本技能。
简体中文
这是一道典型的 CCNA 级别考题,考查的是路由器作为 **DHCP 客户端(DHCP Client)** 获取公网 IP 地址的配置能力。 以下是针对该题目的专业技术解析: --- ### 1. 正确答案 在接口配置模式下,应使用的命令是: ```bash Router(config-if)# ip address dhcp ``` --- ### 2. 核心技术解析 #### A. 场景背景 在企业边缘(Edge)或 SOHO 网络中,互联网服务提供商(ISP)通常不会分配静态公网 IP,而是通过 DHCP 服务动态分配。当路由器的 FastEthernet 0/0 接口连接到 ISP 的调制解调器(Modem)或网关时,路由器必须扮演 **DHCP 客户端**的角色。 #### B. 命令功能:`ip address dhcp` * **触发请求**:该命令会指示路由器在指定的接口上发送 `DHCP DISCOVER` 报文。 * **自动配置**:一旦与 ISP 的 DHCP 服务器完成四步交互(Discover, Offer, Request, Acknowledge),接口将自动获得: * **IP 地址** * **子网掩码** * **默认网关**(通常会自动在路由表中生成一条默认路由) * **DNS 服务器地址**(可通过 `import-all` 等参数进一步控制) #### C. 为什么不是其他命令? * **`ip address [ip_address] [mask]`**:这是静态配置。题目明确要求“dynamically”(动态获取),因此排除。 * **`ip address negotiated`**:这个命令通常用于 **PPP(点对点协议)** 或 **PPPoE** 环境。虽然它也是动态获取,但它依赖于 LCP 协商,常用于拨号连接(如 ADSL)。题目中提到的是 **FastEthernet** 接口,在以太网环境下,标准做法是使用 DHCP。 --- ### 3. 工程实践与配置步骤 在实际工作中,作为网络工程师,完整的配置流程通常如下: ```bash Router> enable Router# configure terminal Router(config)# interface FastEthernet 0/0 Router(config-if)# description WAN_Link_to_ISP Router(config-if)# ip address dhcp # 核心考点命令 Router(config-if)# no shutdown # 必须开启接口 Router(config-if)# exit ``` --- ### 4. 验证与排错 (Verification) 配置完成后,工程师需要通过以下命令验证状态: 1. **检查 IP 获取情况**: ```bash Router# show ip interface brief # 正常情况下,FastEthernet0/0 的 Status 应为 up,Protocol 为 up,IP 地址显示为获取到的公网 IP。 ``` 2. **检查默认路由**: ```bash Router# show ip route # 确认是否出现一条代码为 'S*' (Candidate Default) 且下一跳指向 ISP 的路由。 ``` 3. **检查 DHCP 租约详细信息**: ```bash Router# show dhcp lease # 查看租约有效期、DNS 服务器以及 DHCP 服务器的 IP。 ``` --- ### 5. 专家总结 在 CCNA 考试及实际工程中,区分 **"DHCP"** 与 **"PPPoE (Negotiated)"** 是关键: * 如果接口是 **Ethernet/FastEthernet/GigabitEthernet** 且要求动态获取,首选 `ip address dhcp`。 * 如果涉及到 **Dialer 接口** 或 **PPP 封装**,则通常使用 `ip address negotiated`。 **本题结论**:针对 FastEthernet 接口动态获取 IP,`ip address dhcp` 是唯一且标准的解决方案。