Question #14
An engineer must configure a /30 subnet between two routers. Which usable IP address and subnet mask combination meets this criteria?
A
ip address 10.2.1.3 255.255.255.252
B
ip address 192.168.1.1 255.255.255.248
C
ip address 172.16.1.4 255.255.255.248
D
ip address 209.165.201.2 255.255.255.252
English
This question tests your understanding of subnetting, specifically how to identify a `/30` subnet and find usable IP addresses within it. This is a crucial skill for network engineers, especially when configuring point-to-point links between routers.
Let's break down the concepts involved and then analyze each option.
---
### **Key Concepts for Beginners:**
1. **IP Address (Internet Protocol Address):** A unique numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. It allows devices to locate and communicate with each other. A common format is IPv4, which consists of four numbers (octets) separated by dots, like `192.168.1.1`.
2. **Subnet (Subnetwork):** A logical subdivision of an IP network. Subnetting allows you to divide a large network into smaller, more manageable segments. This improves efficiency, security, and helps conserve IP addresses.
3. **Subnet Mask:** A 32-bit number that helps a device determine which part of an IP address identifies the network and which part identifies the specific device (host) on that network. It's often written in a dotted decimal format (e.g., `255.255.255.0`). The '1's in the subnet mask represent the network portion, and the '0's represent the host portion.
4. **CIDR Notation (Classless Inter-Domain Routing):** A compact way to represent an IP address and its associated subnet mask. It's written as `/number`, where `number` indicates how many bits in the IP address are part of the network portion. For example, `/24` means the first 24 bits are for the network, and the remaining 8 bits are for hosts.
5. **Usable IP Address:** An IP address that can be assigned to an actual device (like a computer, server, or a router's interface).
* Every subnet has a **Network Address** (the first IP in the range) which identifies the subnet itself and cannot be assigned to a host.
* Every subnet has a **Broadcast Address** (the last IP in the range) which is used to send data to all devices on that subnet and also cannot be assigned to a host.
* The addresses *between* the network and broadcast addresses are the **usable host IP addresses**.
6. **Router Interface:** A physical port on a router where a network cable connects. Each interface on a router that connects to a different network segment typically needs its own unique IP address within that segment.
---
### **Understanding a `/30` Subnet:**
The question specifically asks for a `/30` subnet. Let's decode what that means:
* **`/30`**: This means the first 30 bits of the 32-bit IP address are used for the **network portion**.
* **Host Bits**: `32 (total bits) - 30 (network bits) = 2 host bits`.
* **Total Addresses in the Subnet**: With 2 host bits, you can have `2^2 = 4` total IP addresses in that subnet.
* **Usable IP Addresses**: Remember, we must subtract the network address and the broadcast address. So, `4 (total) - 2 (network/broadcast) = 2 usable IP addresses`.
* **Why is this important for two routers?** A point-to-point link between two routers (meaning just two devices on that specific network segment) only requires two IP addresses – one for each router's interface. A `/30` subnet is perfect for this as it provides exactly two usable IPs, thus conserving IP addresses.
* **Subnet Mask for `/30`**: To find the subnet mask, we turn on the first 30 bits and turn off the last 2 bits:
* `11111111.11111111.11111111.11111100`
* Converting to decimal: `255.255.255.252`
---
### **Analyzing the Options:**
We are looking for an option that uses a `255.255.255.252` subnet mask and has an IP address that is **usable** (i.e., not the network address or the broadcast address) within that specific `/30` subnet.
Let's use an example to illustrate how addresses work in a `/30` subnet. Since the last octet has only 2 host bits, the possible values for the host portion (00, 01, 10, 11) mean the last octet of IP addresses in a `/30` subnet will always increment by multiples of 4:
* `X.X.X.0` (Network Address)
* `X.X.X.1` (First Usable Host)
* `X.X.X.2` (Second Usable Host)
* `X.X.X.3` (Broadcast Address)
Then the next subnet would be `X.X.X.4` (Network Address), `X.X.X.5` (Usable), `X.X.X.6` (Usable), `X.X.X.7` (Broadcast), and so on.
---
**Option 1: `ip address 10.2.1.3 255.255.255.252`**
* **Subnet Mask:** `255.255.255.252`. This is indeed a `/30` subnet mask. This part matches the criteria.
* **IP Address:** `10.2.1.3`. Let's determine if this is a usable IP for a `/30` subnet.
* Considering the last octet and the `/30` mask, the subnets increment by 4.
* The subnet containing `10.2.1.3` would start at `10.2.1.0`.
* The address range for this subnet is:
* `10.2.1.0` (Network Address)
* `10.2.1.1` (First Usable Host)
* `10.2.1.2` (Second Usable Host)
* `10.2.1.3` (Broadcast Address)
* Since `10.2.1.3` is the **broadcast address** for this subnet, it is **not a usable IP address**.
* **Conclusion:** Incorrect.
**Option 2: `ip address 192.168.1.1 255.255.255.248`**
* **Subnet Mask:** `255.255.255.248`. Let's convert `248` to binary: `11111000`. This means 5 bits in the last octet are network bits.
* Total network bits: `24 (first three octets) + 5 (last octet) = 29`. This is a `/29` subnet.
* A `/29` subnet has `32 - 29 = 3` host bits, which means `2^3 = 8` total addresses, and `8 - 2 = 6` usable addresses.
* **Problem:** The question requires a `/30` subnet (2 usable addresses), but this option provides a `/29` subnet (6 usable addresses).
* **Conclusion:** Incorrect.
**Option 3: `ip address 172.16.1.4 255.255.255.248`**
* **Subnet Mask:** `255.255.255.248`. As determined in Option 2, this is a `/29` subnet mask, not a `/30`.
* **Problem:** The subnet mask does not meet the `/30` criteria.
* **Conclusion:** Incorrect.
**Option 4: `ip address 209.165.201.2 255.255.255.252`**
* **Subnet Mask:** `255.255.255.252`. This is a `/30` subnet mask. This matches the criteria.
* **IP Address:** `209.165.201.2`. Let's determine if this is a usable IP for a `/30` subnet.
* Considering the last octet and the `/30` mask, the subnets increment by 4.
* The subnet containing `209.165.201.2` would start at `209.165.201.0`.
* The address range for this subnet is:
* `209.165.201.0` (Network Address)
* `209.165.201.1` (First Usable Host)
* `209.165.201.2` (Second Usable Host)
* `209.165.201.3` (Broadcast Address)
* Since `209.165.201.2` falls within the range of usable host IPs (it's the second usable IP), it is a **usable IP address**.
* **Conclusion:** Correct.
---
### **Final Answer Explanation:**
The question asks for a `/30` subnet between two routers. This means we need a subnet mask that indicates 30 network bits (`255.255.255.252`) and an IP address that is not the network address or the broadcast address for that specific subnet.
Option 4, `ip address 209.165.201.2 255.255.255.252`, correctly identifies a `/30` subnet mask (`255.255.255.252`). Within the subnet `209.165.201.0/30`, the addresses are:
* `209.165.201.0` (Network Address)
* `209.165.201.1` (Usable Host IP)
* `209.165.201.2` (Usable Host IP)
* `209.165.201.3` (Broadcast Address)
Since `209.165.201.2` is a usable host IP address within this `/30` subnet, this option meets all the criteria.
日本語
CCNA試験対策として、この問題の核心である**/30サブネット(プレフィックス長30)**の計算方法と、実務におけるネットワーク設計の考え方を詳しく解説します。
---
# CCNA試験対策:/30サブネットの構成とIPアドレス計算
## 1. /30 サブネットの基本概念
`/30` サブネットは、主に**2台のルータ間を接続するポイントツーポイント(Point-to-Point)リンク**で使用されます。ホストに割り当て可能なIPアドレスがちょうど「2つ」になるため、IPアドレスの浪費を防ぐ効率的な設計として標準的に用いられます。
### サブネットマスクの変換
* **CIDR表記**: `/30`
* **バイナリ表記**: `11111111.11111111.11111111.11111100`
* **ドット付き十進表記**: `255.255.255.252`
---
## 2. アドレス空間の内訳
/30では、ホスト部は2ビット(32 - 30 = 2)です。
全アドレス数は $2^2 = 4$ 個となりますが、実際にデバイス(ルータのインターフェース)に設定できる**使用可能な(Usable)IPアドレス**は、以下のルールにより **2個** に限定されます。
1. **ネットワークアドレス**: ホストビットがすべて「0」のアドレス(使用不可)
2. **使用可能なIPアドレス 1**: ルータA用
3. **使用可能なIPアドレス 2**: ルータB用
4. **ブロードキャストアドレス**: ホストビットがすべて「1」のアドレス(使用不可)
---
## 3. 具体的な計算例
試験でよく出題されるパターンを例に、正しい組み合わせを見分ける方法を解説します。
### 例:`192.168.1.4/30` の場合
この場合、ブロックサイズは「4」になります(256 - 252 = 4)。したがって、ネットワークは 0, 4, 8, 12... と 4刻みで区切られます。
* **ネットワークID**: `192.168.1.4`
* **使用可能な1つ目のIP**: `192.168.1.5` (設定可能)
* **使用可能な2つ目のIP**: `192.168.1.6` (設定可能)
* **ブロードキャストアドレス**: `192.168.1.7`
### 判別ポイント
試験の選択肢から正解を選ぶ際は、以下の2点を確認してください。
1. **サブネットマスクが `255.255.255.252` であること。**
2. **IPアドレスの第4オクテットが「4の倍数(ネットワークID)」でも「4の倍数-1(ブロードキャスト)」でもないこと。**
---
## 4. よくある「誤り」のパターン(試験での罠)
* **`10.1.1.3 255.255.255.252`**
* **不可**: 第4オクテットの「3」は、ネットワーク `10.1.1.0/30` のブロードキャストアドレスです。
* **`10.1.1.4 255.255.255.252`**
* **不可**: 第4オクテットの「4」は、ネットワークIDそのものです。
* **`10.1.1.5 255.255.255.248`**
* **不可**: サブネットマスクが `/29` になっており、要件を満たしません。
---
## 5. エンジニアとしてのまとめ
設問に対する「正解の組み合わせ」は、具体的に提示された選択肢によりますが、論理的な正解は以下の条件を満たすものです。
| 項目 | 条件 |
| :--- | :--- |
| **サブネットマスク** | **255.255.255.252** |
| **IPアドレス** | **第4オクテットを4で割った余りが「1」または「2」のもの** |
### 実務でのTips
最近のCiscoルータ(IOS 12.2(8)T以降)では、さらに効率化するために `/31` (255.255.255.254) を使用することも可能ですが、**CCNA試験においては「ルータ間接続 = /30」が依然として基本的な正解**となります。
この計算ロジックをマスターすることは、ICND1/CCNA合格への第一歩です。ブロックサイズ「4」を意識して、瞬時に計算できるように練習しておきましょう。
繁體中文
這是一題經典的 CCNA 基礎網路概念題,考查考生對於 **CIDR (無類別域間路由)**、**子網路遮罩計算**以及**可用主機位址(Usable IP)**的理解。
身為 Cisco 網路工程師,針對這題「在兩台路由器之間配置 /30 子網路」的分析如下:
---
### 1. 核心技術分析:什麼是 /30 子網路?
在點對點(Point-to-Point)的路由器連接中,為了節省 IP 位址空間,工程師通常會使用 `/30` 遮罩。
* **CIDR 表示法**:`/30`
* **二進位遮罩**:`11111111.11111111.11111111.11111100`
* **十進位遮罩 (Subnet Mask)**:`255.255.255.252`
#### 計算過程:
1. **總位址數**:主機位元佔 2 位($32 - 30 = 2$),因此總位址數為 $2^2 = 4$ 個。
2. **可用位址數**:必須扣除「網路位址 (Network ID)」與「廣播位址 (Broadcast Address)」,公式為 $2^{(32-n)} - 2$。
* $4 - 2 = 2$ 個可用 IP。
3. **間隔(Magic Number)**:$256 - 252 = 4$。這代表子網路是以 4 為跳數(例如:.0, .4, .8, .12...)。
---
### 2. 如何判斷正確答案?
要符合題目要求的「可用 IP」與「子網路遮罩」組合,必須滿足以下兩個條件:
#### 條件 A:子網路遮罩必須是 `255.255.255.252`
如果選項中的遮罩不是 `.252`(例如是 .248 或 .240),則直接排除。
#### 條件 B:IP 位址不能是「網路位址」或「廣播位址」
在 /30 的架構中,IP 位址必須是 **4 的倍數 + 1** 或 **4 的倍數 + 2**。
**範例判斷表(以 192.168.1.0/30 為例):**
| 類型 | IP 位址 | 判斷方式 | 是否可用 |
| :--- | :--- | :--- | :--- |
| **網路位址** | 192.168.1.0 | 4 的倍數 | ❌ 不可用 |
| **可用 IP 1** | 192.168.1.1 | 4 的倍數 + 1 | ✅ **可用** |
| **可用 IP 2** | 192.168.1.2 | 4 的倍數 + 2 | ✅ **可用** |
| **廣播位址** | 192.168.1.3 | 4 的倍數 + 3 | ❌ 不可用 |
---
### 3. 實戰範例解析
假設考題提供的選項如下(常見考題型式):
* (A) 10.1.1.3 / 255.255.255.252
* (B) 10.1.1.4 / 255.255.255.252
* (C) 10.1.1.10 / 255.255.255.252
* (D) 10.1.1.12 / 255.255.255.248
**工程師的解題思路:**
1. **排除 (D)**:遮罩為 .248,這是 /29,不符題目要求。
2. **排除 (B)**:10.1.1.4 是 4 的倍數,它是該段的**網路位址 (Network ID)**,無法分配給介面使用。
3. **排除 (A)**:10.1.1.3 是 4 的倍數減 1(即 0, 1, 2, **3**),它是該段的**廣播位址 (Broadcast)**。
4. **選出 (C)**:
* 最近的網路位址是 10.1.1.8 (4的倍數)。
* 該段範圍是 10.1.1.8 ~ 10.1.1.11。
* 可用 IP 為 10.1.1.9 與 **10.1.1.10**。
* **結論:(C) 是正確組合。**
---
### 4. 總結與考點提醒
在 Cisco 考試或實際現網配置中,請牢記:
* **/30 永遠只有 2 個可用 IP**。
* **遮罩必為 255.255.255.252**。
* **快速檢查法**:將 IP 最後一碼除以 4,餘數必須是 **1** 或 **2** 才是可用位址。
> **專業補充**:雖然現代 Cisco 設備支援 `ip subnet-zero` 且在特定情況下可以使用 `/31` (RFC 3021) 來節省更多位址,但在 CCNA 標準考題中,**/30 搭配 .252** 依然是點對點連接的標準答案。
简体中文
作为一名资深网络工程师,针对这道经典的 CCNA 考题,我将从 **/30 子网掩码的原理、计算逻辑以及在点对点链路中的实际应用**三个维度为你进行深度解析。
---
### 1. 核心考点:/30 子网掩码的特性
在 IPv4 地址规划中,`/30` 掩码是点对点(Point-to-Point)链路的标准选择,因为它能最大限度地节省 IP 地址资源。
* **子网掩码(Subnet Mask):**
* CIDR 表示法:`/30`
* 点分十进制表示法:`255.255.255.252`
* 二进制表示:`11111111.11111111.11111111.11111100`
* **地址空间计算:**
* **主机位(Host Bits):** $32 - 30 = 2$ 位。
* **总地址数:** $2^2 = 4$ 个。
* **可用主机数(Usable IPs):** $2^2 - 2 = 2$ 个(减去网络地址和广播地址)。
* **增量(Block Size / Magic Number):** $256 - 252 = 4$。
---
### 2. 逻辑推演:如何判断合法的 IP 组合?
要确定一个“可用 IP 地址与掩码组合”是否正确,必须满足以下两个条件:
1. **掩码必须是 `255.255.255.252`。**
2. **IP 地址不能是该子网的“网络地址”或“广播地址”。**
#### 判定公式:
假设 IP 地址的最后一段为 $X$,子网增量为 $4$:
* 如果 $X \mod 4 = 0$,则该地址是**网络地址**(不可分配给接口)。
* 如果 $X \mod 4 = 3$,则该地址是**广播地址**(不可分配给接口)。
* 如果 $X \mod 4 = 1$ 或 $2$,则该地址是**可用主机地址**。
---
### 3. 典型案例分析
假设题目给出的选项如下(模拟常见 CCNA 题型):
| 选项 | IP 地址 | 子网掩码 | 判定结果 | 解析 |
| :--- | :--- | :--- | :--- | :--- |
| A | 10.1.1.4 | 255.255.255.252 | **错误** | $4 \div 4$ 余 $0$,这是该段的**网络地址**。 |
| B | 10.1.1.7 | 255.255.255.252 | **错误** | $7 \div 4$ 余 $3$,这是该段的**广播地址**。 |
| C | 10.1.1.2 | 255.255.255.252 | **正确** | $2 \div 4$ 余 $2$,属于该段可用地址(范围 .1 - .2)。 |
| D | 10.1.1.5 | 255.255.255.248 | **错误** | 掩码为 /29,不符合题目 /30 的要求。 |
---
### 4. 工程师的专业视角:为什么是 /30?
在路由器互联(Router-to-Router)的场景中,两台路由器之间只需要两个 IP 地址(对端各一个)。
* 如果使用 `/24` 掩码,会浪费 252 个地址。
* 如果使用 `/30` 掩码,正好提供 2 个可用地址,既满足互通,又避免了广播域过大和地址浪费。
> **进阶知识点:** 虽然现代网络协议(如 OSPF)支持在点对点链路上使用 `/31` 掩码(RFC 3021),但在 CCNA 考试和传统配置中,`/30` 依然是考察子网划分逻辑的最标准答案。
---
### 5. 总结
当你面对此类考题时,请快速执行以下口诀:
1. **看掩码:** 必须是 `255.255.255.252`。
2. **找倍数:** 观察 IP 末位,找到 4 的倍数(如 0, 4, 8, 12...)。
3. **避两端:** 排除 4 的倍数(网络号)和 4 的倍数减 1(广播号)。
4. **选中间:** 剩下的就是 **可用 IP**。
**正确答案示例:** `192.168.1.13 255.255.255.252` (网络号是 .12,可用是 .13 和 .14,广播是 .15)。