CCNA 講義



Similar documents
Cisco Cisco Cisco (ROM) (FLASH) (RAM) RAM(NVRAM) Cisco

mppp-ddr.pdf

ch08.PDF

D E 答 案 :C 3. 工 作 站 A 配 置 的 IP 地 址 为 /28. 工 作 站 B 配 置 的 IP 地 址 为 /28. 两 个 工 作 站 之 间 有 直 通 线 连 接, 两 台

Microsoft Word - CCNA2_Exploration_instructor_40_CoverSheet.DOC

12.pdf

F5270

epub

IP505SM_manual_cn.doc

Procedural Lab Template, Student Version, Required Components

Simulator By SunLingxi 2003

TCP/IP TCP/IP OSI IP TCP IP IP TCP/IP TCP/IP

AL-M200 Series

版权声明

一、选择题

課程大綱

IP-Routing-05.pdf

GPRS IP MODEM快速安装说明

ebook140-8

工程师培训

通过动态路由协议实现链路备份

R3105+ ADSL

ebook140-9

財金資訊-80期.indd

¶C¶L§§¬_™¨ A.PDF

ebook20-8

计算机网络概论

IS-IS路由协议中文教程v1

Symantec™ Sygate Enterprise Protection 防护代理安装使用指南

ebook20-7

ARP ICMP

SL2511 SR Plus 操作手冊_單面.doc

一.NETGEAR VPN防火墙产品介绍

02.实验二:虚拟局域网与VLAN间通信

Chapter 2

IP Access Lists IP Access Lists IP Access Lists

两个串行接口上通过虚拟模板的多链路

《计算机网络》实验指导书

IC-900W Wireless Pan & Tilt Wireless Pan & Tilt Remote Control / Night Vision FCC ID:RUJ-LR802UWG

untitled

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

第3章

飞鱼星多WAN防火墙路由器用户手册

(UTM???U_935_938_955_958_959 V )

ebook140-11

AL-MX200 Series

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

P4i45GL_GV-R50-CN.p65


Windows RTEMS 1 Danilliu MMI TCP/IP QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos eco

ARM JTAG实时仿真器安装使用指南

第 11 章 互聯網技術 11.1 互聯 網 和 萬 維 網 的 發 展 歷 史 A. 互聯網的發展 互聯網是由 ARPANET 開 始發展的 1969 年 美國國防部高級研究計劃署 (ARPA) 把部分軍事研究所和大 的電腦連接起來 建造了㆒個實驗性的電腦網絡 稱為 ARPANET 並 列 的功能

Serial ATA ( Silicon Image SiI3114)...2 (1) SATA... 2 (2) B I O S S A T A... 3 (3) RAID BIOS RAID... 5 (4) S A T A... 8 (5) S A T A... 10

ansoft_setup21.doc

Windows 2000 Server for T100

BYOD Http Redirect convergence Client (1) 2008R2 NLB( ) (2) NLB Unicast mode switch flooding (arp ) NLB DNS Redirect 1. Round-Robin DNS DNS IP/DNS Cli


epub 30-12

PTS7_Manual.PDF

Guide to Install SATA Hard Disks

局域网技术课程设计报告.doc

ebook71-13

Bus Hound 5

穨CAS1042快速安速說明.doc

ext-web-auth-wlc.pdf

自由軟體教學平台

KL DSC DEMO 使用说明

自由軟體教學平台

1 o o o CPU o o o o o SQL Server 2005 o CPU o o o o o SQL Server o Microsoft SQL Server 2005

实 验 一 双 绞 线 的 制 作 目 的 要 求 1 了 解 非 屏 蔽 双 绞 线 制 作 的 相 关 标 准 2 掌 握 在 各 种 应 用 环 境 下 非 屏 蔽 双 绞 线 的 作 用 与 制 作 3 掌 握 网 线 线 缆 测 试 仪 的 使 用 实 验 设 备 压 线 钳 测 线 仪

自由軟體教學平台

專業式報告

QL1880new2.PDF

K7VT2_QIG_v3

升 级 过 程 概 述 Cisco 集 中 无 线 网 络 架 构 中,AP 工 作 在 瘦 AP(LAP) 模 式 LAP 关 联 到 无 线 控 制 器 (WLC), 控 制 器 管 理 着 配 置 软 件 升 级 以 及 802.1X 认 证 等 控 制 处 理 ; 此 外, 控 制 器 还

网工新答案

Exam1

穨CAS1042中文手冊.doc

Windows XP

untitled

專業式報告

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

Microsoft Word - Che2_Lab_ _Config-Basic-Router-CLI-Students.doc

第 1 章 概 述 1.1 计 算 机 网 络 在 信 息 时 代 中 的 作 用 1.2 计 算 机 网 络 的 发 展 过 程 *1.2.1 分 组 交 换 的 产 生 *1.2.2 因 特 网 时 代 *1.2.3 关 于 因 特 网 的 标 准 化 工 作 计 算 机 网 络 在

注意 :CCNA 动手实验所用的路由器是采用 Cisco IOS Release 15.2(4)M3(universalk9 映像 ) 的 Cisco 1941 集成多业务路由器 (ISR) 所用的交换机是采用 Cisco IOS Release 15.0(2)(lanbasek9 映像 ) 的 C

C3_ppt.PDF

P4VM800_BIOS_CN.p65

68369 (ppp quickstart guide)

Microsoft Word - lab2_4.doc

第 1 部 分 : 检 查 网 络 要 求 在 第 1 部 分 中, 您 将 研 究 使 用 /17 网 络 地 址 为 拓 扑 图 中 显 示 的 网 络 开 发 VLSM 地 址 方 案 的 网 络 要 求 注 意 : 您 可 以 使 用 Windows 计 算 器 应

UDP 8.2 TCP/IP OSI OSI 3 OSI TCP/IP IP TCP/IP TCP/IP Transport Control Protocol TCP User Datagram Protocol UDP TCP TCP/IP IP TCP TCP/IP TC

Ác Åé å Serial ATA ( Sil3132) S A T A (1) SATA (2) BIOS SATA (3)* RAID BIOS RAID (4) SATA (5) SATA (a) S A T A ( S A T A R A I D ) (b) (c) Windows XP

Packet Tracer实验集

管理CISCO IOS

ebook 175-1

ICD ICD ICD ICD ICD

SAPIDO GR-1733 無線寬頻分享器

第3章 计算机网络体系结构

第4章网络层_2_.doc

Transcription:

CCNA 筆 記 王 振 民 目 錄 第 1 章 Packet Tracer 的 使 用... 2 第 1 節 安 裝... 2 第 2 節 建 置 網 路 環 境 _01( 二 台 PC+ 一 台 HUB)... 8 第 3 節 Pc 的 設 定 :IP, cmd...... 10 第 4 節 傳 送 封 包 (ICMP 封 包 檢 視...)... 13 第 2 章 基 礎 知 識... 14 第 1 節 開 機 流 程... 14 第 2 節 不 同 的 模 式... 16 第 3 節 密 碼 忘 了, 怎 麼 辦?... 18 第 3 章 Router 與 Switch 的 基 本 管 理... 22 第 1 節 基 本 的 操 作... 22 第 2 節 Router 與 Switch 的 管 理 性 組 態... 24 第 3 節 顯 示 系 統 設 定 的 狀 態... 33 第 4 章 管 理 cisco 路 由 器... 42 第 1 節 基 本 說 明... 42 第 5 章 IP 遶 送... 49 第 1 節 遶 送 基 礎... 49 第 2 節 Router 的 路 由 表... 51 第 3 節 IP 遶 送 的 進 階 練 習... 53 第 4 節 靜 態 路 由... 65 第 6 章 動 態 路 由... 74 第 1 節 常 見 路 由 協 定... 74 第 2 節 管 理 性 距 離 -AD... 75 第 3 節 RIP... 77 第 4 節 EIGRP... 86 第 5 節 OSPF... 101 第 7 章 交 換 與 擴 展 樹 協 定... 114 第 1 節 SWITCH 快 速 設 定 筆 記... 114 第 2 節 基 本 概 念... 114 第 3 節 Spanning Tree Protocol- 擴 展 樹 協 定... 121 參 考 書 目... 125 王 振 民 2013.06.22 1 CCNA 筆 記

第 1 章 Packet Tracer 的 使 用 學 習 Cisco 的 過 程 中, 我 覺 得 這 些 指 令 不 難, 難 的 是 觀 念 以 及 學 習 的 環 境, 以 我 自 己 為 例, 之 前 學 習 的 困 難 處 就 是 沒 有 設 備 能 實 際 操 作, 而 且,Cisco 的 設 備 不 便 宜, 尤 其 我 們 需 要 完 整 的 網 路 環 境 來 練 習, 又 不 只 是 一 台 二 台 就 能 建 置 足 夠 的 環 境, 因 此, 最 常 的 做 法 就 是 利 用 模 擬 器 來 學 習, 網 路 上 有 其 它 幾 套 模 擬 器 都 不 錯, 而 Packet Tracer 這 套 工 具 軟 體 是 Cisco 出 廠 的, 可 以 提 供 我 們 良 好 的 學 習 環 境 有 了 Packet Tracer 這 套 軟 體, 我 想 信, 很 快 的 你 也 可 以 跨 入 到 Cisco 領 域 裡 第 1 節 安 裝 1. 雙 按 Packet Tracer 程 式 王 振 民 2013.06.22 2 CCNA 筆 記

2. 選 擇 I accept the agreement, 按 Next 3. 使 用 預 設 的 路 徑 即 可, 按 Next 即 可 王 振 民 2013.06.22 3 CCNA 筆 記

4. 這 是 在 程 式 集 裡 的 名 稱, 也 是 以 預 設 值 即 可, 請 按 Next 5. 我 勾 選 這 二 項, 安 裝 完 成 後, 會 在 桌 面 及 快 捷 列 顯 示 Packet Tracer 的 徢 徑 王 振 民 2013.06.22 4 CCNA 筆 記

6. 按 Install 開 始 安 裝 7. 這 是 安 裝 的 過 程, 請 稍 候 王 振 民 2013.06.22 5 CCNA 筆 記

8. 安 裝 完 成, 按 Finish 時 會 同 時 啟 動 Packet Tracer 9. 第 一 次 執 行 時 會 顯 示 以 下 對 話 框, 當 我 們 將 Packet Tracer 所 建 立 的 模 擬 環 境 進 行 儲 存 動 作 時, 會 有 一 個 預 設 的 儲 存 目 錄, 這 個 目 錄 是 可 以 修 改 的 日 後 可 以 執 行 Options/Preferences, 重 新 指 定 預 設 的 儲 存 路 徑 10. 如 果 系 統 有 開 啟 防 火 牆, 就 會 顯 示 以 下 的 安 全 性 警 訊, 請 按 解 除 封 鎖 王 振 民 2013.06.22 6 CCNA 筆 記

11. 這 就 是 Packet Tracer 的 畫 面 先 認 識 一 下 應 用 軟 體 的 基 本 環 境 ( 功 能 表 工 具 列 工 作 區 設 備 區...) 王 振 民 2013.06.22 7 CCNA 筆 記

第 2 節 建 置 網 路 環 境 _01( 二 台 PC+ 一 台 HUB) 1. 先 由 左 下 方 的 設 備 區 拉 出 二 台 電 腦 2. 再 拉 出 一 台 switch, 任 何 一 個 都 可 以 3. 接 著 點 選 Connections 裡 的 Copper Straight-Through 王 振 民 2013.06.22 8 CCNA 筆 記

4. 在 PC0 點 一 下, 選 擇 FastEthernet 5. 在 switch 這 裡 再 點 一 次, 選 擇 任 何 一 個 port, 完 成 時, 就 等 於 用 網 路 線 將 PC0 與 switch 連 接 起 來 了 6. 同 樣 的 動 作 再 做 一 次, 由 PC1 連 接 到 switch 之 前 已 經 用 掉 的 port 在 這 裡 就 不 會 看 到 了 7. 完 成 二 台 PC 與 一 台 switch 的 超 小 型 網 路 環 境 王 振 民 2013.06.22 9 CCNA 筆 記

第 3 節 Pc 的 設 定 :IP, cmd... 前 述 動 作 是 模 擬 實 體 的 環 境 建 置, 接 下 來, 要 針 對 不 同 的 設 備 做 相 關 的 網 路 設 定 1. 點 選 PC0, 會 看 到 以 下 的 對 話 框 在 Physical 頁 籤 看 到 的 PC0 的 模 擬 狀 置, 那 個 電 源 按 鈕 是 有 作 用 的 哦! 除 了 可 以 開 機 關 機 之 外, 左 方 還 提 供 不 同 的 模 組, 請 隨 意 試 試 看 這 裡 的 操 作 2. 點 選 Config 頁 籤, 這 裡 可 以 讓 我 們 設 定 這 台 電 腦 的 網 路 位 址, 在 Global Settings 這 裡, 我 們 先 設 定 Gateway 王 振 民 2013.06.22 10 CCNA 筆 記

3. 點 選 左 方 的 INTERFACE / FastEthernet, 可 以 設 定 IP Address Subnet Mask 4. 請 點 選 PC1, 也 做 類 似 的 設 定 這 是 PC1 的 Gateway 設 定 王 振 民 2013.06.22 11 CCNA 筆 記

5. 這 是 PC1 的 IP Address 與 Subnet Mask 的 設 定 6. 點 選 Desktop 頁 籤, 其 中 的 Command Prompt, 這 個 功 能 是 模 擬 在 Windows 系 統 下 的 終 端 機 視 窗 ( 也 就 是 cmd 程 式 ) Web Browser 是 模 擬 一 個 小 型 的 瀏 覽 器 IP Configuration 是 視 窗 介 面 的 網 路 設 定 對 話 框 王 振 民 2013.06.22 12 CCNA 筆 記

7. 試 試 看,Ping 另 外 一 台 電 腦, 確 認 看 看 網 路 狀 況 8. 這 是 IP Configuration 的 對 話 框 第 4 節 傳 送 封 包 (ICMP 封 包 檢 視...) 請 跟 我 一 起 操 作 王 振 民 2013.06.22 13 CCNA 筆 記

第 2 章 基 礎 知 識 第 1 節 開 機 流 程 Router 設 備 有 幾 個 關 鍵 設 備, 是 和 開 機 流 程 有 關 的 : 1. CPU 2. RAM 3. ROM 4. FLASH 5. NVRAM CPU 也 許 我 們 可 以 將 這 類 設 備 當 做 一 個 embed system, 它 有 CPU RAM, 程 式 在 執 行 時, 也 是 載 入 到 RAM 裡 頭, 在 RAM 裡 頭 執 行 ROM 基 本 的 程 式 也 都 在 rom 裡 頭, 開 機 時 也 有 類 似 電 腦 的 bios 動 作 Rom:post diagnostic, bootstrap program, basic ios image, rom monitor Rom 裡 頭 有 個 basic ios image, 最 簡 單 基 礎 的 ios 檔 案, 可 避 免 ios 壞 掉 時 還 可 以 啟 動 修 復 FLASH 是 存 放 ios image 使 用 的 由 於 router 沒 有 硬 碟, 實 際 上 的 作 業 系 統 (ios) 是 存 放 在 flash rom 裡 的, 它 是 可 以 更 新 的 NVRAM 存 放 startup config file, config register startup config file, 每 次 開 機 時 就 會 讀 取 這 個, 所 有 的 密 碼 及 設 定 都 在 這 裡 config register, 可 做 password recovery, 有 時 候 可 以 跳 過 startup config file, 避 免 載 入 失 敗 的 ios 或 跳 過 密 碼 我 們 所 做 的 設 定, 是 存 放 在 NVRAM 裡 的 就 很 像 dos 裡 autoexec.bat 的 作 用, 每 次 開 機 時,router 都 會 去 讀 取 NVRAM 的 資 料 RAM Ram: execution ios, running config, routing tables, caches 王 振 民 2013.06.22 14 CCNA 筆 記

Startup config file 被 讀 取 後, 就 稱 為 running config, 所 以 我 們 在 做 設 定 時, 都 是 設 定 running config, 如 果 硬 體 重 新 啟 動, 這 裡 的 設 定 值 就 會 恢 復 原 startup config 裡 的 設 定 值, 因 此, 如 果 有 需 要 長 久 保 存, 我 們 要 另 外 儲 存 成 為 startup config file 也 就 是 說, 開 機 完 成 後,Router 所 運 行 的 系 統 是 放 在 這 裡, 系 統 所 運 作 的 環 境 設 定 檔 案, 也 是 放 在 這 裡, 我 們 如 果 做 了 任 何 的 設 定, 都 是 修 改 RAM 的 內 容, 我 們 通 常 都 會 再 將 RAM 的 資 料 寫 回 到 NVRAM, 如 果 沒 有 寫 回 到 NVRAM 的 話, 一 旦 重 新 開 機, 之 前 所 做 的 設 定 就 會 不 見 操 作 練 習 請 使 用 Packet Tracer, 建 立 一 個 Router 一 台 電 腦 使 用 console 線 連 接, 點 選 電 腦 圖 示, 使 用 Terminal 連 線, 在 Bits Per Second 部 份 設 定 為 9600, 按 OK 連 線 後, 注 意 觀 看 Router 開 機 的 內 容 由 於 這 是 一 台 還 沒 有 做 任 何 設 定 的 設 備, 第 一 次 會 以 互 動 對 話 的 方 式 建 立 設 定 環 境, 建 議 按 no 跳 過 這 個 動 作, 讓 我 們 以 手 動 的 方 式 來 建 立 整 個 環 境 以 下 幾 個 指 令 大 多 是 在 EXEC 特 權 模 式 下 作 用 的, 可 以 試 著 輸 入 看 看 : 1. enable, 這 個 指 令 可 以 讓 我 們 進 入 EXEC 特 權 模 式 2. exit, 可 以 回 到 一 般 模 式 3. show running-config, 可 以 顯 示 目 前 的 設 定 檔 內 容, 如 果 超 過 一 頁, 按 空 白 鍵 可 以 跳 下 一 頁 4. erase startup-config, 可 以 刪 除 啟 動 設 定 檔 5. reload, 可 以 讓 Router 重 新 載 入 執 行 設 定 檔 王 振 民 2013.06.22 15 CCNA 筆 記

第 2 節 不 同 的 模 式 Router 有 幾 個 不 同 的 操 作 模 式 : 1. User mode 2. Privileged mode 3. Setup mode 4. Global Configuration mode 5. Other Configuration mode 6. RXBOOT mode User mode, 一 般 模 式 提 示 符 號 會 是 Router>, 只 能 做 查 詢 的 動 作, 如 果 要 做 設 定, 就 必 須 到 下 一 個 特 權 模 式 Privileged mode, 特 權 模 式 提 示 符 號 是 Router#, 可 以 做 一 些 比 較 詳 細 的 動 作 Setup mode 裝 配 模 式, 是 透 過 一 個 動 作 一 個 動 作 的 詢 問 方 式, 逐 步 的 引 導 我 們 設 定 系 統 一 般 都 建 議 進 入 跟 著 操 作 一 次, 之 後 就 再 也 不 要 用 它, 還 是 以 CLI 的 模 式 為 主 Global Configuration mode 提 示 符 號 是 Router(config)#, 多 了 一 個 config 字 串, 這 是 針 對 全 域 環 境 的 設 定 Other Configuration mode 提 示 符 號 是 Router(config-mode)#, 如 果 有 二 個 介 面 卡, 而 我 們 只 要 單 單 設 定 其 中 一 張 介 面 卡, 就 是 在 這 個 模 式 底 下 操 作 做 RXBOOT mode 開 機 時 按 Ctrl+c, 就 可 以 進 入, 這 是 讓 我 們 做 一 些 緊 急 的 設 定 或 是 做 system recovery 使 用 的 王 振 民 2013.06.22 16 CCNA 筆 記

操 作 練 習 請 繼 續 前 項 的 操 作 環 境 來 做 練 習 : 1. 在 privileged mode 下 輸 入 configure 可 以 進 入 config mode, 有 三 個 選 項, 所 以 系 統 會 問 我 們 要 進 入 那 一 個 項 目, 請 選 擇 terminal 這 個 動 作 我 們 也 可 以 直 接 輸 入 configure terminal, 直 接 指 定 選 擇 terminal 2. line console 0 Console 線 的 keyword 是 line, 所 以 這 裡 輸 入 line console 0 雖 然 router 只 有 一 個 console port, 但 在 index 這 裡 還 是 要 指 定 為 0 輸 入 exit 可 以 回 到 前 一 個 項 目 3. interface Ethernet 0 在 config mode 輸 入 interface Ethernet 0 可 以 指 定 要 進 入 第 一 張 網 路 卡 的 設 定 4. end 或 Ctrl-z 可 以 直 接 回 到 privileged mode 5. show running-config show startup-config 若 沒 有 修 改 的 話, 這 二 個 configuration 的 內 容 只 有 前 幾 行 不 同, 其 它 的 會 是 一 樣 的 6. Show version 除 了 可 以 看 到 ios version, 還 可 以 看 到 其 它 很 有 用 的 資 訊 7. show flash Flash rom 裡 存 著 ios image, 所 以 show flash 可 以 看 到 裡 頭 存 的 ios image 8. show interface serial 0 列 出 interface 及 protocol 不 同 狀 態 時, 可 能 的 問 題 和 狀 況 第 二 行 的 狀 況, 可 能 是 encapsulation 的 type 不 同, 這 裡 是 HDLC, 也 許 對 方 是 PPP, 那 就 會 這 樣 王 振 民 2013.06.22 17 CCNA 筆 記

第 3 節 密 碼 忘 了, 怎 麼 辦? 如 果 不 知 道 密 碼 的 解 決 動 作 : 1. 連 線, 但 不 知 道 密 碼, 進 不 去 2. router 的 電 源 關 掉 重 開 王 振 民 2013.06.22 18 CCNA 筆 記

3. 會 看 到 終 端 機 正 在 開 機, 按 Ctrl+break 中 斷 4. 執 行 confreg 0x2142, 指 定 之 後 開 機 是 由 BXBOOT 啟 動 王 振 民 2013.06.22 19 CCNA 筆 記

5. 再 將 router 的 電 源 重 新 啟 動 由 於 跳 過 startup configuration, 所 以 會 自 動 進 入 setup mode, 輸 入 no 跳 過 它 6. 執 行 enable 進 入 privileged mode, 再 執 行 copy start run 讀 出 設 定 內 容 王 振 民 2013.06.22 20 CCNA 筆 記

7. 會 發 現 目 前 的 router 名 稱 已 經 改 了, 表 示 設 定 檔 案 已 經 讀 取 出 來 記 得 要 改 密 碼 囉 執 行 configure terminal 進 入 config mode, 執 行 enable secret lab-a 將 密 碼 改 為 lab-a 再 執 行 line console 0, 要 修 改 console 連 線 的 密 碼 執 行 password 123 將 密 碼 改 為 123 8. 記 得 要 執 行 copy running-config startup-config 將 改 過 的 密 碼 重 新 寫 回 到 startup config 檔 案 以 後 才 有 作 用 最 後 要 再 config mode 執 行 config-register 0x2102, 下 回 重 開 機 時 可 以 正 常 順 序, 讀 取 startup config 內 容 王 振 民 2013.06.22 21 CCNA 筆 記

第 3 章 Router 與 Switch 的 基 本 管 理 第 1 節 基 本 的 操 作 當 裝 置 出 現 狀 態 訊 息 之 後, 按 Enter 鍵, 會 顯 示 Router 的 提 示 列, 這 就 是 User mode, 如 下 : Router> 在 User mode 下 輸 入 enable, 會 進 入 為 Privileged mode, 畫 面 動 作 如 下 : Router> Router>enable Router# 會 發 現 它 們 的 提 示 列 的 狀 態 是 不 一 樣 的 要 從 Privileged mode 回 到 User mode, 可 以 輸 入 disable, 畫 面 如 下 : Router> Router>enable Router# Router#disable Router> 要 離 開 控 制 台, 可 以 輸 入 第 1 項 show history 平 常 使 用 up down 鍵, 可 以 切 換 之 前 曾 經 輸 入 過 的 指 令 如 果 要 直 接 顯 示 所 有 指 令 的 話, 輸 入 : Router#show history 預 設 的 情 況 下,history 會 記 錄 20 個 指 令, 我 們 可 以 輸 入 以 下 指 令 檢 查 : Router#show terminal Line 0, Location: "", Type: "" Length: 24 lines, Width: 80 columns // 略 Modem type is unknown. Session limit is not set. 王 振 民 2013.06.22 22 CCNA 筆 記

Time since activation: 00:05:55 Editing is enabled. History is enabled, history size is 20. DNS resolution in show commands is enabled Full user help is disabled Allowed input transports are none. Allowed output transports are lat pad telnet rlogin lapb-ta mop v120 ssh. Preferred transport is lat. No output characters are padded No special data dispatching characters Router# 要 修 改 history 記 錄 的 指 令 數 量, 可 以 輸 入 以 下 指 令 : Router#terminal history size 30 Router# 第 2 項 show version show version 指 令 可 以 顯 示 系 統 的 硬 體 與 軟 體 版 本 的 資 訊 王 振 民 2013.06.22 23 CCNA 筆 記

第 2 節 Router 與 Switch 的 管 理 性 組 態 接 下 來 介 紹 的 幾 個 指 令, 不 會 讓 路 由 器 或 交 換 器 更 快, 但 是 卻 是 管 理 上 必 須 的 一 些 組 態 設 定 第 1 項 hostname 將 每 個 設 備 指 定 一 個 適 當 的 名 稱, 可 以 方 便 我 們 識 別 這 些 設 備 首 先, 必 須 先 執 行 configure terminal 進 入 Global Configuration mode, 修 改 hostname 的 方 式 如 下 : Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# Router(config)#hostname R1 R1(config)# R1(config)#hostname R2 R2(config)# 可 以 隨 時 修 改 設 備 名 稱, 但 比 較 好 的 方 式, 是 以 設 備 所 處 的 相 關 位 置 來 命 名, 將 來 維 護 時, 會 比 較 容 易 知 道 彼 此 間 的 相 關 位 置 在 這 份 講 義 裡, 我 們 可 能 會 使 用 R1 R2 R3 的 命 名 方 式, 比 較 簡 單 一 些 第 2 項 banner 標 題 訊 息 -motd motd 是 message of the day 的 縮 寫, 表 示 每 次 登 入 系 統 時, 都 會 看 到 這 個 訊 息 設 定 的 方 式 如 下 : R2(config)#banner motd x Hello~~ x R2(config)# 王 振 民 2013.06.22 24 CCNA 筆 記

輸 入 Ctrl + z 可 以 回 到 環 境, 再 輸 入 exit 就 可 以 登 出 提 示 列, 如 下 : Press RETURN to get started. Hello~~ R2> 當 我 們 按 下 Enter 要 登 入 系 統 時, 就 會 看 到 剛 才 所 設 定 motd 的 訊 息 再 看 一 下 剛 才 的 設 定 動 作 : R2(config)#banner motd x Hello~~ x R2(config)# 底 下 這 麼 做 也 可 以 : R2(config)#banner motd y HELLO!! y R2(config)# 這 樣 子 也 可 以 : R2(config)#banner motd E hello!! E R2(config)# 但 是, 如 果 用 底 下 這 種 方 式, 輸 入 時 不 會 有 錯 誤 訊 息, 但 motd 所 顯 示 的 訊 息 就 會 變 成 h, 而 不 會 看 到 hello!! : R2(config)#banner motd e hello!! e R2(config)# 現 在 應 該 可 以 知 道, 在 banner motd 指 令 的 後 面, 可 以 用 任 何 字 元 當 做 訊 息 的 開 始 與 結 束 的 分 隔 字 元, 但 是 要 避 免 和 訊 息 內 容 相 同 所 以, 一 般 大 多 數 都 使 用 # 做 為 分 隔 字 元, 如 下 : R2(config)#banner motd # hello~~ # 王 振 民 2013.06.22 25 CCNA 筆 記

R2(config)# 如 果 要 輸 入 為 多 行 的 訊 息, 可 以 參 考 以 下 的 動 作 : R2(config)#banner motd # Enter TEXT message. End with the character '#'. hello hello hello # R2(config)# 第 3 項 no ip domain lookup 如 果 我 們 輸 入 指 令 時, 不 小 心 輸 入 錯 誤, 又 按 了 enter 鍵 送 出, 例 如 底 下 錯 誤 的 動 作 : Router#shwo Translating "shwo"...domain server (255.255.255.255) (255.255.255.255) Translating "shwo"...domain server (255.255.255.255) % Unknown command or computer name, or unable to find computer address Router# Router 將 它 當 做 是 網 域 名 稱 的 查 詢, 如 果 要 避 免 這 個 狀 況, 可 以 在 configure mode 裡 輸 入 no ip domain lookup, 關 閉 這 個 功 能, 如 下 : Router# 王 振 民 2013.06.22 26 CCNA 筆 記

Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# Router(config)#no ip domain lookup Router(config)# Router(config)#exit Router# Router#shwo Translating "shwo" Translating "shwo" % Unknown command or computer name, or unable to find computer address Router# 執 行 no ip domain lookup 指 令 之 後, 對 於 不 小 心 輸 入 錯 誤 的 指 令, 系 統 不 會 嘗 試 做 網 域 名 稱 的 查 詢, 我 們 可 以 很 快 重 新 輸 入 正 確 的 指 令 第 4 項 設 定 密 碼 在 cisco 裡 可 以 設 定 五 個 密 碼 : 1. enable 密 碼 2. enable secret 密 碼 3. 控 制 台 密 碼 4. 輔 助 埠 (aux) 密 碼 5. telnet(vty) 密 碼 其 中 第 1 2 這 二 個 密 碼, 是 當 我 們 在 User mode 輸 入 enable 要 進 入 Privileged mode 時, 系 統 要 求 我 們 輸 入 的 密 碼, 主 要 是 透 過 密 碼 保 護 Privileged mode 王 振 民 2013.06.22 27 CCNA 筆 記

另 外 三 個, 分 別 就 是 我 們 由 控 制 台 輔 助 埠 telnet 的 方 式 連 線 時, 要 求 我 們 輸 入 的 密 碼 第 5 項 設 定 enable 密 碼 以 下 動 作 是 設 定 從 User mode 輸 入 enable 要 進 入 為 Privileged mode 時, 要 輸 入 的 密 碼 請 特 別 注 意 中 間 的 二 個 動 作, 前 項 是 未 加 密 的 密 碼, 第 二 個 則 是 加 密 的 密 碼, 為 了 系 統 安 全 考 量, 因 此,cisco 不 建 議 這 二 個 使 用 相 同 的 密 碼 因 此, 最 後 一 個 指 令 將 密 碼 設 定 為 另 一 個, 就 不 會 顯 示 任 何 警 告 的 訊 息 另 外 一 個 要 注 意 的 是, 設 定 了 secret 密 碼 之 後,password 的 密 碼 會 自 動 失 效, 因 此, 建 議 就 直 接 忽 略 password 的 密 碼, 使 用 secret 密 碼 即 可 Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# Router(config)#enable password 123 Router(config)# Router(config)#enable secret 123 The enable secret you have chosen is the same as your enable password. This is not recommended. Re-enter the enable secret. Router(config)# Router(config)#enable secret 123123 Router(config)# Router(config)#exit Router# 王 振 民 2013.06.22 28 CCNA 筆 記

第 6 項 設 定 line 密 碼 使 用 者 的 密 碼, 有 以 下 三 種 : 1. line aux, 使 用 輔 助 埠 連 線 的 使 用 者 密 碼 2. line console, 使 用 控 制 台 連 線 的 使 用 者 密 碼 3. line vty, 使 用 telnet 連 線 的 使 用 者 密 碼 第 7 項 line console 密 碼 設 定 console 的 密 碼, 必 須 使 用 line console 0 進 入 console 介 面 裡 做 設 定 由 於 console 只 有 一 個, 所 以 只 有 一 個 數 字 是 0 使 用 password 設 定 密 碼 之 後, 必 須 執 行 login 啟 用 才 可 以 另 外 所 執 行 的 exec-timeout 0 0, 前 個 0 表 示 分 鐘, 後 一 個 0 表 示 秒, 這 個 意 思 0 分 0 秒 之 後 登 出 控 制 台, 也 就 是 說 它 不 會 逾 時 不 會 主 動 登 出 控 制 台 預 設 是 10 分 鐘 後 登 出 另 一 個 logging synchronous, 則 是 系 統 顯 示 訊 息 時, 經 常 會 破 壞 畫 面 上 指 令 輸 入 的 樣 子, 因 此, 設 定 這 個 動 作 之 後, 就 算 系 統 顯 示 訊 息, 還 是 會 維 持 指 令 輸 入 列 的 完 整 Router(config)# Router(config)#line console 0 Router(config-line)# Router(config-line)#password 111 Router(config-line)#login Router(config-line)# Router(config-line)#exec-timeout 0 0 Router(config-line)# Router(config-line)#logging synchronous Router(config-line)# Router(config-line)#exit Router(config)#exit 王 振 民 2013.06.22 29 CCNA 筆 記

Router# 重 新 按 enter 登 入 系 統 時, 就 會 需 要 我 們 輸 入 user 密 碼, 就 是 前 項 line console 0 所 設 定 的 密 碼 Press RETURN to get started. User Access Verification Password: 第 8 項 line vty 密 碼 設 定 telnet 連 線 的 密 碼, 要 使 用 line vty 的 方 式, 後 面 接 二 個 數 字 分 別 是 vty 連 線 的 第 一 個 號 碼 最 後 一 個 連 線 號 碼, 第 一 個 號 碼 一 定 是 0, 至 於 最 後 一 個 號 碼 是 多 少, 就 依 設 備 等 級 的 不 同, 可 能 會 不 一 樣, 請 按? 查 詢 就 知 道 了 一 般 來 說, 在 很 多 書 上, 都 會 使 用 line vty 0 4 的 範 圍, 設 定 五 個 連 線 範 圍 的 密 碼, 實 務 上, 應 該 是 全 部 都 設 定 密 碼 會 比 較 好 一 些 Router(config)#line vty? <0-903> First Line number Router(config)#line vty 0? <1-903> Last Line number <cr> Router(config)#line vty 0 4 王 振 民 2013.06.22 30 CCNA 筆 記

Router(config-line)# Router(config-line)#password 222 Router(config-line)# Router(config-line)#login Router(config-line)# Router(config-line)#exit Router(config)#exit Router# 第 9 項 description- 描 述 設 定 介 面 的 description 的 作 用, 和 設 定 設 備 的 名 稱 類 似, 都 是 為 了 方 便 管 理, 一 看 就 知 道 這 個 介 面 是 在 做 什 麼 的 由 於 是 設 定 介 面 的 描 述, 因 此, 必 須 進 入 到 介 面 的 管 理 模 式 才 行, 操 作 動 作 如 下 : R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)# R1(config)#interface fastethernet 0/0 R1(config-if)# R1(config-if)#description Connect to Switch1 R1(config-if)#^Z %SYS-5-CONFIG_I: Configured from console by console R1# 第 10 項 do 命 令 在 User mode 及 Privileged mode, 我 們 可 以 使 用 show 指 令 查 看 系 統 資 訊, 但 是 在 Configuration mode 下 如 果 要 查 看 系 統 資 訊, 每 次 都 要 跳 出 來, 很 麻 煩, 因 此, 我 們 可 以 使 用 do 指 令, 後 面 再 加 上 show... 就 可 以 直 接 查 看 訊 息 例 如 : R1(config)# R1(config)#sh run ^ 王 振 民 2013.06.22 31 CCNA 筆 記

% Invalid input detected at '^' marker. R1(config)#do sh run Building configuration... Current configuration : 869 bytes! version 12.4 no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption 第 11 項 啟 動 介 面 在 一 個 設 備 裡, 可 能 會 有 很 多 個 fastethernet 介 面, 尤 其 是 新 的 路 由 器 或 交 換 器, 可 能 還 會 有 多 個 插 槽, 因 此, 我 們 要 針 對 介 面 做 設 定 時, 必 須 使 用 interface 類 型 插 槽 / 埠 號 的 方 式, 有 些 可 能 更 多, 例 如 序 列 界 面 (serial) 可 能 會 有 三 個 數 字, 表 示 的 方 式 是 interface 類 型 路 由 器 ( 設 備 ) 本 身 / 插 槽 / 埠 號 以 下 的 設 定 動 作, 是 以 這 個 例 子 做 為 參 考 以 下 是 設 定 fastethernet 的 例 子 : R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)# R1(config)#interface fastethernet 0/0 R1(config-if)# 王 振 民 2013.06.22 32 CCNA 筆 記

R1(config-if)#ip address 192.168.1.254 255.255.255.0 R1(config-if)# R1(config-if)#no shutdown %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up R1(config-if)# 以 下 是 設 定 serial 的 例 子 : R1(config-if)#exit R1(config)# R1(config)#interface serial 0/0/0 R1(config-if)# R1(config-if)#ip address 10.0.0.1 255.255.255.252 R1(config-if)# R1(config-if)#no shutdown %LINK-5-CHANGED: Interface Serial0/0/0, changed state to down R1(config-if)# R1(config-if)#clock rate 2000000 R1(config-if)# R1(config-if)#exit R1(config)# 在 另 外 一 個 路 由 器 上 做 同 樣 類 似 的 動 作, 將 fastethernet 及 serial 設 定 完 成, 就 會 發 現 原 本 紅 色 的 燈 號 變 成 綠 色, 可 以 在 路 由 器 ping 另 外 一 個 路 由 器 的 IP 位 址 第 3 節 顯 示 系 統 設 定 的 狀 態 第 1 項 show running-config 最 常 使 用 到 的 又 可 以 看 大 部 份 資 訊 的 指 令 就 是 show running-config 了 R1# R1#show running-config Building configuration... Current configuration : 894 bytes! 王 振 民 2013.06.22 33 CCNA 筆 記

version 12.4 no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption! hostname R1! enable secret 5 $1$mERr$3HhIgMGBA/9qNmgzccuxv0! spanning-tree mode pvst!! interface FastEthernet0/0 ip address 192.168.1.254 255.255.255.0 duplex auto speed auto! interface FastEthernet0/1 no ip address duplex auto speed auto shutdown! interface Serial0/0/0 ip address 10.0.0.1 255.255.255.252 clock rate 2000000! interface Serial0/0/1 no ip address clock rate 2000000 shutdown! interface Vlan1 no ip address shutdown! ip classless!!! banner motd ^C hello R1 ^C!! 王 振 民 2013.06.22 34 CCNA 筆 記

!! line con 0 exec-timeout 0 0 password 123 logging synchronous login line vty 0 4 exec-timeout 0 0 password 123 logging synchronous login line vty 5 15 exec-timeout 0 0 password 123 logging synchronous login!!! end R1# 第 2 項 使 用 pipeline 的 功 能 由 於 running-config 的 內 容 很 多, 顯 示 內 容 時, 可 能 會 需 要 找 尋 一 陣 子, 才 能 找 到 我 們 要 的 資 料, 因 此, 我 們 可 以 在 show running-config 之 後, 再 加 上 管 線 直 接 篩 選 出 我 們 要 的 區 塊 內 容 ( 註 : 這 個 功 能 在 Packet Tracer 裡 無 法 執 行, 如 果 有 實 機 或 是 安 裝 GNS3 模 擬 環 境, 應 該 就 可 以 正 常 操 作 ) 以 下 的 操 作 動 作, 只 顯 示 Serial 埠 區 塊 的 內 容 : R1#show running-config? append append operation Append redirected output to URL (URLs supporting only) begin Begin with the line that matches exclude Exclude lines that match 王 振 民 2013.06.22 35 CCNA 筆 記

include Include lines that match redirect Redirect output to URL section tee Filter a section of output Copy output to URL R1#show running-config section Serial interface Serial0/0 no ip address shutdown clock rate 2000000 interface Serial0/1 no ip address shutdown clock rate 2000000 interface Serial0/2 no ip address shutdown clock rate 2000000 interface Serial0/3 no ip address shutdown 王 振 民 2013.06.22 36 CCNA 筆 記

clock rate 2000000 R1# 第 3 項 組 態 設 定 - 儲 存 檢 視 running-config 是 在 DRAM 中 的 組 態 檔 案, 是 運 行 組 態 而 startup-config 是 啟 動 組 態, 是 放 在 NVRAM 之 中 的, 在 router 或 switch 啟 動 時, 會 由 NVRAM 中 讀 取 startup-config 檔 案, 變 成 running-config 至 於 我 們 修 改 的 系 統 設 定, 都 是 針 對 running-config 內 容 做 修 改, 因 此, 我 們 在 檢 視 組 態 檔 案 時, 都 是 執 行 show running-config 的 原 因 也 是 這 樣 也 就 是 說, 如 果 我 們 要 檢 視 啟 動 組 態 檔 案, 就 執 行 show startup-config 通 常, 在 我 們 修 改 running-config 的 組 態 之 後, 只 要 設 定 正 確, 我 們 都 會 將 運 行 組 態 備 份 到 啟 動 組 態, 動 作 如 下 : R1# R1#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK] R1# 如 果 沒 有 備 份 就 將 設 備 重 啟, 啟 動 時 會 再 由 NVRAM 讀 取 startup-config 內 容, 變 成 DRAM 裡 的 running-config, 之 前 設 定 的 動 作 自 然 就 不 見 囉! 第 4 項 組 態 設 定 - 刪 除 我 們 可 以 執 行 erase startup-config 將 NVRAM 裡 的 組 態 檔 案 清 除, 如 下 : R1#erase startup-config Erasing the nvram filesystem will remove all configuration files! Continue? [confirm] [OK] Erase of nvram: complete %SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram R1# 下 回 再 重 新 開 機 時, 因 為 NVRAM 裡 的 startup-config 己 經 被 刪 除, 沒 有 資 料, 也 就 是 還 原 為 預 設 的 狀 態, 全 部 都 要 重 新 開 始 設 定 在 Privileged mode 下 也 可 以 執 行 reload 重 新 載 入 NVRAM 是 空 的 清 況 下, 系 統 會 自 動 詢 問 我 們 要 不 要 進 入 setup mode, 請 回 答 no, 王 振 民 2013.06.22 37 CCNA 筆 記

自 己 動 手 做 設 定 第 5 項 show interfaces- 顯 示 界 面 資 訊 在 Privileged mode 輸 入 show interfaces, 可 以 顯 示 所 有 界 面 的 狀 態, 如 果 覺 得 只 想 要 看 單 一 介 面 的 狀 態, 也 可 以 直 接 選 擇 該 界 面, 操 作 如 下 : R1# R1#show interfaces... 略 R1# R1#show interfaces fastethernet 0/0 FastEthernet0/0 is up, line protocol is up (connected) Hardware is Lance, address is 0050.0f4b.8d01 (bia 0050.0f4b.8d01) Internet address is 192.168.1.254/24 MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set ARP type: ARPA, ARP Timeout 04:00:00, Last input 00:00:08, output 00:00:05, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0 (size/max/drops); Total output drops: 0 Queueing strategy: fifo Output queue :0/40 (size/max) 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 3 bits/sec, 0 packets/sec 0 packets input, 0 bytes, 0 no buffer Received 0 broadcasts, 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 0 input packets with dribble condition detected 4 packets output, 116 bytes, 0 underruns 0 output errors, 0 collisions, 1 interface resets 0 babbles, 0 late collision, 0 deferred 0 lost carrier, 0 no carrier 0 output buffer failures, 0 output buffers swapped out R1# 在 這 些 訊 息 裡, 我 們 應 該 要 能 找 到 介 面 的 IP 位 址 子 網 路 遮 罩 最 大 傳 輸 單 位 (MTU, maximum transmission unit) 頻 寬 (BW, bandwidth, 要 注 意 它 的 單 位 是 kbit 哦 ) 可 靠 度 (reliability 255/255, 其 中 的 255/255 為 1 表 示 良 好 ) 負 載 (txload 1/255, rxload 1/255, 其 中 的 1/255 表 示 負 載 很 小 ) 另 外, 仔 細 比 較 show interfaces fastethernet 0/0 與 show interfaces serial 0/0/0 之 王 振 民 2013.06.22 38 CCNA 筆 記

間, 也 可 以 看 到 Encapsulation 這 裡 的 內 容 是 不 太 一 樣 的 每 個 介 面 都 會 統 計 該 界 面 上 的 流 量, 如 果 要 清 除 的 話, 可 以 執 行 以 下 指 令 ( 在 Packet Tracer 裡 無 法 使 用 ): Router#clear counters fastethernet 0/0 Clear "show interface" counters on this interface [confirm] Router# *Mar 1 00:01:23.659: %CLEAR-5-COUNTERS: Clear counter on interface FastEthernet0/0 by console Router# 第 6 項 show ip interface 仔 細 比 較 show interfaces fastethernet 0/0 與 show ip interface fastethernet 0/0 二 個 指 令 的 差 別, 其 中 show interfaces 是 屬 於 顯 示 界 面 資 訊 的 內 容, 而 show ip interface 則 是 顯 示 有 關 第 3 層 的 資 訊, 例 如 IP 位 址 遮 罩 界 面 上 是 否 有 access list 等 資 訊 R1#show interfaces fastethernet 0/0 FastEthernet0/0 is up, line protocol is up (connected) Hardware is Lance, address is 0050.0f4b.8d01 (bia 0050.0f4b.8d01) Internet address is 192.168.1.254/24 MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set ARP type: ARPA, ARP Timeout 04:00:00, Last input 00:00:08, output 00:00:05, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0 (size/max/drops); Total output drops: 0 Queueing strategy: fifo Output queue :0/40 (size/max) 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 0 packets input, 0 bytes, 0 no buffer Received 0 broadcasts, 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 0 input packets with dribble condition detected 0 packets output, 0 bytes, 0 underruns 王 振 民 2013.06.22 39 CCNA 筆 記

0 output errors, 0 collisions, 1 interface resets 0 babbles, 0 late collision, 0 deferred 0 lost carrier, 0 no carrier 0 output buffer failures, 0 output buffers swapped out R1# R1# R1#show ip interface fastethernet 0/0 FastEthernet0/0 is up, line protocol is up (connected) Internet address is 192.168.1.254/24 Broadcast address is 255.255.255.255 Address determined by setup command MTU is 1500 Helper address is not set Directed broadcast forwarding is disabled Outgoing access list is not set Inbound access list is not set Proxy ARP is enabled Security level is default Split horizon is enabled ICMP redirects are always sent ICMP unreachables are always sent ICMP mask replies are never sent IP fast switching is disabled IP fast switching on the same interface is disabled IP Flow switching is disabled IP Fast switching turbo vector IP multicast fast switching is disabled IP multicast distributed fast switching is disabled Router Discovery is disabled IP output packet accounting is disabled IP access violation accounting is disabled TCP/IP header compression is disabled RTP/IP header compression is disabled Probe proxy name replies are disabled Policy routing is disabled Network address translation is disabled WCCP Redirect outbound is disabled WCCP Redirect exclude is disabled BGP Policy Mapping is disabled R1# 王 振 民 2013.06.22 40 CCNA 筆 記

第 7 項 show ip interface brief 這 個 指 令 非 常 好 用, 可 以 提 供 所 有 界 面 的 概 觀 狀 態, 很 容 易 一 下 就 看 到 我 們 關 心 的 狀 態, 例 如 界 面 是 up 或 down 的 狀 態 R1#show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.1.254 YES manual up up FastEthernet0/1 unassigned YES unset administratively down down Serial0/0/0 10.0.0.1 YES manual up up Serial0/0/1 unassigned YES unset administratively down down Vlan1 unassigned YES unset administratively down down R1# 第 8 項 show protocols show protocols 也 是 很 好 用 的 指 令, 它 可 以 顯 示 每 個 界 面 的 第 1 層 第 2 層 的 狀 態, 以 及 該 界 面 的 IP 位 址, 和 show ip interface brief 比 較 起 來 其 實 還 滿 像 的, 只 是 呈 現 的 方 式 不 同 R1#show protocols Global values: Internet Protocol routing is enabled FastEthernet0/0 is up, line protocol is up Internet address is 192.168.1.254/24 FastEthernet0/1 is administratively down, line protocol is down Serial0/0/0 is up, line protocol is up Internet address is 10.0.0.1/30 Serial0/0/1 is administratively down, line protocol is down Vlan1 is administratively down, line protocol is down R1# 王 振 民 2013.06.22 41 CCNA 筆 記

第 4 章 管 理 cisco 路 由 器 第 1 節 基 本 說 明 第 1 項 開 機 Router 開 機 時, 會 執 行 以 下 系 列 的 步 驟 : 1. 執 行 POST 進 行 硬 體 測 試, 確 認 所 有 元 件 都 可 以 正 常 運 作 2. 由 ROM 讀 取 開 機 區 程 式, 用 來 尋 找 並 載 入 IOS 軟 體, 預 設 尋 找 IOS 的 順 序 是 快 閃 記 憶 體 (flash memory) tftp 伺 服 器 ROM 3. 尋 找 NVRAM 的 組 態 檔 (startup-config) 4. NVRAM 的 組 態 檔 如 果 存 在, 就 將 它 載 入, 成 為 運 行 組 態 檔 (running-config), 如 果 找 不 到, 就 進 入 裝 配 模 式 (setup mode) 第 2 項 檢 視 組 態 暫 存 器 的 內 容 -show version 從 這 裡 可 以 得 知 這 個 Router 的 型 號 是 2800, 它 的 IOS 版 本 是 12.4 的,IOS 檔 案 是 c2800nm-advipservicesk9-mz.124-15.t1.bin, 以 及 64M 的 記 憶 體 R1#show version Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2007 by Cisco Systems, Inc. Compiled Wed 18-Jul-07 06:21 by pt_rel_team ROM: System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1) Copyright (c) 2000 by cisco Systems, Inc. System returned to ROM by power-on System image file is "c2800nm-advipservicesk9-mz.124-15.t1.bin"... 略 cisco 2811 (MPC860) processor (revision 0x200) with 60416K/5120K bytes of memory Processor board ID JAD05190MTZ (4292891495) M860 processor: part number 0, mask 49 2 FastEthernet/IEEE 802.3 interface(s) 王 振 民 2013.06.22 42 CCNA 筆 記

2 Low-speed serial(sync/async) network interface(s) 239K bytes of NVRAM. 62720K bytes of processor board System flash (Read/Write) Configuration register is 0x2102 R1# 這 裡 標 示 為 藍 色 的 0x2102, 是 這 個 設 備 的 組 態 設 定, 展 開 為 位 元 型 態, 就 可 以 知 道 它 的 第 13 8 1 的 位 元 ( 右 方 第 1 個 位 元 是 第 0 個 位 元 ) 是 1, 是 開 啟 的 每 個 位 元 都 有 它 的 意 義 與 作 用, 這 部 份 請 參 考 書 籍 P.7-5 的 內 容 如 果 第 6 個 位 元 ( 右 方 第 1 個 位 元 是 第 0 個 位 元 ) 也 開 啟 的 話 (0x2142), 代 表 Router 開 機 時 忽 略 NVRAM 的 內 容, 也 就 是 說 不 會 讀 取 startup-config 這 個 實 作 的 練 習, 就 是 前 面 所 介 紹 的 密 碼 忘 了, 怎 麼 辦 章 節 內 容 第 3 項 cdp cdp 是 cisco discovery protocal 的 縮 寫, 表 示 是 cisco 發 現 協 定, 主 要 是 用 來 收 集 本 地 與 遠 端 路 由 器 裝 置 的 資 訊 執 行 show cdp, 如 下 : R1#show cdp Global CDP information: Sending CDP packets every 60 seconds Sending a holdtime value of 180 seconds Sending CDPv2 advertisements is enabled R1# 這 裡 有 timer 與 holdtime 二 個 時 間 的 長 度 可 以 設 定, 設 定 方 式 如 下 : Router# Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# Router(config)#cdp? advertise-v2 CDP sends version-2 advertisements holdtime packets Specify the holdtime (in sec) to be sent in log Log messages generated by CDP 王 振 民 2013.06.22 43 CCNA 筆 記

run Enable CDP source-interface Insert the interface's IP in all CDP packets timer sent Specify rate (in sec) at which CDP packets are Router(config)# Router(config)#cdp holdtime? <10-255> Length of time (in sec) that receiver must keep this packet Router(config)# Router(config)#cdp timer? <5-254> Rate at which CDP packets are sent (in sec) Router(config)# 第 4 項 show cdp neighbor 使 用 指 令 show cdp neighbor 可 以 顯 示 鄰 居 的 資 訊 這 個 指 令 很 有 用 處, 如 果 我 們 並 沒 有 網 路 拓 撲 圖 可 以 參 考, 可 以 經 由 這 個 指 令 慢 慢 的 查 出 所 有 router 連 接 的 方 式 埠 鄰 居 的 設 備 型 號 埠... 等, 就 可 以 慢 慢 的 畫 出 組 織 的 網 路 拓 撲 圖 表 了 Router#show cdp neighbors Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater Device ID Local Intrfce Holdtme Capability Platform Port ID Router Ser 0/0 139 R S I 3725 Ser 0/0 王 振 民 2013.06.22 44 CCNA 筆 記

Router# 這 個 指 令 所 顯 示 的 欄 位 分 別 表 示 裝 置 ID 本 地 界 面 保 留 期 限 性 態 相 連 接 的 平 台 相 連 接 平 台 的 埠 ID 第 5 項 show cdp neighbors detail 如 果 想 要 看 到 相 鄰 裝 置 的 詳 細 資 訊, 可 以 執 行 show cdp neighbors detail 查 看 Router#show cdp neighbors detail ------------------------- Device ID: Router Entry address(es): IP address: 10.0.0.2 Platform: Cisco 3725, Capabshow cdp entry *ilities: Router Switch IGMP Interface: Serial0/0, Port ID (outgoing port): Serial0/0 Holdtime : 149 sec Version : Cisco IOS Software, 3700 Software (C3725-ADVENTERPRISEK9-M), Version 12.4(25d), RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2010 by Cisco Systems, Inc. Compiled Wed 18-Aug-10 07:55 by prod_rel_team advertisement version: 2 王 振 民 2013.06.22 45 CCNA 筆 記

VTP Management Domain: '' Router# 第 6 項 show cdp entry * show cdp entry * 和 show cdp neighbors detail 輸 出 的 結 果 差 不 多, 但 是 show cdp entry * 還 可 以 再 延 伸 出 二 個 比 較 特 別 的 指 令, 分 別 如 下 : Router# Router#show cdp entry * protocol Protocol information for Router : IP address: 10.0.0.2 Router# Router#show cdp entry * version Version information for Router : Cisco IOS Software, 3700 Software (C3725-ADVENTERPRISEK9-M), Version 12.4(25d), RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2010 by Cisco Systems, Inc. Compiled Wed 18-Aug-10 07:55 by prod_rel_team Router# show cdp entry * protocol 可 以 查 看 相 鄰 裝 置 的 IP 位 址 show cdp entry * version 可 以 查 看 相 鄰 裝 置 的 IOS 版 本 王 振 民 2013.06.22 46 CCNA 筆 記

第 7 項 show cdp traffic show cdp traffic 指 令 可 以 顯 示 cdp 的 流 量, 包 含 封 包 數 量 發 生 錯 誤 的 數 量 等 Router#show cdp traffic CDP counters : Total packets output: 122, Input: 117 Hdr syntax: 0, Chksum error: 0, Encaps failed: 0 No memory: 0, Invalid packet: 0, Fragmented: 0 CDP version 1 advertisements output: 0, Input: 0 CDP version 2 advertisements output: 122, Input: 117 Router# 第 8 項 show cdp interface show cdp interface 指 令 可 以 顯 示 界 面 上 的 cdp 狀 態, 如 果 只 要 查 看 單 一 界 面, 也 可 以 輸 入 為 show cdp interface serial 0/0 Router# Router#show cdp interface serial 0/0 Serial0/0 is up, line protocol is up Encapsulation HDLC Sending CDP packets every 60 seconds Holdtime is 180 seconds Router# 王 振 民 2013.06.22 47 CCNA 筆 記

第 9 項 cdp enable 裝 置 上 的 cdp 功 能 目 前 預 設 開 啟 的, 不 過, 它 也 可 以 關 閉, 因 此, 如 果 執 行 cdp 指 令 卻 沒 有 任 何 輸 出 的 內 容, 很 有 可 能 是 cdp 被 關 閉 了 底 下 的 操 作, 是 先 將 serial 0/0 的 cdp 功 能 關 閉, 顯 示 關 閉 後 的 show cdp 內 容, 再 重 新 將 它 開 啟, 再 show cdp 的 內 容, 藉 以 比 較 二 者 的 差 別 Router# Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# Router(config)#interface serial 0/0 Router(config-if)# Router(config-if)#no cdp enable Router(config-if)# Router(config-if)#do show cdp int s0/0 Router(config-if)# Router(config-if)#cdp enable Router(config-if)# Router(config-if)#do show cdp int s0/0 Serial0/0 is up, line protocol is up Encapsulation HDLC Sending CDP packets every 60 seconds Holdtime is 180 seconds Router(config-if)# 王 振 民 2013.06.22 48 CCNA 筆 記

第 5 章 IP 遶 送 第 1 節 遶 送 基 礎 第 1 項 基 本 網 路 環 境 首 先 使 用 Packet Tracer 建 立 以 下 的 網 路 環 境, 有 關 R0 R1 的 設 定, 請 參 閱 之 前 的 說 明, 進 行 Router 的 設 定 至 於 其 它 的 PC, 請 依 照 目 前 的 環 境, 自 行 配 置 適 當 的 IP 位 址 第 2 項 網 路 連 線 測 試 底 下 是 在 PC0 的 電 腦 上, 我 設 定 的 一 個 IP 位 址 Packet Tracer PC Command Line 1.0 PC>ipconfig IP Address...: 10.10.10.101 Subnet Mask...: 255.255.255.0 王 振 民 2013.06.22 49 CCNA 筆 記

Default Gateway...: 10.10.10.1 PC> 從 PC0 要 能 ping 到 PC1 PC>ping 10.10.10.102 Pinging 10.10.10.102 with 32 bytes of data: Reply from 10.10.10.102: bytes=32 time=7ms TTL=128 Reply from 10.10.10.102: bytes=32 time=9ms TTL=128 Reply from 10.10.10.102: bytes=32 time=4ms TTL=128 Reply from 10.10.10.102: bytes=32 time=11ms TTL=128 Ping statistics for 10.10.10.102: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 4ms, Maximum = 11ms, Average = 7ms PC> 從 PC0 要 能 ping 到 R1 的 FastEthernet 0/0 的 IP 位 址 PC>ping 10.10.10.1 Pinging 10.10.10.1 with 32 bytes of data: Reply from 10.10.10.1: bytes=32 time=14ms TTL=255 Reply from 10.10.10.1: bytes=32 time=6ms TTL=255 Reply from 10.10.10.1: bytes=32 time=9ms TTL=255 Reply from 10.10.10.1: bytes=32 time=10ms TTL=255 Ping statistics for 10.10.10.1: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 6ms, Maximum = 14ms, Average = 9ms PC> 除 了 直 接 連 接 的 R1 FastEthernet0/0 之 外, 還 要 能 夠 ping 到 R1 的 FastEthernet0/1 FastEthernet1/1 位 址 PC>ping 10.10.20.1 王 振 民 2013.06.22 50 CCNA 筆 記

Pinging 10.10.20.1 with 32 bytes of data: Reply from 10.10.20.1: bytes=32 time=4ms TTL=255 Reply from 10.10.20.1: bytes=32 time=9ms TTL=255 Reply from 10.10.20.1: bytes=32 time=2ms TTL=255 Reply from 10.10.20.1: bytes=32 time=12ms TTL=255 Ping statistics for 10.10.20.1: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 2ms, Maximum = 12ms, Average = 6ms PC> 而 且, 還 要 能 ping 到 PC2 PC3 PC4 PC5 PC>ping 10.10.20.101 Pinging 10.10.20.101 with 32 bytes of data: Request timed out. Reply from 10.10.20.101: bytes=32 time=17ms TTL=127 Reply from 10.10.20.101: bytes=32 time=20ms TTL=127 Reply from 10.10.20.101: bytes=32 time=13ms TTL=127 Ping statistics for 10.10.20.101: Packets: Sent = 4, Received = 3, Lost = 1 (25% loss), Approximate round trip times in milli-seconds: Minimum = 13ms, Maximum = 20ms, Average = 16ms PC> 第 2 節 Router 的 路 由 表 第 1 項 show ip route 在 R1 的 Privileged mode 輸 入 show ip route 指 令, 可 以 看 到 router 轉 送 封 包 的 路 由 表 R1#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 王 振 民 2013.06.22 51 CCNA 筆 記

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set 10.0.0.0/24 is subnetted, 4 subnets C C C C R1# 10.10.10.0 is directly connected, FastEthernet0/0 10.10.20.0 is directly connected, FastEthernet0/1 10.10.30.0 is directly connected, FastEthernet1/0 10.10.40.0 is directly connected, Serial0/0/0 從 底 下 路 由 表 的 第 一 欄 顯 示 C, 可 以 檢 查 上 方 的 對 照 表, 知 道 它 是 直 接 連 接 的 線 路 因 此, 在 我 們 由 PC0 去 ping 不 同 網 段 的 PC2(10.10.20.XX),router 會 由 這 裡 的 路 由 表 知 道 目 的 地 應 該 是 要 由 FastEthernet0/1 的 連 線 送 出, 這 就 是 路 徑 遶 送 的 方 式 第 2 項 show ip arp 剛 才 有 做 ping 的 動 作, 在 設 備 上 就 會 廣 播 查 詢 IP 位 址 對 映 的 MAC 位 址, 也 會 快 取 起 來, 方 便 下 次 需 要 時 運 用, 我 們 可 以 由 show ip arp 查 到 目 前 快 取 的 IP 與 MAC 的 位 址 R1#show ip arp Protocol Address Age (min) Hardware Addr Type Interface Internet 10.10.10.1-00D0.970B.BB01 ARPA FastEthernet0/0 Internet 10.10.10.101 12 0002.4AAC.B590 ARPA FastEthernet0/0 Internet 10.10.10.102 18 0002.16C5.3BD4 ARPA FastEthernet0/0 Internet 10.10.20.1-00D0.970B.BB02 ARPA FastEthernet0/1 Internet 10.10.20.101 10 000A.F3E0.2C22 ARPA FastEthernet0/1 Internet 10.10.30.1-0009.7C8A.A701 ARPA FastEthernet1/0 Internet 10.10.30.101 8 00D0.9764.549C ARPA FastEthernet1/0 R1# 王 振 民 2013.06.22 52 CCNA 筆 記

第 3 節 IP 遶 送 的 進 階 練 習 參 照 課 本 P8-17, 建 立 如 下 的 網 路 架 構 圖 第 1 項 設 定 Corp router Router> Router>enable Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# Router(config)#hostname Corp Corp(config)# Corp(config)#enable secret 123 王 振 民 2013.06.22 53 CCNA 筆 記

Corp(config)#no ip domain-lookup Corp(config)#banner motd # this is my Corp 2811 ISR router # Corp(config)# Corp(config)#line console 0 Corp(config-line)#password 123 Corp(config-line)#login Corp(config-line)# Corp(config-line)#logging synchronous Corp(config-line)#exec-timeout 0 0 Corp(config-line)#exit Corp(config)# Corp(config)#line vty 0? <1-15> Last Line number <cr> Corp(config)#line vty 0 15 Corp(config-line)#password 123 Corp(config-line)#login Corp(config-line)#exit Corp(config)# Corp(config)#interface vlan 1 Corp(config-if)#description switch card to core network Corp(config-if)#ip address 10.1.1.1 255.255.255.0 Corp(config-if)#no shutdown Corp(config-if)# %LINK-5-CHANGED: Interface Vlan1, changed state to up Corp(config-if)# Corp(config-if)#exit Corp(config)# Corp(config)#interface fastethernet 1/0 Corp(config-if)#description switch port connection to WWW server Corp(config-if)#no shutdown %LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up Corp(config-if)# 王 振 民 2013.06.22 54 CCNA 筆 記

Corp(config-if)#int f1/1 Corp(config-if)#description switch port connection to Email server Corp(config-if)#no shutdown %LINK-5-CHANGED: Interface FastEthernet1/1, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to up Corp(config-if)# Corp(config-if)#int f1/2 Corp(config-if)#description switch port connection to DNS server Corp(config-if)#no shutdown Corp(config-if)# %LINK-5-CHANGED: Interface FastEthernet1/2, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/2, changed state to up Corp(config-if)# Corp(config-if)#int s0/0/0 Corp(config-if)#description 1st connection to R1 Corp(config-if)#ip address 10.1.2.1 255.255.255.0 Corp(config-if)#no shutdown %LINK-5-CHANGED: Interface Serial0/0/0, changed state to down Corp(config-if)# Corp(config-if)#int s0/0/1 Corp(config-if)#description 2nd connection to R1 Corp(config-if)#ip address 10.1.3.1 255.255.255.0 Corp(config-if)#no shutdown %LINK-5-CHANGED: Interface Serial0/0/1, changed state to down Corp(config-if)# Corp(config-if)#int s0/1/0 Corp(config-if)#description connection to R2 Corp(config-if)#ip address 10.1.4.1 255.255.255.0 Corp(config-if)#no shutdown %LINK-5-CHANGED: Interface Serial0/1/0, changed state to down Corp(config-if)# 王 振 民 2013.06.22 55 CCNA 筆 記

Corp(config-if)#int f0/0 Corp(config-if)#description connection to R3 Corp(config-if)#ip address 10.1.5.1 255.255.255.0 Corp(config-if)#no shutdown %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up Corp(config-if)# Corp(config-if)#^Z Corp# %SYS-5-CONFIG_I: Configured from console by console Corp# Corp#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK] Corp# 第 2 項 檢 視 Corp 的 routing table Corp# Corp#sh Corp#show ip rou Corp#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set 10.0.0.0/24 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Vlan1 Corp# 王 振 民 2013.06.22 56 CCNA 筆 記

第 3 項 設 定 R1 router R1>enable R1#conf R1#configure t R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)# R1(config)#hostname R1 R1(config)#enable secret 123 R1(config)#no ip domain-lookup R1(config)#banner motd # this my R1 router # R1(config)# R1(config)#line console 0 R1(config-line)#password 123 R1(config-line)#login R1(config-line)#logging synchronous R1(config-line)#exec-timeout 0 0 R1(config-line)#exit R1(config)# R1(config)#line vty 0? <1-15> Last Line number <cr> R1(config)#line vty 0 15 R1(config-line)#password 123 R1(config-line)#login R1(config-line)# R1(config-line)#exit R1(config)# R1(config)# R1(config)#interface serial 0/0/0 R1(config-if)#description 1st connection to Corp router R1(config-if)#ip address 10.1.2.2 255.255.255.0 R1(config-if)#no shutdown %LINK-5-CHANGED: Interface Serial0/0/0, changed state to up R1(config-if)# %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up 王 振 民 2013.06.22 57 CCNA 筆 記

R1(config-if)# R1(config-if)#int s0/0/1 R1(config-if)#description 2nd connection to Corp router R1(config-if)#ip address 10.1.3.2 255.255.255.0 R1(config-if)#no shutdown %LINK-5-CHANGED: Interface Serial0/0/1, changed state to up R1(config-if)# %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1, changed state to up R1(config-if)# R1(config-if)#int f0/0 R1(config-if)#description connection to PC0 R1(config-if)#ip address 192.168.10.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)# %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up R1(config-if)# R1(config-if)#int f0/1 R1(config-if)#description connection to PC1 R1(config-if)#ip address 192.168.20.1 255.255.255.0 R1(config-if)#no shutdown %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up R1(config-if)# R1(config-if)#^Z R1# %SYS-5-CONFIG_I: Configured from console by console R1# R1#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK] R1# 王 振 民 2013.06.22 58 CCNA 筆 記

第 4 項 檢 視 R1 的 routing table R1#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set 10.0.0.0/24 is subnetted, 2 subnets C 10.1.2.0 is directly connected, Serial0/0/0 C 10.1.3.0 is directly connected, Serial0/0/1 C 192.168.10.0/24 is directly connected, FastEthernet0/0 C 192.168.20.0/24 is directly connected, FastEthernet0/1 R1# 第 5 項 再 次 檢 視 Corp 的 routing table Corp#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set 10.0.0.0/24 is subnetted, 3 subnets C 10.1.1.0 is directly connected, Vlan1 C 10.1.2.0 is directly connected, Serial0/0/0 C 10.1.3.0 is directly connected, Serial0/0/1 Corp# 王 振 民 2013.06.22 59 CCNA 筆 記

第 6 項 設 定 R2 router Router> Router>enable Router# Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# Router(config)#hostname R2 R2(config)#banner motd # this is my R2 router # R2(config)#no ip domain-lookup R2(config)#enable secret 123 R2(config)# R2(config)#line console 0 R2(config-line)#password 123 R2(config-line)#login R2(config-line)#logging synchronous R2(config-line)#exec-timeout 0 0 R2(config-line)#exit R2(config)# R2(config)#line vty 0 15 R2(config-line)#password 123 R2(config-line)#login R2(config-line)#exit R2(config)# R2(config)#interface serial 0/1/0 R2(config-if)#description connection to Corp router R2(config-if)#ip address 10.1.4.2 255.255.255.0 R2(config-if)#no shutdown %LINK-5-CHANGED: Interface Serial0/1/0, changed state to up R2(config-if)# %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0, changed state to up R2(config-if)# R2(config-if)#int f0/0 R2(config-if)#description connection to PC2 R2(config-if)#ip address 192.168.30.1 255.255.255.0 R2(config-if)#no shutdown 王 振 民 2013.06.22 60 CCNA 筆 記

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up R2(config-if)# R2(config-if)#int f0/1 R2(config-if)#description connection to PC3 R2(config-if)#ip address 192.168.40.1 255.255.255.0 R2(config-if)#no shutdown %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up R2(config-if)# R2(config-if)#^Z %SYS-5-CONFIG_I: Configured from console by console R2# R2#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK] R2# 第 7 項 檢 視 R2 的 routing table R2#show ip route 10.0.0.0/24 is subnetted, 1 subnets C 10.1.4.0 is directly connected, Serial0/1/0 C 192.168.30.0/24 is directly connected, FastEthernet0/0 C 192.168.40.0/24 is directly connected, FastEthernet0/1 R2# 第 8 項 檢 視 Corp 的 routing table Corp#show ip route 王 振 民 2013.06.22 61 CCNA 筆 記

10.0.0.0/24 is subnetted, 4 subnets C 10.1.1.0 is directly connected, Vlan1 C 10.1.2.0 is directly connected, Serial0/0/0 C 10.1.3.0 is directly connected, Serial0/0/1 C 10.1.4.0 is directly connected, Serial0/1/0 Corp# 第 9 項 設 定 R3 router Router> Router>enable Router# Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# Router(config)#hostname R3 R3(config)#banner motd # this is my R3 router # R3(config)#no ip domain-lookup R3(config)#enable secret 123 R3(config)# R3(config)#line console 0 R3(config-line)#password 123 R3(config-line)#login R3(config-line)#logging synchronous R3(config-line)#exec-timeout 0 0 R3(config-line)#exit R3(config)# R3(config)#line vty 0 15 R3(config-line)#password 123 R3(config-line)#login R3(config-line)#exit R3(config)# R3(config)#interface fastethernet 0/0 R3(config-if)#description connection to Corp router R3(config-if)#ip address 10.1.5.2 255.255.255.0 R3(config-if)#no shutdown %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up R3(config-if)# %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up 王 振 民 2013.06.22 62 CCNA 筆 記

R3(config-if)# R3(config-if)#int f0/1 R3(config-if)#description connection to Laptop0 R3(config-if)#ip address 172.16.10.1 255.255.255.0 R3(config-if)#no shutdown %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up R3(config-if)# R3(config-if)#^Z R3# %SYS-5-CONFIG_I: Configured from console by console R3# R3#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK] R3# 第 10 項 檢 視 R3 的 routing table R3#show ip route 10.0.0.0/24 is subnetted, 1 subnets C 10.1.5.0 is directly connected, FastEthernet0/0 172.16.0.0/24 is subnetted, 1 subnets C 172.16.10.0 is directly connected, FastEthernet0/1 R3# 第 11 項 再 次 檢 視 Corp 的 routing table Corp#show ip route 10.0.0.0/24 is subnetted, 5 subnets C 10.1.1.0 is directly connected, Vlan1 C 10.1.2.0 is directly connected, Serial0/0/0 C 10.1.3.0 is directly connected, Serial0/0/1 王 振 民 2013.06.22 63 CCNA 筆 記

C C Corp# 10.1.4.0 is directly connected, Serial0/1/0 10.1.5.0 is directly connected, FastEthernet0/0 第 12 項 將 R3 router 設 定 啟 用 dhcp R3# R3#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R3(config)# R3(config)#ip dhcp pool admin R3(dhcp-config)#network 172.16.10.0 255.255.255.0 R3(dhcp-config)#default-router 172.16.10.1 R3(dhcp-config)#ip name-server 172.16.10.4 R3(dhcp-config)#exit R3(config)# R3(config)#ip dhcp excluded-address 172.16.10.1 172.16.10.10 R3(config)# R3(config)#exit R3# %SYS-5-CONFIG_I: Configured from console by console R3# 確 認 配 發 出 去 的 IP 位 址, 可 以 執 行 以 下 指 令 : R3# R3#show ip dhcp binding IP address Client-ID/ Lease expiration Type Hardware address 172.16.10.11 00E0.8F57.558A -- Automatic R3# 王 振 民 2013.06.22 64 CCNA 筆 記

第 4 節 靜 態 路 由 第 1 項 基 本 設 定 語 法 增 加 靜 態 路 由 的 方 式, 是 在 routing table 裡 增 加 一 筆 路 徑, 它 的 語 法 如 下 : ip route 目 的 網 路 遮 罩 下 一 跳 位 址 或 離 開 的 介 面 距 離 permanent 其 中, 距 離 的 選 項, 暫 時 可 以 直 覺 的 當 做 二 個 router 的 距 離, 數 字 越 大 的, 表 示 越 遠, 可 能 越 不 容 易 到 達, 數 字 越 小, 表 示 距 離 越 近, 應 該 越 容 易 到 達 如 果 都 不 做 設 定, 預 設 值 是 1 以 下 二 個 例 子 是 相 同 的 作 用 : ip route 192.168.10.0 255.255.255.0 10.1.2.2 ip route 192.168.10.0 255.255.255.0 s0/0/0 第 2 項 設 定 Corp router 的 靜 態 路 由 先 來 看 看 目 前 Corp router 的 Routing table 的 內 容 : Corp#show ip route 10.0.0.0/24 is subnetted, 5 subnets C 10.1.1.0 is directly connected, Vlan1 C 10.1.2.0 is directly connected, Serial0/0/0 C 10.1.3.0 is directly connected, Serial0/0/1 C 10.1.4.0 is directly connected, Serial0/1/0 C 10.1.5.0 is directly connected, FastEthernet0/0 Corp# 接 著 進 行 靜 態 路 由 的 設 定 : Corp# Corp#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Corp(config)# Corp(config)#ip route 192.168.10.0 255.255.255.0 10.1.2.2 150 Corp(config)#ip route 192.168.20.0 255.255.255.0 10.1.3.2 150 Corp(config)#ip route 192.168.30.0 255.255.255.0 10.1.4.2 150 Corp(config)#ip route 192.168.40.0 255.255.255.0 10.1.4.2 150 Corp(config)#ip route 172.16.10.0 255.255.255.0 10.1.5.2 150 Corp(config)#exit Corp# %SYS-5-CONFIG_I: Configured from console by console 王 振 民 2013.06.22 65 CCNA 筆 記