Question #10
Which command automatically generates an IPv6 address from a specified IPv6 prefix and MAC address of an interface?
A
ipv6 address dhcp
B
ipv6 address 2001:DB8:5:112::/64 eui-64
C
ipv6 address autoconfig
D
ipv6 address 2001:DB8:5:112::2/64 link-local
English
This question tests your understanding of IPv6 address auto-configuration methods, specifically how a global unicast address can be derived from a network prefix and an interface's MAC address.
---
## Detailed Analysis
### The Question
The question asks for a Cisco IOS command that automatically generates an IPv6 address. The key elements are:
1. **Automatically generates**: This implies a method that doesn't require manual input of the full 128-bit address.
2. **IPv6 address**: We're dealing with the next generation of IP addressing.
3. **From a specified IPv6 prefix**: The network portion of the address is given.
4. **And MAC address of an interface**: The host portion of the address is derived from the hardware address.
This combination of requirements strongly points towards the EUI-64 (Extended Unique Identifier-64) process.
### Understanding Key Concepts
Before diving into the options, let's understand some fundamental IPv6 concepts:
* **IPv6 Address Structure**: An IPv6 address is 128 bits long, typically divided into two 64-bit parts:
* **Network Prefix (Network ID)**: The first 64 bits, identifying the network (similar to the network portion in IPv4).
* **Interface ID (Host ID)**: The last 64 bits, identifying a specific interface on that network (similar to the host portion in IPv4).
* **MAC Address**: A 48-bit hardware address unique to each network interface card (NIC). It's typically written in hexadecimal (e.g., `00:1A:2B:3C:4D:5E`).
* **EUI-64 (Extended Unique Identifier-64)**: A method to automatically generate a 64-bit Interface ID for an IPv6 address using a 48-bit MAC address. This is a common way to create a unique host portion of an IPv6 address.
**How EUI-64 Works (Simplified):**
1. Take the 48-bit MAC address (e.g., `00:1A:2B:3C:4D:5E`).
2. Split it into two 24-bit halves: `00:1A:2B` and `3C:4D:5E`.
3. Insert the 16-bit hexadecimal value `FFFE` in the middle: `00:1A:2B:FF:FE:3C:4D:5E`. This results in a 64-bit value.
4. Flip the 7th bit of the first byte. This is the Universal/Local (U/L) bit. If the original MAC address has this bit set to 0 (indicating a globally unique address), it's flipped to 1. If it's 1 (indicating a locally administered address), it's flipped to 0. For most standard MAC addresses from vendors, the 7th bit is 0, so it's flipped to 1.
* Example: `00` (binary `00000000`) becomes `02` (binary `00000010`). So, `00:1A:2B:FF:FE:3C:4D:5E` becomes `02:1A:2B:FF:FE:3C:4D:5E`.
5. This 64-bit value is then appended to the 64-bit network prefix to form the complete 128-bit IPv6 address.
### Analyzing the Options
Let's examine each option:
**A. `ipv6 address dhcp`**
* **Explanation**: This command enables an interface to obtain its IPv6 address and other configuration information (like DNS servers) from a DHCPv6 (DHCP for IPv6) server.
* **Why it's incorrect**: While it's an automatic method, it relies on a DHCPv6 server. It doesn't combine a *specified prefix* with the *interface's MAC address* to generate the address. The DHCPv6 server provides the full address or an address pool.
**B. `ipv6 address 2001:DB8:5:112::/64 eui-64`**
* **Explanation**: This command explicitly assigns an IPv6 address to an interface using a specified 64-bit prefix (`2001:DB8:5:112::/64`) and then automatically generates the 64-bit Interface ID using the **EUI-64** method from the interface's MAC address.
* **Why it's correct**: This command perfectly matches all the requirements of the question:
* **Automatically generates**: Yes, the `eui-64` keyword triggers the automatic generation of the Interface ID.
* **IPv6 address**: Yes, it forms a complete IPv6 address.
* **From a specified IPv6 prefix**: Yes, `2001:DB8:5:112::/64` is provided.
* **And MAC address of an interface**: Yes, `eui-64` uses the interface's MAC address.
**C. `ipv6 address autoconfig`**
* **Explanation**: This command enables Stateless Address Autoconfiguration (SLAAC) on an interface. SLAAC allows a device to automatically configure its IPv6 address without a DHCPv6 server. It typically involves receiving a prefix from a router's Router Advertisement (RA) message and then using EUI-64 (or a randomized identifier) to generate the Interface ID. It also configures a link-local address (FE80::/10 prefix) by default.
* **Why it's incorrect**: While SLAAC *does* use EUI-64 (or a privacy extension variant) and is automatic, the command `ipv6 address autoconfig` itself does not allow you to specify a *particular* global prefix directly within the command for a global address. It relies on a router sending out an RA with a prefix. The question specifically asks for a command that generates from a *specified* IPv6 prefix *within the command itself*. This command is more about enabling the *process* of autoconfiguration, not directly providing the prefix for a global address assignment.
**D. `ipv6 address 2001:DB8:5:112::2/64 link-local`**
* **Explanation**: This command attempts to manually assign an IPv6 address (`2001:DB8:5:112::2/64`).
* `2001:DB8:5:112::2/64` is a **Global Unicast Address**, not a link-local address. Link-local addresses always start with `FE80::/10`.
* The `link-local` keyword, when used with `ipv6 address`, typically forces the assigned address to be treated as a link-local address (and often requires a `FE80::` prefix). Using it with a global prefix is syntactically incorrect for the intent of a global address assignment or makes little sense if the goal is truly a link-local address.
* **Why it's incorrect**:
* It's a **manual static assignment**, not an automatic generation. The `::2` is explicitly defined, not derived from the MAC address.
* The address `2001:DB8:5:112::2/64` is a global unicast address, not a link-local address, making the `link-local` keyword misplaced or semantically incorrect in this context for a global address assignment. Even if it were syntactically valid (which it generally isn't for a global address), it still wouldn't be automatic or use the MAC address.
### Conclusion
The command `ipv6 address 2001:DB8:5:112::/64 eui-64` is the only option that directly fulfills all the requirements: specifying a prefix and then automatically generating the Interface ID using the EUI-64 method based on the interface's MAC address.
The final answer is **ipv6 address 2001:DB8:5:112::/64 eui-64**
日本語
Cisco認定試験(CCNA/CCNP)の対策として、ご質問のコマンドとその技術的背景を詳しく解説します。
---
# 試験問題解析:IPv6アドレスの自動生成
### 問題
**Which command automatically generates an IPv6 address from a specified IPv6 prefix and MAC address of an interface?**
(インターフェースのMACアドレスと指定されたIPv6プレフィックスから、IPv6アドレスを自動的に生成するコマンドはどれですか?)
### 正解
**`ipv6 address / eui-64`**
---
## 専門解説
このコマンドは、**EUI-64 (Extended Unique Identifier 64-bit)** というプロセスを使用して、インターフェースの識別子(インターフェースID)を自動生成するために使用されます。
### 1. EUI-64プロセスの仕組み
MACアドレス(48ビット)を基に、IPv6の下位64ビット(インターフェースID)を生成する手順は以下の通りです。
1. **MACアドレスの分割**: 48ビットのMACアドレスを真ん中(24ビット目と25ビット目の間)で分割します。
* 例: `00:11:22:33:44:55` → `0011:22` と `3344:55`
2. **FFFEの挿入**: 分割した真ん中に `FFFE`(16ビット)を挿入し、計64ビットにします。
* 結果: `0011:22FF:FE33:4455`
3. **第7ビットの反転**: 先頭から7番目のビット(U/Lビット:Universal/Local)を反転させます。
* `00` (16進数) = `0000 0000` (2進数)
* 7番目を反転 → `0000 0010` (2進数) = `02` (16進数)
* 最終的なインターフェースID: `0211:22FF:FE33:4455`
### 2. コマンドの構文例
ルータのインターフェースで以下のように設定します。
```ios
Router(config)# interface GigabitEthernet0/0
Router(config-if)# ipv6 address 2001:DB8:AAAA:1::/64 eui-64
```
この設定により、管理者はプレフィックス(`2001:DB8:AAAA:1::/64`)を指定するだけで、後半のホスト部分はデバイス固有のMACアドレスから自動計算されます。
### 3. なぜこの機能が必要か?
* **管理の簡素化**: 各ホストに個別のIPアドレスを手動で割り当てる必要がなくなります。
* **重複の回避**: MACアドレスは世界で一意であるため、生成されるIPv6アドレスも理論上重複しません。
* **SLAACとの親和性**: ステートレスアドレス自動設定(SLAAC)において、クライアントが自身のIPアドレスを生成する際にもこの仕組みが利用されます。
---
## 試験対策ポイント
* **キーワード**: 「MACアドレス」「EUI-64」「FFFEの挿入」をセットで覚えてください。
* **ひっかけ注意**:
* `ipv6 address autoconfig` は、近隣ルータからのRA(Router Advertisement)を受け取ってアドレスを生成するコマンドです。
* 問題文に「**specified IPv6 prefix**(指定されたプレフィックス)」とある場合は、手動でプレフィックスを入力する `eui-64` オプション付きのコマンドが正解となります。
この解説が試験合格への一助となれば幸いです。
繁體中文
這是一題常見於 Cisco CCNA 或 CCNP 認證考試中的基礎網路題。以下是針對該題目的專業解析:
---
### 考題解析:IPv6 位址自動生成機制
#### 1. 正確指令
在 Cisco IOS 設備上,從指定的 IPv6 前綴(Prefix)與介面的 MAC 位址自動生成 IPv6 位址的指令為:
```bash
ipv6 address / eui-64
```
---
#### 2. 技術核心概念:EUI-64
這個過程稱為 **Modified EUI-64 (Extended Unique Identifier)**。其運作邏輯是將 48 位元(bits)的 MAC 位址轉換為 64 位元的介面識別碼(Interface Identifier)。
**轉換步驟如下:**
1. **拆分 MAC 位址**:將 48 bits 的 MAC 位址從中間拆分為兩部分(各 24 bits)。
2. **插入固定值**:在中間插入十六進位值 `FFFE`。
3. **反轉第 7 位元**:將第一個位元組(Byte)的第 7 個位元(Universal/Local bit)進行反轉(0 變 1,1 變 0)。
**範例說明:**
* 假設 MAC 位址為:`0011.2233.4455`
* 中間插入 FFFE:`0011.22FF.FE33.4455`
* 第 7 位元反轉(00 變 02):最終 Interface ID 為 `0211:22FF:FE33:4455`
* 若前綴為 `2001:DB8:1::/64`,則生成的完整 IPv6 為:`2001:DB8:1::211:22FF:FE33:4455`
---
#### 3. 為什麼使用 eui-64 指令?
* **減少手動配置**:管理員只需定義網路前綴(Network Prefix),後半段的介面 ID 由硬體位址自動產生,確保了唯一性。
* **無狀態位址自動配置 (SLAAC)**:這是 IPv6 實現「即插即用」的重要機制之一。
* **易於追蹤**:透過 IPv6 位址即可反向推導出該設備的實體 MAC 位址。
---
#### 4. 常見錯誤辨析
* **錯誤:`ipv6 address autoconfig`**
* 解析:此指令是讓路由器介面透過鄰居發現協議(NDP)從「其他」路由器獲取前綴並自動配置,而非手動指定前綴。
* **錯誤:`ipv6 address link-local`**
* 解析:這是手動指定連結本地位址,而非根據前綴生成全域單播位址(GUA)。
---
### 總結
當題目提到 **"specified IPv6 prefix"**(指定的 IPv6 前綴)與 **"MAC address"**(MAC 位址)的結合時,關鍵字就是 **`eui-64`**。這項技術確保了 IPv6 環境下的位址自動化管理與唯一性。
简体中文
这是一道关于 Cisco IPv6 配置的基础技术题。以下是针对该题目的专业解析:
---
### 💡 正确答案
**命令:** `ipv6 address / eui-64`
---
### 🔍 核心解析
该命令的核心在于 **EUI-64 (Extended Unique Identifier)** 机制。它允许路由器或主机根据指定的 IPv6 前缀(Prefix)和接口的物理 MAC 地址自动生成一个 128 位的 IPv6 地址。
#### 1. EUI-64 的转换原理
MAC 地址是 48 位(6 字节),而 IPv6 的接口标识符(Interface ID)需要 64 位。转换步骤如下:
1. **拆分:** 将 48 位的 MAC 地址从中间拆分为两部分(各 24 位)。
2. **插入:** 在中间插入固定的 16 位十六进制数 `FFFE`。
3. **翻转:** 将第 1 个字节的第 7 位(U/L 位,Universal/Local)进行翻转(如果是 0 则变为 1,通常 MAC 地址该位为 0,转换后变为 1)。
**示例:**
* MAC 地址:`0011:2233:4455`
* 插入 FFFE:`0011:22FF:FE33:4455`
* 翻转第 7 位:`0211:22FF:FE33:4455`(最终的 Interface ID)
#### 2. 命令语法拆解
```bash
Router(config-if)# ipv6 address 2001:DB8:1:1::/64 eui-64
```
* **`2001:DB8:1:1::/64`**:这是网络前缀,由管理员指定。
* **`eui-64`**:该关键字指示设备:“请取出本接口的 MAC 地址,按照 EUI-64 规则运算后,补齐后 64 位接口 ID”。
#### 3. 为什么使用此命令?
* **自动化:** 减少了手动配置每个接口 IP 地址的工作量。
* **唯一性:** 由于 MAC 地址在全球范围内是唯一的,因此生成的 IPv6 地址在链路上也是唯一的。
* **无状态:** 这是 **SLAAC (Stateless Address Autoconfiguration)** 机制的重要组成部分。
---
### 📝 知识拓展:对比其他配置方式
| 配置方式 | 命令示例 | 特点 |
| :--- | :--- | :--- |
| **手动配置** | `ipv6 address 2001:DB8::1/64` | 完全手动指定 128 位地址。 |
| **EUI-64** | `ipv6 address 2001:DB8::/64 eui-64` | 前缀手动,接口 ID 自动生成。 |
| **无状态自动配置 (SLAAC)** | `ipv6 address autoconfig` | 前缀通过邻居发现协议 (NDP) 获取,接口 ID 通过 EUI-64 生成。 |
| **有状态 (DHCPv6)** | `ipv6 address dhcp` | 从 DHCPv6 服务器获取完整地址。 |
---
### 🎓 考试要点总结
在 Cisco 考试(如 CCNA/CCNP)中,看到 **"MAC address"** 和 **"automatically generates"** 以及 **"prefix"** 这三个关键词同时出现,答案必然指向 **`eui-64`**。