Question #1369

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 pre-configurations 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 - Refer to the topology. All physical cabling is in place. Configure local user account, configure a Named ACL (NACL), and Dynamic Arp Inspection. 1. Configure a local account on Sw3 with telnet access only on virtual ports 0-4. Use the following information: o Username: tech12 o Password: load1key o Algorithm type: md5 o Privilege level: Exec mode 2. Configure and apply a NACL on R1 to control network traffic towards ISP: o Name: ISP_ACL o Restrict RFC 1918 class A and B addresses o Allow all other addresses 3. A DHCP IP Pool is preconfigured on R1 for VLAN 5, and DHCP Snooping is configured on Sw2. Configure on Sw2: o Dynamic Arp Inspection for VLAN 5 o Enable validation of the ARP packet destination MAC address o Enable validation of the ARP packet source MAC address o Enable validation of the ARP Packet IP address
English
This is a detailed analysis of a CCNA simulation exam question, designed to help a beginner understand the concepts and configurations involved. --- ### **Overview of the Question Type (Simulation)** This question is a **simulation (SIM)**, which is a practical lab exercise within the exam. Instead of multiple-choice answers, you interact directly with virtual network devices (routers and switches) using their command-line interface (CLI). The goal is to apply your knowledge to configure these devices according to specific tasks. This type of question tests your hands-on skills and understanding of how to implement network configurations. **Key Guidelines for SIMs:** * You are given a network **topology** (diagram). * You receive a list of **tasks** to perform. * You access device consoles (like using PuTTY or SecureCRT in a real lab). * **Pre-configurations** might already be in place, so you only focus on the specified tasks. * Always **save your configurations** to NVRAM (`copy run start` or `write mem`) before moving on, as instructed. --- ### **Topology Analysis** Let's break down the network diagram provided: * **Internet:** Represents the external network. * **R1 (Router 1):** A router, labeled as a "DHCP Server." This means it's responsible for assigning IP addresses automatically to devices on its connected networks. It connects to the Internet via `e0/1` and to `Sw3` via `e0/0`. There's an IP address `209.165.201.0/30` visible on the R1-Internet link. * **Sw3 (Switch 3):** A core switch connecting R1 to access switches (`Sw1`, `Sw2`). It connects to R1 via `e0/0`, to Sw1 via `e0/2`, and to Sw2 via `e0/1`. * **Sw1 (Switch 1):** An access switch connecting to `HostA`. It connects to Sw3 via `e0/2`. The link between Sw1 and Sw3 is labeled "Trunk." * **Sw2 (Switch 2):** Another access switch connecting to `HostB`. It connects to Sw3 via `e0/1`. The link between Sw2 and Sw3 is also labeled "Trunk." * **HostA & HostB:** End devices (computers) connected to Sw1 and Sw2, respectively. **Key Observations:** * **DHCP Server on R1:** R1 provides IP addresses. * **Trunk Links:** The links between Sw3 and Sw1, and Sw3 and Sw2 are configured as "Trunk" links. * **Technical Term: Trunk Link** * A trunk link is a point-to-point link between two switches (or a switch and a router) that carries traffic for multiple Virtual Local Area Networks (VLANs). It uses a tagging protocol like 802.1Q to identify which VLAN each frame belongs to. This is crucial for allowing devices in different VLANs on separate switches to communicate. * **Interface Naming:** Interfaces are labeled `e0/0`, `e0/1`, `e0/2`, etc. (likely FastEthernet or GigabitEthernet interfaces). --- ### **Task 1: Configure a local user account on Sw3** This task involves setting up a user account on Sw3 for secure access, specifically for Telnet. **Technical Terms:** * **Local Account:** A user account stored directly on the device itself (as opposed to an external authentication server like RADIUS or TACACS+). * **Telnet:** An older, insecure network protocol used to provide a bidirectional interactive text-oriented communication facility using a virtual terminal connection. It transmits data in plain text, making it vulnerable to eavesdropping. (For exams, you might still configure it, but in real networks, SSH is preferred for security). * **Virtual Ports (VTY lines):** Virtual Terminal lines. These are logical interfaces that allow remote access (like Telnet or SSH) to the device's command-line interface. Most Cisco devices have a default range, e.g., `vty 0 4` allows 5 concurrent remote sessions. * **Privilege Level:** A numeric value (0-15) that defines the authorization level of a user. * `Privilege 0`: User EXEC mode (very limited commands). * `Privilege 1`: Default user EXEC mode. * `Privilege 15`: Privileged EXEC mode (full access, like entering `enable` mode). * **Exec Mode:** Refers to the Privileged EXEC mode, which is the highest privilege level, allowing access to all commands on the device. * **MD5 (Message Digest 5):** A cryptographic hash function. When used for password storage, it encrypts the password into a hash, which is more secure than storing it in plain text. If someone gains access to the configuration, they won't see the actual password, only its hash. **Requirements Breakdown:** * **Username: tech12** * **Password: load1key** * **Algorithm type: md5:** The password should be stored securely using MD5 hashing. * **Privilege level: Exec mode:** The user `tech12` should have full administrative access (privilege 15). * **Telnet access only on virtual ports 0-4:** Only Telnet should be allowed for remote access on the first five VTY lines, and authentication should use the local database. **Command Explanation (and how they meet requirements):** 1. `Sw3#conf t` * Enters **Global Configuration Mode** (`config t` is shorthand for `configure terminal`). This is where you make system-wide changes. 2. `Sw3(config)#username tech12 privilege 15 secret 5 load1key` * `username tech12`: Creates a user account named `tech12`. * `privilege 15`: Assigns the highest privilege level (Privileged EXEC mode) to this user. * `secret 5 load1key`: Sets the password for `tech12` to `load1key`. The `secret 5` part specifies that the password should be encrypted using the MD5 algorithm (type 5 encryption). This fulfills the "Algorithm type: md5" requirement. Using `secret` is more secure than `password` as `secret` always encrypts, even if `service password-encryption` is not enabled globally. 3. `Sw3(config)#line vty 0 4` * Enters **Line Configuration Mode** for VTY lines 0 through 4. This configures the settings for remote access sessions. 4. `Sw3(config-line)#transport input telnet` * Specifies that **only Telnet** (not SSH or other protocols) is allowed for incoming connections on these VTY lines. This fulfills "telnet access only." 5. `Sw3(config-line)#login local` * Instructs the device to use the **local user database** (the `username tech12` we just created) for authentication when someone tries to connect via Telnet on these VTY lines. --- ### **Task 2: Configure and apply a NACL on R1 to control network traffic towards ISP** This task involves creating an Access Control List (ACL) on Router R1 to filter traffic exiting towards the Internet (ISP). **Technical Terms:** * **Access Control List (ACL):** A sequential list of permit or deny statements that control network traffic based on criteria like source/destination IP addresses, protocols, port numbers, etc. ACLs are applied to router interfaces. * **Named ACL (NACL):** An ACL identified by a descriptive name instead of a number. This improves readability and manageability compared to standard/extended numbered ACLs. * **Extended ACL:** An ACL that can filter traffic based on a wider range of criteria, including source IP, destination IP, protocol (TCP, UDP, ICMP), source port, and destination port. Unlike standard ACLs (which only filter based on source IP), extended ACLs are very versatile. * **RFC 1918 Addresses (Private IP Addresses):** IP address ranges reserved for use in private networks (e.g., within a company or home network). They are not routable on the public Internet. * Class A: `10.0.0.0 - 10.255.255.255` * Class B: `172.16.0.0 - 172.31.255.255` * Class C: `192.168.0.0 - 192.168.255.255` * **Wildcard Mask:** Used with ACLs (and OSPF/EIGRP) to define a range of IP addresses. It's the inverse of a subnet mask. A `0` in a wildcard mask means "match this bit exactly," and a `1` means "this bit doesn't matter." * For `10.0.0.0` with a 24-bit subnet mask (`255.0.0.0`), the wildcard mask for the *entire* Class A range (`10.0.0.0/8`) is `0.255.255.255`. * For `172.16.0.0` to `172.31.255.255` (16-bit subnet mask `255.240.0.0`), the wildcard mask is `0.15.255.255`. * **`deny` statement:** Prevents traffic matching the criteria from passing. * **`permit` statement:** Allows traffic matching the criteria to pass. * **Implicit Deny:** At the end of every ACL, there is an invisible "deny any any" statement. If traffic doesn't match any explicit `permit` statement, it will be denied. This is why you almost always need a `permit ip any any` at the end if you want to allow general traffic. * **`out` direction:** Applying an ACL `out` (outbound) on an interface means the ACL filters traffic *leaving* that interface. **Requirements Breakdown:** * **Name: ISP_ACL:** The ACL should be named `ISP_ACL`. * **Restrict RFC 1918 class A and B addresses:** Block traffic originating from internal private IP addresses (10.0.0.0/8 and 172.16.0.0/12) from leaving R1 towards the Internet. This is a common security practice to prevent private IP addresses from leaking onto the public Internet and to ensure only legitimate, translated public IPs are sent out. * **Allow all other addresses:** Any traffic not explicitly denied (i.e., legitimate public IP traffic) should be allowed. **Command Explanation (and how they meet requirements):** 1. `R1#conf t` * Enters **Global Configuration Mode**. 2. `R1(config)#ip access-list extended ISP_ACL` * Creates a new **Named Extended ACL** named `ISP_ACL`. This fulfills the "Name: ISP_ACL" requirement and specifies it's an extended ACL. 3. `R1(config-ext-acl)#deny ip 10.0.0.0 0.255.255.255 any` * `deny ip`: Denies IP traffic. * `10.0.0.0 0.255.255.255`: Matches any source IP address within the `10.0.0.0/8` (Class A private) range. The wildcard mask `0.255.255.255` means the first octet must be `10`, and the rest can be anything. * `any`: Matches any destination IP address. * This statement denies all traffic originating from the Class A private network. 4. `R1(config-ext-acl)#deny ip 172.16.0.0 0.15.255.255 any` * Denies IP traffic. * `172.16.0.0 0.15.255.255`: Matches any source IP address within the `172.16.0.0/12` (Class B private) range. The wildcard mask `0.15.255.255` means the first two octets must be between `172.16` and `172.31`, and the remaining bits can be anything. * `any`: Matches any destination IP address. * This statement denies all traffic originating from the Class B private network. * Together, these two `deny` statements fulfill "Restrict RFC 1918 class A and B addresses." 5. `R1(config-ext-acl)#permit ip any any` * `permit ip`: Permits IP traffic. * `any any`: Matches any source IP address to any destination IP address. * This is crucial! Without this, the "implicit deny any any" at the end of the ACL would block *all* other traffic, including legitimate Internet traffic. This statement ensures "Allow all other addresses." 6. `R1(config-ext-acl)#exit` * Exits ACL configuration mode. 7. `R1(config)#interface e0/1` * Enters **Interface Configuration Mode** for interface `e0/1`. According to the topology, `e0/1` is the interface connecting R1 to the Internet. 8. `R1(config-if)#ip access-group ISP_ACL out` * Applies the ACL named `ISP_ACL` to interface `e0/1` for **outbound** traffic. This means the ACL will filter traffic as it leaves R1 and goes towards the Internet (ISP). This fulfills "control network traffic towards ISP." 9. `R1(config-if)#exit` * Exits interface configuration mode. --- ### **Task 3: Dynamic ARP Inspection (DAI) Configuration on Sw2** This task focuses on securing the network at Layer 2 (Data Link Layer) against ARP-related attacks using Dynamic ARP Inspection on Sw2. **Technical Terms:** * **DHCP IP Pool:** A range of IP addresses that a DHCP server (R1 in this case) can assign to clients. * **DHCP Snooping:** A security feature on a switch that prevents unauthorized (rogue) DHCP servers from operating on the network and also builds a trusted database of IP-MAC address bindings from legitimate DHCP exchanges. This database is critical for DAI. (Mentioned as preconfigured on Sw2, meaning the switch already trusts specific ports for DHCP communication and has a binding table). * **ARP (Address Resolution Protocol):** A protocol used by the Internet Protocol (IP) to map IP network addresses to the hardware (MAC) addresses used by a data link protocol. When a device wants to send data to another device on the same local network, it uses ARP to find the destination's MAC address from its IP address. * **ARP Spoofing / ARP Poisoning:** An attack where a malicious actor sends forged ARP messages over a local area network. This results in the attacker's MAC address being associated with the IP address of another host (like the default gateway), causing traffic intended for that host to be sent to the attacker instead. * **Dynamic ARP Inspection (DAI):** A security feature that helps prevent ARP spoofing attacks by validating ARP packets. It intercepts ARP requests and responses on untrusted ports and verifies them against the legitimate IP-MAC bindings in the DHCP snooping binding table. If an ARP packet has an invalid IP-MAC binding, DAI discards it. * **VLAN (Virtual Local Area Network):** A logical grouping of network devices, allowing them to communicate as if they were on the same physical segment, regardless of their physical location. DAI is typically configured per VLAN. **Requirements Breakdown:** * **Dynamic Arp Inspection for VLAN 5:** Enable DAI specifically for traffic within VLAN 5. * **Enable validation of the ARP packet destination MAC address:** DAI should check if the destination MAC address in ARP packets is valid. * **Enable validation of the ARP packet source MAC address:** DAI should check if the source MAC address in ARP packets is valid. * **Enable validation of the ARP Packet IP address:** DAI should check if the IP address in ARP packets is valid. **Command Explanation (and how they meet requirements):** 1. `Sw2#conf t` * Enters **Global Configuration Mode**. 2. `Sw2(config)#ip arp inspection vlan 5` * Globally enables **Dynamic ARP Inspection for VLAN 5** on Sw2. This tells Sw2 to start inspecting ARP packets that belong to VLAN 5. This fulfills "Dynamic Arp Inspection for VLAN 5." 3. `Sw2(config)#ip arp inspection validate dst-mac src-mac ip` * Configures the **validation checks** that DAI should perform on ARP packets. * `dst-mac`: Enables validation of the ARP packet's **destination MAC address**. If the destination MAC in the ARP reply doesn't match the destination IP's binding, it's dropped. This fulfills "Enable validation of the ARP packet destination MAC address." * `src-mac`: Enables validation of the ARP packet's **source MAC address**. If the source MAC in the ARP packet doesn't match the source IP's binding, it's dropped. This fulfills "Enable validation of the ARP packet source MAC address." * `ip`: Enables validation of the ARP packet's **IP address**. This checks if the sender IP address in an ARP request/reply is valid according to the DHCP snooping binding table. This fulfills "Enable validation of the ARP Packet IP address." --- ### **Saving Configuration** After completing all tasks, the final crucial step in any simulation question (as per the guidelines) is to save your configurations to NVRAM. `Sw2#write mem` (or `copy running-config startup-config`) This command saves the current running configuration (changes you just made) to the device's Non-Volatile RAM, so they are preserved after a reboot. --- This detailed analysis covers all aspects of the simulation question, breaking down the requirements, explaining technical terms, and linking them directly to the provided configuration commands.
日本語
Cisco技術者として、このCCNA実技試験問題の解説を行います。ネットワーク初心者の方にも分かりやすく、専門用語は都度説明を加えながら進めていきますのでご安心ください。 --- ## CCNA実技試験問題解析 この問題は、ルーターとスイッチの基本的な設定(ユーザーアカウント、アクセスリスト、セキュリティ機能)に関する理解度を試すシミュレーション形式のものです。実際のネットワーク機器を操作するような感覚で、指定されたタスクをコマンドで設定していきます。 ### ネットワークトポロジーの概要 まず、このネットワーク図(トポロジー)を見てみましょう。 * **Internet(インターネット)**: 外部の世界。 * **R1(ルーター)**: インターネットと内部ネットワークを繋ぐ機器です。データが異なるネットワーク間を行き来する際に経路を決定する「交通整理役」のようなものです。ここではDHCPサーバーの機能も持っています。 * **Sw3(スイッチ)**: 複数の機器を接続し、同じネットワーク内でデータを転送する機器です。ここでは複数のアクセススイッチ(Sw1, Sw2)を束ねる役割をしています。 * **Sw1, Sw2(スイッチ)**: ホスト(PCなど)が直接接続されるスイッチです。 * **HostA, HostB(ホスト)**: ネットワークに接続されているPCやサーバーなどのエンドデバイスです。 * **e0/0, e0/1, e0/2**: インターフェース(ポート)の名前です。機器同士をケーブルで繋ぐ「差し込み口」のようなものです。 * **Trunk(トランク)**: 複数のVLAN(後述)のトラフィックを一つの物理リンクで運ぶための設定がされたリンクのことです。 --- ### タスク解析とコマンド解説 それでは、一つずつタスクを見ていきましょう。 --- ### タスク 1: Sw3でのローカルアカウント設定 **目的:** Sw3というスイッチに、特定のユーザー名とパスワードでログインできるように設定します。しかも、Telnetという古い方法でしかログインできないようにし、さらにログインしたらすぐに「最高の権限」で操作できるようにします。 **解説のポイント:** * **ローカルアカウント**: Sw3自身の内部に保存されるユーザー情報のことです。これにより、外部の認証サーバーがなくてもログインできます。 * **Telnet(テルネット)**: ネットワーク経由で他の機器に接続し、コマンドを操作するためのプロトコルの一つです。しかし、通信内容が暗号化されないため、セキュリティ的にはあまり推奨されません(通常はSSHが使われます)。この問題ではTelnetのみ許可するという指定があります。 * **VTY(Virtual Type Terminal)ライン**: スイッチやルーターにネットワーク経由(TelnetやSSH)で接続して操作するための仮想的な回線のことです。`0-4`は同時に5人まで接続できることを意味します。 * **Privilege level(特権レベル)**: ユーザーが実行できるコマンドの権限の度合いを示します。Cisco機器では0から15までのレベルがあり、`15`が最高の権限(特権EXECモード)を意味します。 * **MD5(エムディーファイブ)**: パスワードを暗号化(ハッシュ化)するためのアルゴリズムの一つです。これにより、もし設定ファイルが漏洩してもパスワードが直接読み取られることを防ぎます。 **設定コマンド:** ```cli Sw3#conf t Sw3(config)#username tech12 privilege 15 secret 5 load1key Sw3(config)#line vty 0 4 Sw3(config-line)#transport input telnet Sw3(config-line)#login local ``` **コマンドの説明:** 1. `Sw3#conf t` * `conf t` は `configure terminal` の略で、設定モードに入るコマンドです。ここから機器の設定を変更できます。 2. `Sw3(config)#username tech12 privilege 15 secret 5 load1key` * `username tech12`: `tech12`というユーザー名を作成します。 * `privilege 15`: このユーザーがログインしたときに、最高の権限レベル(特権EXECモード)で操作できるようにします。 * `secret 5 load1key`: `load1key`をパスワードとして設定します。`secret 5`は、このパスワードをMD5アルゴリズムでハッシュ化して保存することを意味し、セキュリティを高めます。 3. `Sw3(config)#line vty 0 4` * `line vty 0 4`: 仮想端末ライン(Telnet/SSH接続用)の設定モードに入ります。ここでは0番から4番までの5つの仮想回線に設定を適用します。 4. `Sw3(config-line)#transport input telnet` * このコマンドは、このVTYラインへの接続を「Telnet」のみに制限します。もし`ssh`と指定すればSSHのみ、`all`と指定すれば両方を許可します。 5. `Sw3(config-line)#login local` * このコマンドは、VTYラインに接続してきたユーザーの認証を、Sw3にローカルで設定されたアカウント情報(`username`コマンドで作成したもの)で行うように指示します。 --- ### タスク 2: R1でのNamed ACL (NACL) 設定と適用 **目的:** R1というルーターで、インターネットに出ていくトラフィックを制御します。具体的には、特定のプライベートIPアドレス(RFC 1918で定義された社内ネットワーク用アドレス)からの通信はインターネットに出さないようにし、それ以外の通信はすべて許可します。 **解説のポイント:** * **ACL(Access Control List / アクセスリスト)**: ネットワークの「門番」のようなもので、特定の条件に合致するデータ(パケット)の通過を許可したり拒否したりするためのルールリストです。 * **Named ACL(名前付きACL)**: ACLに名前を付けることで、管理しやすくしたものです。ここでは`ISP_ACL`という名前を使います。 * **Extended ACL(拡張ACL)**: 送信元IPアドレスだけでなく、宛先IPアドレス、ポート番号、プロトコルなど、より詳細な条件でフィルタリングできるACLです。 * **RFC 1918アドレス**: インターネット上では使用されない、企業や家庭内ネットワークで自由に使えるように予約されたIPアドレスの範囲です。これらがインターネットに直接出てしまうと問題が起きるため、通常はNAT(アドレス変換)を使って変換されます。 * Class A: `10.0.0.0`から`10.255.255.255` * Class B: `172.16.0.0`から`172.31.255.255` * Class C: `192.168.0.0`から`192.168.255.255` * **ワイルドカードマスク**: サブネットマスクの逆のようなもので、「どのビットが一致していればよいか」を指定します。`0`は「ビットが一致すること」、`1`は「ビットはどちらでもよい」を意味します。 * 例: `10.0.0.0 0.255.255.255` は `10.x.x.x` のすべてのIPアドレスを指します。 * 例: `172.16.0.0 0.15.255.255` は `172.16.x.x` から `172.31.x.x` までのIPアドレスを指します。 * **ACLの適用方向(in/out)**: ACLはインターフェースに適用します。 * `in`: インターフェースに「入ってくる」パケットに適用します。 * `out`: インターフェースから「出ていく」パケットに適用します。 今回は内部ネットワークからISPへ向かうトラフィックを制御するため、R1のe0/1インターフェースに対して`out`方向で適用するのが適切です。 * **暗黙のdeny any**: ACLの最後に明示的な`permit`ルールがない場合、ACLの最後に「すべてのパケットを拒否する」という見えないルールが自動的に適用されます。そのため、必要なトラフィックを許可するためには、`permit ip any any`のようなルールを必ず追加する必要があります。 **設定コマンド:** ```cli R1#conf t R1(config)#ip access-list extended ISP_ACL R1(config-ext-acl)#deny ip 10.0.0.0 0.255.255.255 any R1(config-ext-acl)#deny ip 172.16.0.0 0.15.255.255 any R1(config-ext-acl)#permit ip any any R1(config-ext-acl)#exit R1(config)#interface e0/1 R1(config-if)#ip access-group ISP_ACL out R1(config-if)#exit ``` **コマンドの説明:** 1. `R1#conf t` * 設定モードに入ります。 2. `R1(config)#ip access-list extended ISP_ACL` * `ISP_ACL`という名前で、拡張ACLを作成します。 3. `R1(config-ext-acl)#deny ip 10.0.0.0 0.255.255.255 any` * 送信元IPアドレスが`10.x.x.x`(Class Aのプライベートアドレス範囲)のIPパケットはすべて拒否します。`any`は宛先IPアドレスが何でも良いことを意味します。 4. `R1(config-ext-acl)#deny ip 172.16.0.0 0.15.255.255 any` * 送信元IPアドレスが`172.16.x.x`から`172.31.x.x`(Class Bのプライベートアドレス範囲)のIPパケットはすべて拒否します。 5. `R1(config-ext-acl)#permit ip any any` * 上記2つの`deny`ルールにマッチしなかった、すべてのIPパケット(つまり、プライベートIPアドレスではないもの)を許可します。このルールがないと、暗黙の`deny any`によりすべての通信が遮断されてしまいます。 6. `R1(config-ext-acl)#exit` * ACL設定モードから抜けます。 7. `R1(config)#interface e0/1` * R1の`e0/1`インターフェース(インターネット側)の設定モードに入ります。 8. `R1(config-if)#ip access-group ISP_ACL out` * `ISP_ACL`という名前のACLを、このインターフェースから「出ていく」トラフィックに対して適用します。 9. `R1(config-if)#exit` * インターフェース設定モードから抜けます。 --- ### タスク 3: Sw2でのDynamic ARP Inspection (DAI) 設定 **目的:** Sw2というスイッチのVLAN 5で、ARPスプーフィング攻撃を防ぐためのセキュリティ機能であるDynamic ARP Inspection (DAI) を有効にし、ARPパケットの検証を強化します。 **解説のポイント:** * **ARP(Address Resolution Protocol / アドレス解決プロトコル)**: IPアドレス(論理アドレス)から、対応するMACアドレス(物理アドレス)を調べるためのプロトコルです。例えば、PCが通信相手のMACアドレスを知りたいときにARPリクエストを送信し、相手がARPリプライで自分のMACアドレスを教えます。 * **ARPスプーフィング攻撃**: ARPの仕組みの脆弱性を悪用した攻撃です。攻撃者は、偽のARPリプライを送りつけることで、ネットワーク内のPCに「偽のMACアドレスとIPアドレスの対応」を信じ込ませます。これにより、本来の通信経路を乗っ取ったり、通信内容を盗聴したりすることが可能になります。 * **Dynamic ARP Inspection (DAI / ダイナミックARPインスペクション)**: ARPスプーフィング攻撃を防ぐためのセキュリティ機能です。DAIは、通過するARPパケットのIPアドレスとMACアドレスの対応が正しいかどうかを検査し、不正なARPパケットを破棄します。 * **DHCPスヌーピング**: DAIは、通常DHCPスヌーピングと組み合わせて使用されます。DHCPスヌーピングが構築する「DHCPバインディングテーブル」(DHCPサーバーが配布したIPアドレスとMACアドレスの正規の対応表)を参照して、ARPパケットの正当性を判断します。この問題では、DHCPスヌーピングはSw2に「すでに設定されている」とあります。 * **VLAN(Virtual Local Area Network / 仮想LAN)**: 物理的な接続に関係なく、論理的にネットワークを分割する技術です。これにより、ネットワークの管理が容易になり、セキュリティも向上します。ここではVLAN 5でDAIを有効にします。 **設定コマンド:** ```cli Sw2#conf t Sw2(config)#ip arp inspection vlan 5 Sw2(config)#ip arp inspection validate dst-mac src-mac ip ``` **コマンドの説明:** 1. `Sw2#conf t` * 設定モードに入ります。 2. `Sw2(config)#ip arp inspection vlan 5` * `ip arp inspection vlan`: このコマンドで、指定されたVLAN(ここでは`5`)に対してDynamic ARP Inspection(DAI)機能を有効にします。これにより、VLAN 5を流れるARPパケットの検査が始まります。 3. `Sw2(config)#ip arp inspection validate dst-mac src-mac ip` * `ip arp inspection validate`: DAIでARPパケットを検査する際に、どの項目を検証するかを指定します。 * `dst-mac` (Destination MAC address): ARPパケットの宛先MACアドレスが、DHCPスヌーピングのバインディングテーブルと一致するかどうかを検証します。 * `src-mac` (Source MAC address): ARPパケットの送信元MACアドレスが、DHCPスヌーピングのバインディングテーブルと一致するかどうかを検証します。 * `ip` (IP address): ARPパケット内のIPアドレス情報が、DHCPスヌーピングのバインディングテーブルと一致するかどうかを検証します。 これらの検証を有効にすることで、不正なARPパケットがネットワークに広まるのを防ぎ、ARPスプーフィング攻撃から保護します。 --- ### まとめと試験での注意点 これらの設定は、ネットワークの基本的なセキュリティと管理に関する重要な項目です。 * **ローカルアカウント**: 機器へのアクセス管理の基本です。 * **ACL**: ネットワークトラフィックの制御(セキュリティや帯域制御)に不可欠です。 * **DAI**: ARPスプーフィングのようなレイヤー2攻撃からネットワークを守るための重要なセキュリティ機能です。 **試験での注意点:** * **コマンドの正確性**: 一文字の間違いも許されません。正確に入力しましょう。 * **設定モードの理解**: どのコマンドをどのモードで実行するのかを理解していることが重要です。 * **ACLの適用方向**: `in`と`out`、どちらに適用するかは非常に重要です。間違えると意図しない通信がブロックされたり、セキュリティホールになったりします。 * **暗黙のdeny**: ACLの最後に`permit ip any any`を忘れると、すべてがブロックされてしまうので注意が必要です。 * **設定の保存**: タスクの指示にもある通り、設定変更後は必ず`copy running-config startup-config`(または`write memory`)コマンドで設定をNVRAM(不揮発性メモリ)に保存しましょう。これを忘れると、機器が再起動したときに設定が失われてしまいます。 この解説が、ネットワーク学習の助けとなれば幸いです。頑張ってください!
繁體中文
好的,身為 Cisco 技術人員,我很樂意為您詳細解析這個 CCNA 考試題目。我們會用最淺顯易懂的方式,並針對每個專業名詞進行解釋。 --- ## CCNA 實作題解析:網路安全與管理配置 這個考試題目是一個「實作題 (SIMULATION)」,代表您需要在虛擬的設備上進行實際的設定。這是一個很好的練習機會,讓您將學到的理論知識應用到實際操作中。 ### 考試題目概覽 **主要目標:** 根據提供的網路拓撲圖,在指定的網路設備上完成三個主要的配置任務: 1. **本地使用者帳戶配置** (在 Sw3 上) 2. **具名 ACL (Named ACL) 配置與應用** (在 R1 上) 3. **動態 ARP 檢查 (Dynamic ARP Inspection, DAI) 配置** (在 Sw2 上) **重要提醒:** * 所有必要的物理連線和預先配置都已完成。 * 不要更改設備的 `enable` 密碼或主機名稱。 * **務必在完成後將配置儲存到 NVRAM** (非揮發性隨機存取記憶體),否則您的設定將在設備重啟後丟失。 --- ### 網路拓撲圖 (Topology) 解析 首先,我們來看看這個網路拓撲圖,了解各設備的角色和連接方式: * **Internet (網際網路):** 外部網路,代表整個世界的網路。 * **R1 (路由器):** * 連接著 Internet (介面 `e0/1`)。 * 拓撲圖標註它是 `DHCP Server` (DHCP 伺服器),表示它會自動分配 IP 位址給網路中的設備。 * 連接著 Sw3 (介面 `e0/0`)。 * `209.165.201.0/30` 這是連接到 Internet 的網路區段,`/30` 表示一個非常小的子網路,通常用於點對點連線。 * **Sw3 (核心交換器):** * 連接 R1 (介面 `e0/0`)。 * 連接 Sw1 (介面 `e0/2`),連線標註為 `Trunk` (幹線)。 * 連接 Sw2 (介面 `e0/1`),連線標註為 `Trunk` (幹線)。 * 作為一個核心交換器,它負責處理來自其他交換器的流量,並將流量轉發給路由器或目的地。 * **Sw1 (存取層交換器):** * 連接 Sw3 (介面 `e0/2`),連線為 `Trunk`。 * 連接 HostA (介面 `e0/0`)。 * **Sw2 (存取層交換器):** * 連接 Sw3 (介面 `e0/1`),連線為 `Trunk`。 * 連接 HostB (介面 `e0/0`)。 * **HostA / HostB (主機):** 最終用戶設備,例如個人電腦。 **專業名詞解釋:** * **DHCP Server (動態主機配置協定伺服器):** 一種網路伺服器,負責自動分配 IP 位址、子網路遮罩、預設閘道器 (Default Gateway) 等網路配置資訊給連線到網路的設備,省去手動設定的麻煩。 * **Router (路由器):** 網路設備,負責在不同網路之間轉發數據包 (Packet)。它是不同子網路之間的交通警察。 * **Switch (交換器):** 網路設備,在同一個區域網路 (LAN) 內,將數據包從一個連接埠轉發到另一個連接埠,比集線器 (Hub) 更智能高效。 * **Trunk (幹線):** 在交換器之間建立的一種特殊連線,可以承載來自多個 VLAN (虛擬區域網路) 的流量。這對於需要不同 VLAN 資訊在多個交換器間傳輸的環境至關重要。 * **e0/0, e0/1, e0/2 (介面名稱):** 這是網路設備上連接埠的識別名稱,例如 "Ethernet 0/0"。 --- ### 任務解析與配置步驟 接下來,我們逐一解析每個任務,說明為什麼要這樣做,以及每個指令的意義。 #### 任務 1: 在 Sw3 上配置本地使用者帳戶 **目標:** 在 Sw3 上創建一個名為 `tech12` 的本地使用者帳戶,密碼為 `load1key`,使用 MD5 演算法加密,賦予完整管理權限 (Exec mode),並且只允許透過 Telnet 協定在虛擬連接埠 (VTY) 0-4 上進行存取。 **為什麼要這麼做?** 為了網路設備的安全性,我們通常會避免所有人共用一個管理密碼。建立獨立的使用者帳戶,可以追蹤是誰登入了設備,並可以根據不同用戶賦予不同的權限。這裡要求使用 Telnet,雖然 Telnet 是不安全的 (數據未加密),但在某些舊的網路環境或特定考試情境下仍會用到。 **配置解析:** 1. **進入全域配置模式 (Global Configuration Mode):** ``` Sw3#conf t ``` * `conf t` (或 `configure terminal`):這是進入路由器或交換器全域配置模式的命令,您可以在此模式下更改設備的整體設定。 2. **創建本地使用者帳戶並設定權限與密碼:** ``` Sw3(config)#username tech12 privilege 15 secret 5 load1key ``` * `username tech12`: 創建一個名為 `tech12` 的使用者。 * `privilege 15`: 將此使用者的權限等級設定為 `15`。在 Cisco 設備中,`privilege 15` 是最高權限等級,意味著該使用者可以直接進入 `enable` 模式 (也稱為「特權模式」或「執行模式」),擁有對設備的所有配置和監控權限。 * `secret 5 load1key`: 設定使用者 `tech12` 的密碼為 `load1key`。`secret` 比 `password` 更安全,因為它會使用 **MD5 演算法** (`5` 代表 MD5) 對密碼進行加密,儲存在配置檔中是密文,不易被直接讀取。 * **MD5 (Message Digest Algorithm 5):** 一種廣泛使用的雜湊演算法 (Hashing Algorithm),能將任意長度的數據轉換成固定長度的雜湊值。用於密碼儲存時,即使攻擊者獲取了雜湊值,也很難反推出原始密碼。 3. **進入虛擬終端機 (VTY) 配置模式:** ``` Sw3(config)#line vty 0 4 ``` * `line vty 0 4`: 進入配置虛擬終端機介面模式。`VTY` (Virtual Teletype) 介面用於遠端登入設備 (例如 Telnet 或 SSH)。`0 4` 表示從 VTY 線路 0 到 4,總共允許 5 個使用者同時進行遠端連線。 4. **設定只允許 Telnet 連線:** ``` Sw3(config-line)#transport input telnet ``` * `transport input telnet`: 設定這些 VTY 線路只接受 `Telnet` 連線。如果沒有這個指令,預設可能接受所有或不接受任何連線,或者僅接受 SSH (取決於 IOS 版本)。 5. **設定使用本地帳戶資料庫進行身份驗證:** ``` Sw3(config-line)#login local ``` * `login local`: 指示 VTY 線路在使用者嘗試登入時,應使用設備上已配置的本地使用者帳戶資料庫 (即步驟 2 創建的 `username tech12`) 進行身份驗證。 **總結任務 1:** 這一步是為了確保只有授權的管理員才能遠端登入 Sw3 進行管理,並且密碼有經過安全的加密處理。 --- #### 任務 2: 在 R1 上配置與應用具名 ACL (Named ACL) **目標:** 在 R1 上創建一個名為 `ISP_ACL` 的具名延伸 ACL,用來控制發往 ISP 的網路流量: 1. **限制 RFC 1918 Class A 和 Class B 的私有 IP 位址**:不允許這些位址發送到 Internet。 2. **允許所有其他位址**:確保合法流量可以通過。 3. 將此 ACL 應用到 R1 的 `e0/1` 介面,方向為 `out` (出埠)。 **為什麼要這麼做?** 這是網路安全和最佳實踐的一個重要環節。RFC 1918 定義了用於內部網路的**私有 IP 位址** (Private IP Addresses),這些位址在 Internet 上是不可路由的。如果內部網路的設備發出了带有私有 IP 作為源位址的數據包到 Internet,這通常表示網路配置有問題,並且這些數據包將無法到達目的地。在邊界路由器 (R1) 上阻止這些流量,可以避免浪費 Internet 頻寬,並防止可能的網路混亂或安全漏洞。 **專業名詞解釋:** * **ACL (Access Control List, 存取控制列表):** 路由器或交換器上的一組規則,用於過濾數據包。它像一個「交通警察」,可以決定哪些數據包可以通過,哪些數據包應該被阻止。 * **具名 ACL (Named ACL):** 相比於數字 ACL (Numbered ACL),具名 ACL 使用名稱來識別,更易於管理和理解。 * **延伸 ACL (Extended ACL):** 比標準 ACL (Standard ACL) 更精細。標準 ACL 只能根據源 IP 位址過濾,而延伸 ACL 可以根據源 IP、目的 IP、通訊埠號、協定類型等更多資訊進行過濾。 * **RFC 1918 (Request For Comments 1918):** 一份技術文件,定義了 Internet 上不使用的私有 IP 位址範圍。這些位址只能用於私有網路內部。 * **Class A 私有位址:** `10.0.0.0` 到 `10.255.255.255` (即 `10.0.0.0/8`) * **Class B 私有位址:** `172.16.0.0` 到 `172.31.255.255` (即 `172.16.0.0/12`) * Class C 私有位址 (雖未在題目中要求,但通常與前兩者並列): `192.168.0.0` 到 `192.168.255.255` (即 `192.168.0.0/16`) * **Wildcard Mask (萬用字元遮罩):** 與子網路遮罩相反,用於在 ACL 中指定要匹配的 IP 位址的哪些位元。`0` 表示必須匹配,`1` 表示可以不匹配。例如: * `0.255.255.255` 用於匹配 `10.0.0.0/8` (即 `10.x.x.x` 的所有地址)。 * `0.15.255.255` 用於匹配 `172.16.0.0/12` (即 `172.16.x.x` 到 `172.31.x.x` 的所有地址)。 **配置解析:** 1. **進入全域配置模式:** ``` R1#conf t ``` 2. **創建具名延伸 ACL:** ``` R1(config)#ip access-list extended ISP_ACL ``` * `ip access-list extended ISP_ACL`: 創建一個名為 `ISP_ACL` 的「延伸」型 ACL。 3. **阻止 RFC 1918 Class A 私有 IP 位址:** ``` R1(config-ext-acl)#deny ip 10.0.0.0 0.255.255.255 any ``` * `deny ip`: 拒絕所有 `ip` 協定的流量。 * `10.0.0.0 0.255.255.255`: 這是源 IP 位址和對應的萬用字元遮罩。它表示匹配所有 `10.x.x.x` 的 IP 位址。 * `any`: 表示目的 IP 位址可以是任何位址。 * 這條規則表示:**拒絕任何源 IP 位址為 10.x.x.x 的 IP 數據包**,無論其目的地是哪裡。 4. **阻止 RFC 1918 Class B 私有 IP 位址:** ``` R1(config-ext-acl)#deny ip 172.16.0.0 0.15.255.255 any ``` * `172.16.0.0 0.15.255.255`: 匹配所有 `172.16.x.x` 到 `172.31.x.x` 的 IP 位址 (即 `172.16.0.0/12`)。 * 這條規則表示:**拒絕任何源 IP 位址為 172.16.x.x 到 172.31.x.x 的 IP 數據包**。 5. **允許所有其他流量:** ``` R1(config-ext-acl)#permit ip any any ``` * `permit ip any any`: 允許所有 `ip` 協定的流量,源 IP 和目的 IP 都可以是任何位址。 * **極為重要:** ACL 有一個「隱式拒絕」(Implicit Deny) 的規則,即在 ACL 的末尾有一個看不見的 `deny ip any any`。如果沒有這條 `permit ip any any` 規則,那麼除了被明確 `deny` 的流量之外,所有其他流量也都會被阻止!因此,在拒絕特定流量後,通常會加上一條 `permit ip any any` 來放行合法的流量。 6. **退出 ACL 配置模式:** ``` R1(config-ext-acl)#exit ``` 7. **進入 R1 的 `e0/1` 介面配置模式:** ``` R1(config)#interface e0/1 ``` * `e0/1` 是連接 R1 到 Internet 的介面。 8. **將 ACL 應用到介面上,方向為出埠 (outbound):** ``` R1(config-if)#ip access-group ISP_ACL out ``` * `ip access-group ISP_ACL out`: 將名為 `ISP_ACL` 的 ACL 應用到當前介面 (e0/1) 上。`out` 表示這個 ACL 將過濾所有「離開」這個介面 (發往 Internet) 的流量。 9. **退出介面配置模式:** ``` R1(config-if)#exit ``` **總結任務 2:** 這一步是為了增強網路的邊界安全性,防止內部私有 IP 位址的數據包意外洩露到公網上。 --- #### 任務 3: 在 Sw2 上配置動態 ARP 檢查 (Dynamic ARP Inspection, DAI) **目標:** 在 Sw2 上為 VLAN 5 配置 DAI: 1. 啟用 VLAN 5 的 DAI 功能。 2. 啟用對 ARP 數據包的「目的 MAC 位址 (Destination MAC address)」、「源 MAC 位址 (Source MAC address)」和「IP 位址 (IP address)」的驗證。 **為什麼要這麼做?** 這是為了防範 **ARP 欺騙 (ARP Spoofing)** 攻擊,也稱為 **ARP 毒化 (ARP Poisoning)** 或 **中間人攻擊 (Man-in-the-Middle Attack)**。在乙太網 (Ethernet) 環境中,ARP 協定負責將 IP 位址解析為 MAC 位址。攻擊者可以通過發送偽造的 ARP 響應,讓其他設備誤以為攻擊者的 MAC 位址是某個合法設備 (例如預設閘道器) 的 MAC 位址,從而攔截或修改受害者之間的流量。 **專業名詞解釋:** * **ARP (Address Resolution Protocol, 位址解析協定):** 一種網路協定,用於在區域網路中,將 IP 位址轉換為對應的物理 MAC 位址。可以想像成一個「電話簿」,將人名 (IP) 對應到電話號碼 (MAC)。 * **ARP Spoofing (ARP 欺騙):** 一種攻擊手法,攻擊者發送偽造的 ARP 消息,讓網路上的其他設備誤讀了 IP 到 MAC 的映射關係,從而將數據包發送到攻擊者而非真正的目的地。 * **DAI (Dynamic ARP Inspection, 動態 ARP 檢查):** 一種交換器安全功能,通過檢查 ARP 數據包的有效性來防止 ARP 欺騙攻擊。DAI 會對 ARP 請求和響應進行驗證,確保 IP-MAC 綁定是合法的。 * **DHCP Snooping (DHCP 偵測):** DAI 的一個重要前提。當 DHCP Snooping 在交換器上啟用時,交換器會監聽 DHCP 流量,並建立一個「DHCP Snooping 綁定表」。這個表記錄了每個端口上合法分配的 IP-MAC-VLAN 映射關係。DAI 會使用這個表來驗證 ARP 數據包的合法性。題目中提到「DHCP IP Pool is preconfigured on R1 for VLAN 5, and DHCP Snooping is configured on Sw2」,這表示 DAI 已經有了它需要的「合法清單」。 * **VLAN (Virtual Local Area Network, 虛擬區域網路):** 將一個物理網路邏輯上劃分成多個獨立的廣播域。不同 VLAN 的設備即使在同一個物理交換器上,也無法直接通訊,需要透過路由器。 **配置解析:** 1. **進入全域配置模式:** ``` Sw2#conf t ``` 2. **為 VLAN 5 啟用 DAI:** ``` Sw2(config)#ip arp inspection vlan 5 ``` * `ip arp inspection vlan 5`: 為指定的 VLAN (這裡為 `VLAN 5`) 啟用 DAI 功能。交換器將開始監控和驗證所有來自這個 VLAN 的 ARP 數據包。 3. **配置 DAI 的驗證規則:** ``` Sw2(config)#ip arp inspection validate dst-mac src-mac ip ``` * `ip arp inspection validate`: 配置 DAI 的驗證選項。 * `dst-mac`: **驗證目的地 MAC 位址**。檢查 ARP 數據包中的目標 MAC 位址是否與乙太網幀頭中的目的地 MAC 位址匹配 (主要針對 ARP 回覆)。 * `src-mac`: **驗證來源 MAC 位址**。檢查 ARP 數據包中的發送者 MAC 位址是否與乙太網幀頭中的來源 MAC 位址匹配。 * `ip`: **驗證 IP 位址**。檢查 ARP 數據包中的 IP 位址是否有效 (例如,不是無效的 IP 或廣播 IP),並且更重要的是,是否與 DHCP Snooping 綁定表中的合法 IP-MAC 映射一致。如果一個 ARP 數據包中的 IP-MAC 對不在 DHCP Snooping 綁定表中,或者與表中的資訊不符,DAI 就會認為它是非法的並丟棄它。 **總結任務 3:** 這一步是為了保護網路免受 ARP 欺騙攻擊,確保網路中的 IP 位址與 MAC 位址的映射關係是真實可靠的。 --- ### 最終步驟:儲存配置 完成所有任務後,**非常重要的一步**就是將您的配置儲存到 NVRAM 中,以確保設備重啟後,設定不會丟失。 **儲存指令 (在特權模式下):** ``` Sw3#copy running-config startup-config Sw3#write memory ``` * 這兩個指令的作用相同:將當前運行中的配置 (running-config) 複製到啟動配置 (startup-config)。啟動配置儲存在 NVRAM 中,設備每次重啟時都會從這裡載入設定。 * 對於 R1 和 Sw2,您也需要執行相同的儲存操作。 --- ### 總結 這個實作題涵蓋了 CCNA 級別的三個關鍵網路概念和配置技能: 1. **使用者帳戶管理:** 學習如何安全地控制設備的遠端管理權限。 2. **ACLs (存取控制列表):** 掌握如何使用 ACL 過濾流量,實現基本的網路安全策略。 3. **Layer 2 安全特性 (DAI):** 理解並配置交換器的高級安全功能,以防範常見的區域網路攻擊。 希望這份詳細的解析能幫助您深入理解這些概念和配置步驟!如果您在實作過程中遇到任何問題,或對某些概念仍有疑問,隨時可以提出。
简体中文
好的,作为Cisco的专业技术人员,我将针对这道CCNA考试中的实作题(Simulation)进行详细解析。我会用大家都能听懂的方式,一步一步拆解题目,并对其中涉及的专业名词进行解释。 --- # CCNA 实作题解析:用户账户、ACL 和 DAI 配置 ## 总览 (Overview) 这道题目是一道典型的 **实作题 (Simulation)**,意味着你需要像在真实网络设备上一样,通过命令行界面 (CLI) 进行配置。这类题目主要考察你对Cisco设备的基本配置能力,包括用户管理、网络访问控制和安全特性。 **考察重点:** 1. **设备管理与安全:** 配置本地用户账户和VTY线路访问控制。 2. **网络访问控制:** 配置命名扩展型访问控制列表 (Named Extended ACL)。 3. **网络安全特性:** 配置动态ARP检测 (Dynamic ARP Inspection, DAI)。 **难度:** 中等偏上。需要对Cisco IOS命令语法有较好的掌握,并理解这些功能背后的网络原理。 ## 拓扑解析 (Topology Analysis) 首先,我们来理解一下这张网络拓扑图,它是我们进行配置的基础。 ![Network Topology](image.png) * **Internet (互联网):** 代表外部公共网络。 * **R1 (路由器):** * **功能:** 连接内部网络和Internet,同时也是 **DHCP Server**(动态主机配置协议服务器),负责给内部网络中的设备分配IP地址。 * **接口 e0/1:** 连接到 Internet,IP地址段为 `209.165.201.0/30`。 `/30` 表示这是一个非常小的子网,通常用于点对点连接。 * **接口 e0/0:** 连接到我们的核心交换机 Sw3。 * **Sw3 (核心交换机):** * **功能:** 连接路由器 R1 和下方的接入层交换机 Sw1、Sw2。通常负责处理核心流量。 * **接口 e0/0:** 连接到 R1。 * **接口 e0/1, e0/2:** 连接到 Sw1 和 Sw2。这些链路被标记为 `Trunk` (干道)。 * **专业名词解释:Trunk (干道) 链路** * 一条干道链路可以承载多个 **VLAN (虚拟局域网)** 的流量。想象一下,如果一个公司有不同的部门(每个部门一个VLAN),但他们都通过同一根线缆连接到中央交换机,那么这根线缆就是干道。干道通过给数据包打上“VLAN标签”来区分不同VLAN的流量。 * **Sw1, Sw2 (接入交换机):** * **功能:** 连接终端用户设备 HostA 和 HostB。通常在网络的边缘,直接为用户提供服务。 * **接口 e0/2 (Sw1) 和 e0/1 (Sw2):** 通过 `Trunk` 链路连接到 Sw3。 * **接口 e0/0 (Sw1) 和 e0/0 (Sw2):** 连接到终端主机 HostA 和 HostB。 * **HostA, HostB (主机):** * **功能:** 终端用户设备,比如电脑、服务器等,它们需要从DHCP服务器 (R1) 获取IP地址来访问网络。 **理解了拓扑,我们就能知道哪个设备连接到哪里,以及它们各自的角色。这对于正确配置至关重要。** ## 任务解析 (Task Analysis) 现在我们逐项解析每个任务的具体要求和实现方式。 ### 任务 1: 在 Sw3 上配置本地用户账户 **要求:** 在 Sw3 上配置一个本地用户账户,只允许通过 Telnet 访问虚拟端口 0-4。 * 用户名:`tech12` * 密码:`load1key` * 加密算法:`md5` * 权限级别:`Exec mode` (执行模式,最高权限) **目的:** 为了安全地管理网络设备,我们需要限制谁可以登录设备,以及登录后他们能执行什么操作。通过配置本地用户账户,并限制其访问方式和权限,可以提高设备的安全性。 **专业名词解释:** * **Telnet (远程登录协议):** 一种用于远程登录和管理设备的网络协议。**注意:** Telnet 是不安全的,因为它以明文传输用户名和密码,容易被截获。在实际生产环境中,我们通常使用更安全的 **SSH (安全外壳协议)**。但题目要求使用Telnet,所以我们照做。 * **虚拟端口 (VTY Lines):** 虚拟终端线路,用于远程管理设备(如通过Telnet或SSH)。`vty 0 4` 表示可以同时有 5 个远程连接。 * **MD5 (消息摘要算法 5):** 一种加密算法,用于将密码转换为一个固定长度的散列值(哈希值)。即使攻击者获取到散列值,也很难逆推出原始密码,从而提高密码安全性。 * **Exec mode (执行模式):** Cisco设备的用户界面模式之一。`privilege 15` 代表最高权限,可以在设备上执行所有命令。`privilege 0` 是最低权限,只能执行一些基本命令。 **参考命令解析:** ``` Sw3#conf t // 进入全局配置模式 (Global Configuration Mode)。 // 'conf t' 是 'configure terminal' 的缩写。 Sw3(config)#username tech12 privilege 15 secret 5 load1key // 创建一个名为 'tech12' 的本地用户。 // 'privilege 15' 赋予该用户最高权限,允许他执行所有命令(即进入特权执行模式)。 // 'secret 5 load1key' 设置密码为 'load1key'。 // 'secret' 关键字表示密码会使用 MD5 算法进行加密存储 (类型 5)。 // 如果使用 'password' 关键字,密码会以较弱的加密方式(类型 7)或明文存储,安全性较低。 Sw3(config)#line vty 0 4 // 进入虚拟终端线路 0 到 4 的配置模式。 // 这表示允许有 5 个同时的远程连接。 Sw3(config-line)#transport input telnet // 指定这些 VTY 线路只允许接受 Telnet 协议的远程连接。 // 如果不配置这一行,默认可能支持 Telnet 和 SSH,或者都不支持,具体取决于IOS版本。 Sw3(config-line)#login local // 告诉 VTY 线路在用户尝试登录时,使用设备的本地用户数据库进行身份验证。 // 这样,只有我们刚才创建的 'tech12' 用户才能成功登录。 ``` ### 任务 2: 在 R1 上配置和应用命名 ACL **要求:** 在 R1 上配置并应用一个命名 ACL (NACL),控制流向 ISP 的网络流量。 * 名称:`ISP_ACL` * 限制 RFC 1918 的 A 类和 B 类地址 * 允许所有其他地址 **目的:** ACL (Access Control List) 访问控制列表,就像是网络中的“交通警察”,用来过滤网络流量,决定哪些数据包可以被转发,哪些应该被丢弃。这个任务是为了增强网络安全性,防止内部网络中不合法的私有IP地址(RFC 1918地址)的数据包泄露到公共的Internet上。 **专业名词解释:** * **NACL (Named Access Control List) 命名访问控制列表:** ACL的一种类型。与数字ACL相比,命名ACL使用一个描述性的名称(如`ISP_ACL`),更易于阅读和管理。 * **Extended ACL (扩展访问控制列表):** ACL的另一个类型。它比标准ACL更强大,可以基于源IP地址、目的IP地址、协议类型(TCP、UDP、ICMP等)和端口号等更多条件来过滤流量。标准ACL只能基于源IP地址。 * **RFC 1918 私有地址:** 由IETF (Internet Engineering Task Force) 在RFC 1918文档中定义的,用于内部网络,不能直接在Internet上路由的IP地址范围。它们是: * **A 类:** `10.0.0.0` 到 `10.255.255.255` (即 `10.0.0.0/8`) * **B 类:** `172.16.0.0` 到 `172.31.255.255` (即 `172.16.0.0/12`) * **C 类:** `192.168.0.0` 到 `192.168.255.255` (即 `192.168.0.0/16`) 题目要求限制 A 类和 B 类地址。 * **通配符掩码 (Wildcard Mask):** 与子网掩码相反,通配符掩码中 `0` 表示必须匹配,`1` 表示可以任意。 * `10.0.0.0 0.255.255.255`:匹配 `10.xxx.xxx.xxx` 的所有地址。`0.255.255.255` 的二进制是 `00000000.11111111.11111111.11111111`,表示第一个八位字节必须是0,后面三个八位字节可以是任意值。 * `172.16.0.0 0.15.255.255`:匹配 `172.16.0.0` 到 `172.31.255.255` 的所有地址。`0.15.255.255` 的二进制是 `00000000.00001111.11111111.11111111`,表示第一个八位字节必须是0,第二个八位字节的后4位是任意值(所以16到31),后面两个八位字节是任意值。 **参考命令解析:** ``` R1#conf t // 进入全局配置模式。 R1(config)#ip access-list extended ISP_ACL // 创建一个名为 'ISP_ACL' 的扩展型 ACL。 // 'extended' 关键字是指定它为扩展型 ACL。 R1(config-ext-acl)#deny ip 10.0.0.0 0.255.255.255 any // ACL 规则 1:拒绝源 IP 地址属于 10.0.0.0/8 网段(即 A 类私有地址)的所有 IP 流量,去往任何目的地 ('any')。 R1(config-ext-acl)#deny ip 172.16.0.0 0.15.255.255 any // ACL 规则 2:拒绝源 IP 地址属于 172.16.0.0/12 网段(即 B 类私有地址)的所有 IP 流量,去往任何目的地 ('any')。 R1(config-ext-acl)#permit ip any any // ACL 规则 3:允许所有其他 IP 流量,源 IP 是任何地址 ('any'),目的 IP 也是任何地址 ('any')。 // !!! 这条命令非常关键 !!! // ACL 有一个**隐含的“拒绝所有” (implicit deny any any)** 规则。这意味着如果你不明确允许某些流量,它就会被默认拒绝。 // 如果没有这条 'permit ip any any',那么除了前面被明确拒绝的 RFC 1918 地址之外,所有其他合法的公共IP地址的流量也会被拒绝,导致所有设备都无法访问Internet。 R1(config-ext-acl)#exit // 退出 ACL 配置模式。 R1(config)#interface e0/1 // 进入 R1 路由器的 e0/1 接口配置模式。这个接口是连接到 Internet 的。 R1(config-if)#ip access-group ISP_ACL out // 将名为 'ISP_ACL' 的 ACL 应用到 e0/1 接口的 **出站 (outbound)** 方向。 // 'out' 表示 ACL 将检查从路由器离开此接口、流向 Internet 的数据包。 // 如果是 'in',则表示检查进入此接口、流向路由器内部的数据包。 // 我们的目的是阻止私有IP地址流向Internet,所以应该在出站方向应用。 R1(config-if)#exit // 退出接口配置模式。 ``` ### 任务 3: 在 Sw2 上配置动态 ARP 检测 (DAI) **要求:** DHCP IP 池已在 R1 上为 VLAN 5 配置,DHCP Snooping 已在 Sw2 上配置。 在 Sw2 上配置: * 为 VLAN 5 配置动态 ARP 检测 (Dynamic Arp Inspection, DAI)。 * 启用对 ARP 数据包的目的 MAC 地址验证。 * 启用对 ARP 数据包的源 MAC 地址验证。 * 启用对 ARP 数据包的 IP 地址验证。 **目的:** 防止 **ARP 欺骗 (ARP Spoofing)** 攻击。ARP欺骗是一种常见的局域网攻击手段,攻击者通过发送伪造的ARP应答包,使得其他设备误以为攻击者的MAC地址对应着某个合法IP地址(比如网关的IP地址),从而劫持网络流量。DAI 通过验证 ARP 数据包的合法性来阻止这种攻击。 **专业名词解释:** * **ARP (Address Resolution Protocol) 地址解析协议:** 用于将IP地址解析为MAC地址。当一台设备想和另一台设备通信时,如果只知道对方的IP地址,就需要通过ARP来获取对方的MAC地址。 * **DHCP Snooping (DHCP 侦听):** 一种交换机安全功能,它能够“侦听”DHCP流量,并维护一个 **DHCP 绑定表 (DHCP Binding Table)**。这个绑定表记录了每个合法设备的MAC地址、分配到的IP地址、租期和VLAN信息。DAI 会利用这个绑定表来验证ARP数据包的合法性。题目说已经配置了DHCP Snooping,所以DAI才能工作。 * **DAI (Dynamic ARP Inspection) 动态 ARP 检测:** 交换机安全功能,通过检查所有流经交换机的 ARP 数据包,并与 DHCP 绑定表进行比对,来验证 ARP 数据包的合法性。如果 ARP 包中的信息(如MAC地址、IP地址)与绑定表不符,或者来自不受信任的端口,DAI就会丢弃这个 ARP 包。 * **VLAN 5:** 虚拟局域网5。DAI通常是在VLAN级别启用的。 **参考命令解析:** ``` Sw2#conf t // 进入全局配置模式。 Sw2(config)#ip arp inspection vlan 5 // 在 Sw2 上为 VLAN 5 启用动态 ARP 检测 (DAI)。 // 这告诉交换机,对于 VLAN 5 中的所有 ARP 流量,都要进行 DAI 检查。 Sw2(config)#ip arp inspection validate dst-mac src-mac ip // 配置 DAI 的验证规则。这条命令告诉 DAI 在验证 ARP 数据包时,需要检查以下信息: // * **dst-mac (目的 MAC 地址):** 验证 ARP 包中的目的 MAC 地址是否与该 IP 地址对应的合法 MAC 地址匹配。 // * **src-mac (源 MAC 地址):** 验证 ARP 包中的源 MAC 地址是否与源 IP 地址对应的合法 MAC 地址匹配。 // * **ip (IP 地址):** 验证 ARP 包中的 IP 地址是否与 DHCP 绑定表中的记录匹配(即 IP 地址是否合法)。 // 结合 DHCP Snooping,DAI 会根据 DHCP 绑定表来检查这些 MAC-IP 对应关系是否合法。 // 如果一个 ARP 包中的信息与绑定表不符,或者它来自一个未配置为“信任 (trusted)”端口的设备,DAI 将会丢弃这个 ARP 包,从而阻止 ARP 欺骗。 ``` --- ## 总结与学习建议 (Summary & Learning Advice) 1. **仔细审题,理解意图:** 每一步操作都有其目的。理解“为什么”要这么做,比死记硬背命令更重要。 2. **熟悉拓扑:** 清楚每个设备的角色和连接关系,才能正确选择在哪里、哪个接口上应用配置。 3. **掌握核心命令:** CCNA考试中常用的配置命令及其参数(例如 ACL 的 `deny/permit` 规则、通配符掩码,DAI 的 `validate` 选项等)需要熟练掌握。 4. **理解原理:** * ACL 的隐含 `deny any any` 规则至关重要。 * DAI 依赖于 DHCP Snooping 来构建绑定表。 * VTY 线路上配置 `login local` 和 `transport input` 的作用。 5. **动手实践:** 多在 Packet Tracer 或 GNS3 等模拟器上进行配置练习。这是掌握这些技能的最好方式。 6. **保存配置:** 在实作题中,完成所有配置后,务必执行 `copy running-config startup-config` (或 `write memory`) 命令,将配置保存到设备的 NVRAM 中,否则设备重启后配置会丢失。题目指南中也明确强调了这一点。 7. **检查配置:** 完成配置后,可以使用 `show` 命令来验证你的配置是否正确生效(例如 `show running-config`、`show access-lists`、`show ip arp inspection` 等)。 希望这份详细的解析能帮助你更好地理解和掌握这些CCNA的核心知识点!祝你考试顺利!