Question #1350

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 doses and cannot be reopened. Topology - Tasks - SW-3 and SW-4 are preconfigured with all necessary commands. All physical cabling is in place and verified. All connectivity must be operational. 1. Configure both SW-1 and SW-2 switch ports e0/0 and e0/1 for 802.1q trunking with only VLANS 1, 12, and 22 permitted. 2. Configure SW-1 port e0/2 for 802.1q trunking and include only VLANS 12 and 22. 3. Configure both SW-1 and SW-2 switch ports e0/0 and e0/1 for link aggregation using the industry standard protocol. All ports must be configured so that they immediately negotiate the link.
English
This question is a practical lab simulation focusing on fundamental switching concepts: **802.1q Trunking** and **Link Aggregation (EtherChannel)** using the **Link Aggregation Control Protocol (LACP)**. The goal is to configure these features on SW-1 and SW-2 to ensure proper connectivity and traffic flow for specified VLANs. Let's break down the tasks and the provided solution commands. ### Scenario Overview The topology shows four switches: SW-1, SW-2, SW-3, and SW-4. * SW-1 and SW-2 are connected by two physical links (e0/0 and e0/1) which are grouped into a logical link called "Po12" (Port-channel 12). This indicates that link aggregation is intended here. * SW-1 connects to SW-3 via e0/2. * SW-2 connects to SW-4 via e0/2. * SW-3 connects to SW-4 via e0/1. The problem states that SW-3 and SW-4 are already configured, and all physical cabling is verified. We only need to focus on configuring SW-1 and SW-2 according to the tasks. ### Technical Concepts Explained Before diving into the tasks, let's understand the key technical terms: 1. **802.1q Trunking:** * **What it is:** An industry-standard protocol for carrying multiple Virtual Local Area Network (VLAN) traffic over a single physical or logical link. This is crucial for inter-switch connectivity where devices belonging to different VLANs need to communicate across switches. * **How it works:** It adds a special "tag" (a 4-byte header) to Ethernet frames, indicating which VLAN the frame belongs to. When a tagged frame arrives at a switch, the switch knows which VLAN to forward it to. * **`switchport trunk encapsulation dot1q`:** This command explicitly sets the trunking encapsulation method to IEEE 802.1q. While newer Cisco switches often default to 802.1q and don't strictly require this command, it's good practice to include it for clarity and compatibility, especially on switches that might support other encapsulation types (like Cisco's proprietary ISL, which is now deprecated). * **`switchport mode trunk`:** This command configures the interface to operate permanently in trunking mode. * **`switchport trunk allowed vlan `:** This command controls which VLANs are permitted to traverse the trunk link. By default, all VLANs (1-4094) are allowed on a trunk. Restricting allowed VLANs enhances security, conserves bandwidth (by not forwarding unnecessary broadcast traffic for unused VLANs), and reduces the size of the MAC address table. VLAN 1 is the default VLAN and is often allowed on trunks unless explicitly removed. 2. **VLANs (Virtual Local Area Networks):** * **What they are:** Logical groupings of network devices (e.g., computers, servers) that can communicate as if they are on the same physical segment, regardless of their actual physical location. VLANs segment a broadcast domain, improving network performance and security. * **VLAN 1:** This is the default VLAN on Cisco switches. All ports are members of VLAN 1 by default, and management traffic often uses VLAN 1. 3. **Link Aggregation (EtherChannel / Port-channel):** * **What it is:** A technology that groups multiple physical Ethernet links into a single logical link. This logical link is called an EtherChannel (Cisco's term) or a Port-channel. * **Benefits:** * **Increased Bandwidth:** The aggregate bandwidth of all physical links in the channel is available. For example, two 1 Gbps links create a 2 Gbps logical link. * **Redundancy:** If one physical link in the channel fails, traffic automatically shifts to the remaining active links without service interruption. * **Load Balancing:** Traffic can be distributed across the member links using various load-balancing algorithms (e.g., source MAC, destination MAC, source/destination IP). * **`interface range `:** A convenient command to apply configurations to multiple interfaces simultaneously. * **`channel-group mode `:** This command is used on the physical interfaces to add them to an EtherChannel group. * ``: A unique number to identify the Port-channel interface (e.g., 12 in `Po12`). * ``: Specifies the EtherChannel negotiation protocol and behavior. * **`interface Port-channel `:** Once the physical interfaces are added to a `channel-group`, a logical `Port-channel` interface is created. All configurations related to Layer 2 (like trunking, allowed VLANs, Spanning Tree Protocol costs) or Layer 3 (IP addressing) for the aggregated link are applied to this *logical* Port-channel interface, not the individual physical interfaces. 4. **Link Aggregation Control Protocol (LACP):** * **What it is:** An **industry-standard** (IEEE 802.3ad) protocol used to negotiate and establish EtherChannels. This is important because the question specifically asks for the "industry standard protocol." * **Modes for LACP:** * **`active`:** The interface *unconditionally* attempts to initiate LACP negotiation with the other side. It actively sends LACP packets. The question states "All ports must be configured so that they immediately negotiate the link," which strongly points to `active` mode. * **`passive`:** The interface responds to LACP packets but does not initiate negotiation. It waits for the other side to start. * For an LACP EtherChannel to form, at least one side must be in `active` mode. Both sides can be `active`. ### Task-by-Task Analysis and Command Explanation Let's break down each task and see how the provided commands address them. --- **Task 1: Configure both SW-1 and SW-2 switch ports e0/0 and e0/1 for 802.1q trunking with only VLANS 1, 12, and 22 permitted.** **Task 3: Configure both SW-1 and SW-2 switch ports e0/0 and e0/1 for link aggregation using the industry standard protocol. All ports must be configured so that they immediately negotiate the link.** *Self-correction/Clarification:* Tasks 1 and 3 are intrinsically linked for interfaces e0/0 and e0/1. The link aggregation (Port-channel) must be configured first, and *then* the trunking properties are applied to the *logical* Port-channel interface, not the individual physical interfaces. This is correctly reflected in the reference commands. #### **Commands for SW-1 (Addressing Tasks 1 & 3):** ``` SW-1(config)# interface range e0/0-1 ``` * **Explanation:** This command enters interface configuration mode for multiple interfaces (e0/0 and e0/1) simultaneously. This is efficient for applying common settings. ``` SW-1(config-if-range)# channel-group 12 mode active ``` * **Explanation:** This command performs two actions: * It creates a new Port-channel interface named `Port-channel 12` if it doesn't already exist. * It adds the physical interfaces `e0/0` and `e0/1` to this logical `Port-channel 12`. * `mode active` specifies that LACP (the industry-standard protocol) should be used, and the interfaces should actively attempt to establish the EtherChannel. This addresses "using the industry standard protocol" and "immediately negotiate the link" from Task 3. ``` SW-1(config-if-range)# interface Port-channel 12 ``` * **Explanation:** After creating the `channel-group`, the next step is to configure the *logical* Port-channel interface itself. This command switches the configuration context to `Port-channel 12`. All subsequent `switchport` commands for trunking will apply to this logical aggregated link, ensuring consistency across all member physical links. ``` SW-1(config-if)# switchport trunk encapsulation dot1q ``` * **Explanation:** This command explicitly sets the trunking encapsulation type to 802.1q, as required for standard trunking. This is part of Task 1. ``` SW-1(config-if)# switchport mode trunk ``` * **Explanation:** This command configures the `Port-channel 12` logical interface to operate in permanent trunking mode, allowing it to carry traffic for multiple VLANs. This fulfills the trunking requirement from Task 1. ``` SW-1(config-if)# switchport trunk allowed vlan 1,12,22 ``` * **Explanation:** This command restricts the VLANs permitted on the `Port-channel 12` trunk link to only VLANs 1, 12, and 22. This directly addresses the requirement from Task 1. --- **Task 2: Configure SW-1 port e0/2 for 802.1q trunking and include only VLANS 12 and 22.** #### **Commands for SW-1 (Addressing Task 2):** ``` SW-1(config-if)# interface e0/2 ``` * **Explanation:** This command moves the configuration context to the individual physical interface `e0/2`. This port is not part of a Port-channel. ``` SW-1(config-if)# switchport trunk encapsulation dot1q ``` * **Explanation:** Similar to the Port-channel, this explicitly sets the trunking encapsulation type for `e0/2` to 802.1q. ``` SW-1(config-if)# switchport mode trunk ``` * **Explanation:** This configures `e0/2` to operate as a permanent trunk port. ``` SW-1(config-if)# switchport trunk allowed vlan 12,22 ``` * **Explanation:** This command restricts the VLANs allowed on the `e0/2` trunk link to only VLANs 12 and 22, as specified in Task 2. Note that VLAN 1 is explicitly excluded here. ``` SW-1(config-if)# end ``` * **Explanation:** Exits interface configuration mode and returns to privileged EXEC mode. ``` SW-1# write memory ``` * **Explanation:** Saves the running configuration to NVRAM (Non-Volatile RAM), ensuring that the changes persist across reboots. In a lab environment, this is crucial for the solution to be considered complete. --- #### **Commands for SW-2 (Addressing Tasks 1 & 3):** The configuration for SW-2 regarding interfaces e0/0 and e0/1 (the Port-channel) must mirror that of SW-1 for the EtherChannel to form correctly and for trunking to function. ``` SW-2(config)# interface range GigabitEthernet0/0-1 ``` * **Explanation:** Enters configuration mode for interfaces G0/0 and G0/1 on SW-2. *Note: The command uses `GigabitEthernet0/0-1`, which implies the physical interfaces are Gigabit Ethernet. The diagram labels them generically as `e0/0` and `e0/1`. In CCNA exams, `e0/X` often maps to `GigabitEthernet0/X` or `FastEthernet0/X`. The core commands remain the same regardless of the exact interface speed/type.* ``` SW-2(config-if-range)# channel-group 12 mode active ``` * **Explanation:** Creates/adds interfaces G0/0 and G0/1 to Port-channel 12, using LACP `active` mode, just like on SW-1. This is essential for the EtherChannel to form. ``` SW-2(config-if-range)# interface Port-channel 12 ``` * **Explanation:** Switches configuration context to the logical `Port-channel 12` interface on SW-2. ``` SW-2(config-if)# switchport trunk encapsulation dot1q ``` * **Explanation:** Sets 802.1q encapsulation for `Port-channel 12` on SW-2. ``` SW-2(config-if)# switchport mode trunk ``` * **Explanation:** Configures `Port-channel 12` on SW-2 as a permanent trunk. ``` SW-2(config-if)# switchport trunk allowed vlan 1,12,22 ``` * **Explanation:** Restricts allowed VLANs on `Port-channel 12` on SW-2 to 1, 12, and 22, mirroring SW-1's configuration for the link aggregation. ``` SW-2(config-if)# end ``` * **Explanation:** Exits configuration mode. ``` SW-2# write memory ``` * **Explanation:** Saves the running configuration to NVRAM on SW-2. ### Summary of Configuration Outcome Upon successful execution of these commands: * **SW-1 and SW-2 will form an EtherChannel (Port-channel 12)** over their e0/0 and e0/1 links, providing increased bandwidth and redundancy. * This logical **Port-channel 12 will operate as an 802.1q trunk** between SW-1 and SW-2, allowing only VLANs 1, 12, and 22 to traverse it. * **SW-1's e0/2 interface will operate as an 802.1q trunk** to SW-3, allowing only VLANs 12 and 22 to traverse it. This configuration correctly addresses all the requirements specified in the tasks, ensuring robust and properly segmented connectivity within the network segment involving SW-1 and SW-2.
日本語
こんにちは!Ciscoの技術担当です。ネットワークの世界へようこそ! 今回の問題は、CCNA試験の中でも非常に重要で、かつ実務でも頻繁に登場する**「Trunk(トランク)接続」**と**「EtherChannel(イーサチャネル)」**の設定に関するシミュレーション問題です。 初心者の方でも構成がしっかり理解できるように、順を追って解説していきますね。 --- ### 1. この問題で実現したいこと このネットワーク構成では、以下の3つのポイントを実現しようとしています。 1. **道をまとめる(EtherChannel)**: SW-1とSW-2の間にある2本の物理ケーブルを1つの大きな「仮想的な道(Po12)」としてまとめ、通信帯域を増やし、片方が切れても通信が途切れないようにします。 2. **複数のVLANを通す(Trunk)**: 1本の接続の中で、複数のグループ(VLAN 1, 12, 22など)のデータが混ざらないように区別して運びます。 3. **通るVLANを制限する(VLAN Filtering)**: セキュリティと効率のため、必要なVLANだけがその道を通れるように制限をかけます。 --- ### 2. 知っておきたい専門用語(用語解説) 解説を読む前に、以下の言葉をイメージしておくと理解がスムーズになります。 * **VLAN(バーチャルLAN)**: 物理的な接続に関わらず、ネットワークを仮想的なグループに分ける技術です。 * **Trunk(トランク)**: 複数のVLANのデータを1本のケーブルでまとめて運ぶための接続モードです。 * **802.1q (dot1q)**: トランク接続で、どのデータがどのVLANのものかを識別するための「タグ(目印)」をつける世界標準のルールです。 * **EtherChannel(イーサチャネル)**: 複数の物理ポートを束ねて、1つの論理的なポートとして扱う技術です。 * **LACP(Link Aggregation Control Protocol)**: EtherChannelを作るための業界標準のプロトコルです。設定で `mode active` を使うとこれになります。 * **NVRAM / write memory**: 設定を保存する場所とコマンドです。これを忘れると再起動したときに設定が消えてしまいます。 --- ### 3. 解答(設定コマンド)の徹底解説 それでは、スイッチごとの設定内容を噛み砕いて見ていきましょう。 #### ■ SW-1 の設定 まず、SW-1で隣のSW-2との接続(e0/0, e0/1)と、下のSW-3との接続(e0/2)を設定します。 ```bash # e0/0とe0/1の2つのポートを同時に設定します SW-1(config)# interface range e0/0-1 # LACP(業界標準)を使って2本を1つに束ねます。 # 「mode active」にすることで、自分から積極的に「束ねよう!」と交渉を開始します。 SW-1(config-if-range)# channel-group 12 mode active # 束ねた後の「仮想的なポート(Port-channel 12)」に対して設定を行います。 SW-1(config-if-range)# interface Port-channel 12 # トランクの方式を 802.1q に指定し、モードをトランクにします。 SW-1(config-if)# switchport trunk encapsulation dot1q SW-1(config-if)# switchport mode trunk # この道を通っていいのは VLAN 1, 12, 22 だけに限定します。 SW-1(config-if)# switchport trunk allowed vlan 1,12,22 # 次に、SW-3へ繋がるポート e0/2 の設定です。 SW-1(config-if)# interface e0/2 SW-1(config-if)# switchport trunk encapsulation dot1q SW-1(config-if)# switchport mode trunk # こちらは VLAN 12 と 22 だけを通します。(VLAN 1は通しません) SW-1(config-if)# switchport trunk allowed vlan 12,22 # 設定を保存します。 SW-1# write memory ``` #### ■ SW-2 の設定 SW-2側も、SW-1と合わせる形で設定を行います。 ```bash # SW-1と同じように2本のポートを選択します。 SW-2(config)# interface range e0/0-1 # SW-1と同じ番号(12)で束ねます。相手が active なら、こちらも active で確実に繋ぎます。 SW-2(config-if-range)# channel-group 12 mode active # 仮想ポートの設定です。 SW-2(config-if-range)# interface Port-channel 12 SW-2(config-if)# switchport trunk encapsulation dot1q SW-2(config-if)# switchport mode trunk # SW-1側の設定と一致させる必要があります(VLAN 1, 12, 22)。 SW-2(config-if)# switchport trunk allowed vlan 1,12,22 # 設定を保存します。 SW-2# write memory ``` --- ### 4. 学習のアドバイス この問題を解く際のポイントは以下の3点です。 1. **「束ねてから設定する」**: 物理ポート(e0/0, e0/1)で `channel-group` を設定した後、トランクの設定は必ず **Port-channel インターフェース** に対して行うのが Cisco の推奨手順です。 2. **「allowed vlan」のカンマに注意**: `allowed vlan 1,12,22` のように、指定された番号を正確に入力しましょう。スペースを入れないのが一般的です。 3. **「write memory」を忘れない**: 実技試験(シミュレーション)では、最後に保存コマンドを打たないと採点されないケースが多いので、手癖にするくらいがちょうど良いです。 この設定ができるようになれば、企業のネットワーク基盤を作るスキルの第一歩をマスターしたことになります。頑張ってくださいね!応援しています。
繁體中文
你好!我是 Cisco 的技術專家。很高興能為你解析這題 CCNA 的實作模擬題。這道題目非常經典,它涵蓋了交換機(Switch)維運中最核心的三個技術:**鏈路聚合(EtherChannel)**、**中繼埠(Trunk)** 以及 **VLAN 流量過濾**。 對於剛入門的學習者來說,這題的重點在於如何把多條物理線路「綁」在一起,並確保只有特定的流量可以通過。 --- ### 📋 專業名詞解釋 在進入解析之前,我們打個比方,讓這些名詞變簡單: 1. **VLAN (Virtual LAN, 虛擬區域網路)**: * 想像成一棟大樓裡的「隔間」。雖然大家都在同一棟樓,但不同部門(VLAN)的人預設是互不相通的。 2. **Trunk (中繼埠 / 幹線)**: * 像是一條「高速公路」。當交換機之間有多個 VLAN 的資料要傳遞時,我們需要一條可以同時承載多種 VLAN 標記的線路。 3. **802.1q (Dot1q)**: * 這是 Trunk 的「國際標準語言」。它會在資料封包上貼個「標籤」,告訴下一台交換機這個封包是屬於哪個 VLAN 的。 4. **Link Aggregation / EtherChannel (鏈路聚合)**: * 把兩條或多條實體線路「綑綁」成一條邏輯上的大水管。好處是**增加頻寬**,且具備**備援功能**(斷了一條,另一條還能動)。 5. **LACP (Link Aggregation Control Protocol)**: * 這是題目的重點。它是鏈路聚合的「業界標準協議」。題目提到的「業界標準」與「主動協商」指的就是要把模式設定為 **Active**。 --- ### 💡 任務解析與指令說明 這個實驗要求我們配置 SW-1 與 SW-2。我們將任務拆解為以下步驟: #### 第一部分:配置 SW-1 **1. 綑綁埠位並啟動 LACP (Task 3)** 我們要把 e0/0 和 e0/1 綁在一起變成一個 `Port-channel 12`。 * `interface range e0/0-1`:一次選取兩個埠,省時又不容易出錯。 * `channel-group 12 mode active`:將這兩個埠加入第 12 號群組。「Active」表示這台交換機會主動去找對方說:「嘿!我們要不要綁在一起?」。 **2. 設定 Trunk 與 VLAN 許可 (Task 1)** 綁好之後,我們要對「這條大水管 (Port-channel 12)」進行設定。 * `interface Port-channel 12`:進入虛擬介面。 * `switchport trunk encapsulation dot1q`:指定使用 802.1q 協定(有些設備需要手動輸入,有些則是預設)。 * `switchport mode trunk`:正式把這條路改成 Trunk 模式。 * `switchport trunk allowed vlan 1,12,22`:**重要!** 這是「白名單」設定。只有這三個 VLAN 的資料可以通過,其他都會被擋掉。 **3. 配置連往 SW-3 的介面 (Task 2)** * `interface e0/2`:進入連往 SW-3 的實體埠。 * 同樣設為 Trunk 模式,但注意這裡的白名單只有 `12,22`(不含 VLAN 1)。 --- #### 第二部分:配置 SW-2 SW-2 的邏輯與 SW-1 幾乎一樣,只是它不需要設定連往 SW-4 的埠(題目說 SW-3 與 SW-4 已預先配置好,我們只需要處理 SW-1 和 SW-2 的對接部分)。 --- ### ⌨️ 實作指令步驟彙整 請依照考題需求輸入以下指令: #### **SW-1 配置** ```bash SW-1(config)# interface range e0/0-1 # 選取 e0/0 和 e0/1 SW-1(config-if-range)# channel-group 12 mode active # 設定 LACP 主動模式 SW-1(config-if-range)# exit SW-1(config)# interface Port-channel 12 # 進入剛剛建立的邏輯介面 SW-1(config-if)# switchport trunk encapsulation dot1q # 指定封裝協議 SW-1(config-if)# switchport mode trunk # 改為 Trunk 模式 SW-1(config-if)# switchport trunk allowed vlan 1,12,22 # 只允許 VLAN 1, 12, 22 SW-1(config-if)# interface e0/2 # 進入連往 SW-3 的埠 SW-1(config-if)# switchport trunk encapsulation dot1q SW-1(config-if)# switchport mode trunk SW-1(config-if)# switchport trunk allowed vlan 12,22 # 只允許 VLAN 12, 22 SW-1(config-if)# end SW-1# write memory # 存檔(考試一定要做!) ``` #### **SW-2 配置** ```bash SW-2(config)# interface range e0/0-1 # 選取 e0/0 和 e0/1 SW-2(config-if-range)# channel-group 12 mode active # 同樣設定 LACP SW-2(config-if-range)# exit SW-2(config)# interface Port-channel 12 # 進入邏輯介面 SW-2(config-if)# switchport trunk encapsulation dot1q SW-2(config-if)# switchport mode trunk SW-2(config-if)# switchport trunk allowed vlan 1,12,22 # 兩端允許的 VLAN 必須一致 SW-2(config-if)# end SW-2# write memory # 存檔 ``` --- ### 🌟 專家的小提醒 (考試陷阱) 1. **為什麼要先設 channel-group?** 建議先建立 EtherChannel 再設定 Trunk,這樣配置會自動同步到成員埠(Member Ports)上,比較穩定且不容易出現配置不一致(Mismatch)的問題。 2. **業界標準 (Industry Standard)**: 考試中看到這個詞,就是在考你分不分得出來 **LACP** (標準) 和 **PAgP** (Cisco 私有)。 * **LACP 關鍵字**:Active / Passive * **PAgP 關鍵字**:Desirable / Auto 3. **存檔**: 在 Cisco 考試中,完成任務後一定要輸入 `copy running-config startup-config` 或縮寫 `write memory`。如果沒存檔,系統可能判定為 0 分。 希望這個解析能幫助你順利掌握 EtherChannel 與 Trunk 的配置!如果有任何不清楚的地方,歡迎隨時提問。加油!
简体中文
你好!我是 Cisco 公司的技术专家。很高兴能为你解析这道 CCNA 实验题。 这道题目主要考察的是交换网络中的两个核心技术:**链路聚合 (EtherChannel)** 和 **中继链路 (VLAN Trunking)**。对于刚接触网络的朋友来说,可以把这两个技术想象成“修路”和“交通管制”。 下面我将用最通俗易懂的方式为你拆解每一个任务。 --- ### 💡 核心专业名词解释 在开始解析前,我们先认识几个“专业术语”: 1. **VLAN (虚拟局域网)**:就像把一栋大楼分成不同的房间,每个房间(VLAN)的人默认互不干扰。 2. **Trunk (中继)**:一条可以同时承载多个 VLAN 数据的“公共高速公路”。 3. **802.1q (dot1q)**:这是 Trunk 线路上的一种协议,它会在数据包上贴个“标签”,告诉接收方这个数据是属于哪个 VLAN 的。 4. **EtherChannel (链路聚合)**:把多条物理线路(比如 e0/0 和 e0/1)捆绑成一条逻辑上的“大管子”,这样不仅带宽加倍,而且其中一条线断了,网络也不会掉线。 5. **LACP (链路聚合控制协议)**:这是工业标准协议。题目要求用“工业标准协议”且“立即协商”,指的就是 LACP 的 **Active (主动)** 模式。 --- ### 📝 任务拆解与指令解析 #### 任务 1 & 3:配置 SW-1 与 SW-2 之间的捆绑与中继 **目标**:把 SW-1 和 SW-2 之间的 e0/0 和 e0/1 绑在一起(形成 Po12),并设置为只允许 VLAN 1, 12, 22 通过。 **操作逻辑**: 1. **进入接口范围**:同时选中 e0/0 和 e0/1。 2. **配置捆绑 (LACP)**:使用 `channel-group` 命令,模式选 `active`(代表主动去和对方打招呼协商)。 3. **配置虚拟接口 (Port-channel)**:捆绑成功后,我们会得到一个虚拟接口 `Port-channel 12`。**重点:后续所有的 Trunk 配置都要在这个虚拟接口上做,而不是在物理接口上。** 4. **开启 Trunk**:设置为 trunk 模式,并指定允许的 VLAN。 **指令详解 (以 SW-1 为例)**: ```bash SW-1(config)# interface range e0/0-1 # 选中 e0/0 和 e0/1 这两口 SW-1(config-if-range)# channel-group 12 mode active # 把它们绑成 12 号组,并主动协商 (LACP) SW-1(config-if-range)# interface Port-channel 12 # 进入这个“大管子”虚拟接口 SW-1(config-if)# switchport trunk encapsulation dot1q # 封装 802.1q 协议(给包贴标签) SW-1(config-if)# switchport mode trunk # 正式把这根大管子设为中继模式 SW-1(config-if)# switchport trunk allowed vlan 1,12,22 # 交通管制:只准 VLAN 1, 12, 22 走这 ``` --- #### 任务 2:配置 SW-1 连往 SW-3 的线路 **目标**:把 SW-1 的 e0/2 端口设为 Trunk,且只允许 VLAN 12 和 22。 **操作逻辑**:这是一个简单的单端口 Trunk 配置,不涉及捆绑。 **指令详解**: ```bash SW-1(config)# interface e0/2 # 进入 e0/2 接口 SW-1(config-if)# switchport trunk encapsulation dot1q # 封装协议 SW-1(config-if)# switchport mode trunk # 设为中继模式 SW-1(config-if)# switchport trunk allowed vlan 12,22 # 交通管制:只准 VLAN 12, 22 走这 ``` *注意:这里不需要允许 VLAN 1,严格按照题目要求操作。* --- #### 任务 4:在 SW-2 上完成对应配置 SW-2 的操作与 SW-1 基本一致,主要是针对它连向 SW-1 的那两根线。 **指令详解**: ```bash SW-2(config)# interface range e0/0-1 # 选中连向 SW-1 的两口 SW-2(config-if-range)# channel-group 12 mode active # 同样设为主动捆绑 SW-2(config-if-range)# interface Port-channel 12 SW-2(config-if)# switchport trunk encapsulation dot1q SW-2(config-if)# switchport mode trunk SW-2(config-if)# switchport trunk allowed vlan 1,12,22 ``` --- ### ⚠️ 专家提醒:考试避坑指南 1. **记得保存**:做完所有实验题后,一定要执行 `copy running-config startup-config` 或者简写为 `write memory`。如果不保存,系统可能判定你没做,得分就是 0。 2. **接口名称**:在实际考试中,注意观察接口是 `Ethernet` (e)、`FastEthernet` (fa) 还是 `GigabitEthernet` (gi)。题目参考答案中 SW-2 用了 `GigabitEthernet`,但拓扑图显示是 `e0/0`,请**务必以你实际实验环境中的接口名为准**。 3. **Active 模式**:题目说“立即协商 (immediately negotiate)”,这是 LACP 的 **Active** 模式。如果选 `Passive` (被动),它会一直等别人来找它,就不会“立即”了。 4. **VLAN 限制**:`switchport trunk allowed vlan` 这个命令非常关键,如果漏写了,默认所有 VLAN 都能通过,就不符合题意了。 希望这份解析能帮你顺利掌握这些知识点!加油,祝你 CCNA 考试顺利通过!