課程大綱

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

CCNA 講義

mppp-ddr.pdf

ch08.PDF

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

IP505SM_manual_cn.doc

epub

12.pdf

Simulator By SunLingxi 2003

AL-M200 Series

版权声明

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

F5270

工程师培训

ebook140-8

ebook140-9

IP-Routing-05.pdf

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

Microsoft Word - CCNA2_Exploration_instructor_40_CoverSheet.DOC

Procedural Lab Template, Student Version, Required Components

一、选择题

R3105+ ADSL

GPRS IP MODEM快速安装说明

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

ARP ICMP

財金資訊-80期.indd

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

ebook20-8

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

计算机网络概论

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

TPM BIOS Infineon TPM Smart TPM Infineon TPM Smart TPM TPM Smart TPM TPM Advanced Mode...8

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

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

Packet Tracer实验集

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

Cisco Lab - Switch

一.NETGEAR VPN防火墙产品介绍

ebook20-7

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

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

IP Access Lists IP Access Lists IP Access Lists

Chapter 2

(UTM???U_935_938_955_958_959 V )


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

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

P4i45GL_GV-R50-CN.p65

ebook140-11

untitled

第3章

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

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

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

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

PTS7_Manual.PDF

active phisical rp address: backup phisical rp address: 截取部分 TOPO 图说明到 不通的问题 : internet internet tengige 0/0/0/0 tengige

AL-MX200 Series

路由器基本配置

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

Bus Hound 5

穨CAS1042快速安速說明.doc

ansoft_setup21.doc

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

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

QL1880new2.PDF

Windows 2000 Server for T100

NSC-161


Guide to Install SATA Hard Disks

自由軟體教學平台

自由軟體教學平台

ebook71-13

自由軟體教學平台

ext-web-auth-wlc.pdf

68369 (ppp quickstart guide)

KL DSC DEMO 使用说明

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

T

K7VT2_QIG_v3

Cisco Switch 操作

專業式報告

SAPIDO GR-1733 無線寬頻分享器

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

网工新答案

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

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

穨CAS1042中文手冊.doc

Windows XP

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

P4VM800_BIOS_CN.p65

C3_ppt.PDF

9 Internet 10 Internet

ICD ICD ICD ICD ICD

epub 30-12

T

專業式報告

Cisco Lab - Switch

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

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 節靜態路由... 64 第 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.15 1 CCNA 筆記

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

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

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

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

8. 安裝完成, 按 Finish 時會同時啟動 Packet Tracer 9. 第一次執行時會顯示以下對話框, 當我們在 Packet Tracer 建立網路環境, 要 儲存時, 可以在 Options/Preferences 指定預設的儲存路徑 10. 如果系統有開啟防火牆, 就會顯示以下的安全性警訊, 請按 解除封鎖 王振民 2013.06.15 6 CCNA 筆記

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

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

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

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

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

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

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

Startup config file 被讀取後, 就稱為 running config, 所以我們在做設定時, 都是在 running 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.15 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.15 16 CCNA 筆記

操作練習請繼續前項的操作環境來做練習 : 1. 在 privileged mode 下輸入 configure 可以進入 config mode, 有三個選項, 所以系統會問我們要進入那一個項目, 也可以直接輸成 configure 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.15 17 CCNA 筆記

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

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

5. 再將 router 的電源重新啟動 由於跳過 startup configuration, 所以會自 動進入 setup mode, 輸入 no 跳過它 6. 執行 enable 進入 privileged mode, 再執行 copy start run 讀出設 定內容 王振民 2013.06.15 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.15 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.15 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.15 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.15 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.15 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# Router#configure terminal 王振民 2013.06.15 26 CCNA 筆記

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. telnt(vty) 密碼 其中第 1 2 這二個密碼, 是當我們在 User mode 輸入 enable 要進入 Privileged mode 時, 系統要求我們輸入的密碼, 主要是透過密碼保護 Privileged mode 另外三個, 分別就是我們由控制台 輔助埠 telnet 的方式連線時, 要求我們輸入的密碼 王振民 2013.06.15 27 CCNA 筆記

第 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# 第 6 項設定 line 密碼 使用者的密碼, 有以下三種 : 1. line aux, 使用輔助埠連線的使用者密碼 王振民 2013.06.15 28 CCNA 筆記

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 Router# 王振民 2013.06.15 29 CCNA 筆記

重新按 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 Router(config-line)# Router(config-line)#password 222 王振民 2013.06.15 30 CCNA 筆記

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 ^ % Invalid input detected at '^' marker. R1(config)#do sh run Building configuration... 王振民 2013.06.15 31 CCNA 筆記

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)# R1(config-if)#ip address 192.168.1.254 255.255.255.0 R1(config-if)# R1(config-if)#no shutdown 王振民 2013.06.15 32 CCNA 筆記

%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! version 12.4 no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption 王振民 2013.06.15 33 CCNA 筆記

! 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!!!! line con 0 exec-timeout 0 0 王振民 2013.06.15 34 CCNA 筆記

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 redirected output to URL (URLs supporting append operation only) begin Begin with the line that matches exclude Exclude lines that match include Include lines that match redirect Redirect output to URL 王振民 2013.06.15 35 CCNA 筆記

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 clock rate 2000000 R1# 王振民 2013.06.15 36 CCNA 筆記

第 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, 自己動手做設定 第 5 項 show interfaces- 顯示界面資訊 在 Privileged mode 輸入 show interfaces, 可以顯示所有界面的狀態, 如果覺得只 王振民 2013.06.15 37 CCNA 筆記

想要看單一介面的狀態, 也可以直接選擇該界面, 操作如下 : 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 之間, 也可以看到 Encapsulation 這裡的內容是不太一樣的 每個介面都會統計該界面上的流量, 如果要清除的話, 可以執行以下指令 ( 在 Packet Tracer 裡無法使用 ): Router#clear counters fastethernet 0/0 Clear "show interface" counters on this interface [confirm] 王振民 2013.06.15 38 CCNA 筆記

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 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 王振民 2013.06.15 39 CCNA 筆記

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# 第 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 王振民 2013.06.15 40 CCNA 筆記

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.15 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) 2 Low-speed serial(sync/async) network interface(s) 王振民 2013.06.15 42 CCNA 筆記

239K bytes of NVRAM. 62720K bytes of processor board System flash (Read/Write) Configuration register is 0x2102 R1# 這裡標示為藍色的 0x2102, 是這個設備的組態設定, 展開為位元型態, 就可以知道它的第 13 8 1 的位元是 1, 是開啟的 每個位元都有它的意義與作用, 這部份請參考書籍 P.7-5 的內容 如果第 6 個位元也開啟的話 (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 Specify the holdtime (in sec) to be sent in packets log Log messages generated by CDP run Enable CDP 王振民 2013.06.15 43 CCNA 筆記

source-interface Insert the interface's IP in all CDP packets timer Specify rate (in sec) at which CDP packets are sent 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.15 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.15 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.15 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.15 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.15 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.15 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.15 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.15 51 CCNA 筆記

area 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 * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set C C C C R1# 10.0.0.0/24 is subnetted, 4 subnets 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.15 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.15 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)# Corp(config-if)#int f1/1 王振民 2013.06.15 54 CCNA 筆記

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)# Corp(config-if)#int f0/0 Corp(config-if)#description connection to R3 王振民 2013.06.15 55 CCNA 筆記

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# 第 3 項設定 R1 router 王振民 2013.06.15 56 CCNA 筆記

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 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 王振民 2013.06.15 57 CCNA 筆記

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# 第 4 項檢視 R1 的 routing table R1# R1#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP 王振民 2013.06.15 58 CCNA 筆記

area 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 * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set C C C C R1# 10.0.0.0/24 is subnetted, 2 subnets 10.1.2.0 is directly connected, Serial0/0/0 10.1.3.0 is directly connected, Serial0/0/1 192.168.10.0/24 is directly connected, FastEthernet0/0 192.168.20.0/24 is directly connected, FastEthernet0/1 第 5 項再次檢視 Corp 的 routing table Corp# 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.15 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.15 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.15 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.15 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.15 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# 第 4 節 靜態路由 第 1 項基本設定語法 增加靜態路由的方式, 是在 routing table 裡增加一筆路徑, 它的語法如下 : ip route 目的網路遮罩下一跳位址或離開的介面距離 permanent 王振民 2013.06.15 64 CCNA 筆記

其中, 距離的選項, 暫時可以直覺的當做二個 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 Corp# 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 王振民 2013.06.15 65 CCNA 筆記

172.16.0.0/24 is subnetted, 1 subnets S 172.16.10.0 [150/0] via 10.1.5.2 S 192.168.10.0/24 [150/0] via 10.1.2.2 S 192.168.20.0/24 [150/0] via 10.1.3.2 S 192.168.30.0/24 [150/0] via 10.1.4.2 S 192.168.40.0/24 [150/0] via 10.1.4.2 Corp# 第 3 項 Corp ok, 但伺服器群和其它 router 還不 ok 目前在 Corp router 上, 己經知道要連到其它幾個網段時, 分別要由那些 IP 位址傳送, 我們可以在 Corp router 裡去 ping 其它的 IP 位址, 應該都可以正常回應, 例如 : Corp#ping 192.168.10.11 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.10.11, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 5/8/12 ms Corp# Corp#Corp#ping 192.168.30.11 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.30.11, timeout is 2 seconds:.!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 3/6/9 ms Corp# 不過, 在其它 router 上還沒做對等的設定之前, 我們在其它的 router 裡還無法 連到其它的網段, 例如,R1 目前還是無法 ping 到 192.168.30.11 的主機, 如下 : R1#ping 192.168.30.11 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.30.11, timeout is 2 seconds:... Success rate is 0 percent (0/5) R1# 而且, 如果我們由 WWW 伺服器 ping 192.168.10.11 時, 會發現網路是不通的, 王振民 2013.06.15 66 CCNA 筆記

如下 : SERVER>ping 192.168.10.11 Pinging 192.168.10.11 with 32 bytes of data: Request timed out. Request timed out. Request timed out. Request timed out. Ping statistics for 192.168.10.11: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss), SERVER> 這是由於其它的 router 還不知道 Corp 所連接的伺服器群 (10.1.1.0) 要怎麼傳送, 因此, 如果我們由伺服器群的某台電腦去 ping 192.168.10.11 時, 由於 R1 router 不知道 10.1.1.0 網段的 IP 要怎麼傳送, 因此, 由伺服器群來的封包, 會因為沒有回去的路徑, 被 R1 router 丟棄 底下我們使用 debug ip icmp 指令, 開啟 icmp 的 debug 動作, 在 WWW 進行 ping 的動作時, 這裡會顯示一些訊息, 提供我們參考 : R1#debug ip icmp ICMP packet debugging is on R1# R1# ICMP: dst (10.1.1.11) host unreachable sent to 192.168.10.11 R1# ICMP: dst (10.1.1.11) host unreachable sent to 192.168.10.11 R1# ICMP: dst (10.1.1.11) host unreachable sent to 192.168.10.11 R1# ICMP: dst (10.1.1.11) host unreachable sent to 192.168.10.11 R1# 如果要關掉 debug 功能, 參考以下動作 : R1#no debug all All possible debugging has been turned off R1# 王振民 2013.06.15 67 CCNA 筆記

第 4 項設定 R1 router 參考以下動作設定 : R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)# R1(config)#ip route 10.1.1.0 255.255.255.0 10.1.2.1 150 R1(config)#ip route 10.1.4.0 255.255.255.0 10.1.3.1 150 R1(config)#ip route 192.168.30.0 255.255.255.0 10.1.3.1 150 R1(config)#ip route 192.168.40.0 255.255.255.0 10.1.2.1 150 R1(config)#ip route 10.1.5.0 255.255.255.0 10.1.2.1 150 R1(config)#ip route 172.16.10.0 255.255.255.0 10.1.3.1 150 R1(config)#exit R1# %SYS-5-CONFIG_I: Configured from console by console R1# 在 Corp 與 R1 之間實際上是有二個線路連接的, 因此, 我們在設定路由時, 其實 可以多加考慮, 那些網段該走那個線路! 前項所設的靜態路由, 不見得是最好的 方式, 想想看, 如果是你, 會怎麼規劃? 再來看看 R1 的 routing table, 如下 : R1#show ip route 10.0.0.0/24 is subnetted, 5 subnets S 10.1.1.0 [150/0] via 10.1.2.1 C 10.1.2.0 is directly connected, Serial0/0/0 C 10.1.3.0 is directly connected, Serial0/0/1 S 10.1.4.0 [150/0] via 10.1.3.1 S 10.1.5.0 [150/0] via 10.1.2.1 172.16.0.0/24 is subnetted, 1 subnets S 172.16.10.0 [150/0] via 10.1.3.1 C 192.168.10.0/24 is directly connected, FastEthernet0/0 C 192.168.20.0/24 is directly connected, FastEthernet0/1 S 192.168.30.0/24 [150/0] via 10.1.3.1 S 192.168.40.0/24 [150/0] via 10.1.2.1 R1# 王振民 2013.06.15 68 CCNA 筆記

第 5 項伺服器群可以連到 R1 的二個網段 R1 的靜態路由設定完成後, 因為 R1 己經知道伺服器群的 10.1.1.0 網路要由那一個 IP 傳送, 因此, 現在伺服器群的電腦, 就可以 ping 到 192.168.10.0 與 192.168.20.0 的電腦囉! 如下 : SERVER>ping 192.168.10.11 Pinging 192.168.10.11 with 32 bytes of data: Reply from 192.168.10.11: bytes=32 time=10ms TTL=126 Reply from 192.168.10.11: bytes=32 time=16ms TTL=126 Reply from 192.168.10.11: bytes=32 time=9ms TTL=126 Reply from 192.168.10.11: bytes=32 time=16ms TTL=126 Ping statistics for 192.168.10.11: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 9ms, Maximum = 16ms, Average = 12ms SERVER> 第 6 項設定 R2 router R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R2(config)# R2(config)#ip rou R2(config)#ip route 10.1.1.0 255.255.255.0 10.1.4.1 150 R2(config)#ip route 10.1.2.0 255.255.255.0 10.1.4.1 150 R2(config)#ip route 10.1.3.0 255.255.255.0 10.1.4.1 150 R2(config)#ip route 10.1.5.0 255.255.255.0 10.1.4.1 150 R2(config)#ip route 192.168.10.0 255.255.255.0 10.1.4.1 150 R2(config)#ip route 192.168.20.0 255.255.255.0 10.1.4.1 150 R2(config)#ip route 172.16.10.0 255.255.255.0 10.1.4.1 150 R2(config)#exit R2# %SYS-5-CONFIG_I: Configured from console by console R2# R2#show ip route 王振民 2013.06.15 69 CCNA 筆記