Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 實驗四 Router 的設定 觀察與嘗試設定 Routers. 2 參考文件 網路工程概論,蔡建新編著,文魁資訊 股份有限公司。

Similar presentations


Presentation on theme: "1 實驗四 Router 的設定 觀察與嘗試設定 Routers. 2 參考文件 網路工程概論,蔡建新編著,文魁資訊 股份有限公司。"— Presentation transcript:

1 1 實驗四 Router 的設定 觀察與嘗試設定 Routers

2 2 參考文件 網路工程概論,蔡建新編著,文魁資訊 股份有限公司。

3 3 大綱 學習目標 實驗設備與材料 實驗步驟與報告 成績計算 背景知識

4 4 學習目標 瞭解 Router 的架構。 知道如何設定 Router 的 ports ( fast Ethernet 、 serial port )與 static routing 以建立網路。

5 5 實驗設備與材料 notebooks 數台 每組一台 Router 具有 COM port 的 notebook USB 轉 COM port 的轉接頭

6 6 Network Configuration

7 7 實驗步驟與報告 利用 Telnet 連線至 Router ,輸入下面 命令,報告中詳細說明執行結果: show running-config show ip route show sessions show startup-config show cdp neighbors detail show cdp interface 嘗試使用其他的指令。

8 8 成績計算 每組依實驗報告的完整性決定成績。 完成的實驗項目越多,分數越高。 滿分 100 分。 同組同學將有相同的分數。

9 9 Cisco Router Structure The OS of Cisco routers is called as Internetwork Operating System (IOS). 命令執行檔 EXEC 是 IOS 的一部份,常駐 於 RAM 中,主要的功能是接收與執行輸 入 router 的命令。

10 10 Memories in Router Flash: 保管 OS 之 image file 及 micro-program 。 ROM: 含有開機診斷、 啟動 program 及 OS 。 NVRAM: 儲存 router 的 備用 configuration file 。 當 router 重新啟動時會 將其 copy 到 RAM 中。 RAN: 儲存 routing table 、 APR cache 、 packet buffer 、暫時的 routing configuration 。 CPU RAM ROM Flash NVRAM I/O port Interface WANLANConsoleAuxiliary

11 11 Interface (1/2) Router 連到網路的附件稱為 interface 或 port 。 每一個 interface 都必須擁有 獨一無二的 IP 位址 指出與 interface 相連的網路資訊 選擇 dynamic routing protocol 或 assign static routing information 及 default routing 。

12 12 Interface (2/2) 通常 router 會有四種 interface : 主控台埠( console ) 輔助埠( AUX ) 區域網路介面( Ethernet ) 廣域網路介面( Serial )

13 13 開機模式 Router 開機模式有三種: 從 Flash 載入 IOS ( default )。 從 ROM 載入 IOS ( next )。 手動設定何處載入 IOS ,用命令 b 啟動 router 。 NVRAM 的系統組態檔中的 configuration register 決定用哪一模式。 Ex: configuration register=0x2102 指用 Flash 載入 IOS 。

14 14 Router 開機程序 (1/2) Cisco router 開機後會執行 Power-on Self- Test 。 Router 從 ROM 執行所有硬體模組 診斷、確認 CPU memory 、 interface 基本 運作正常。 ROM 中的 bootstrap 會執行並載入位於 Flash 下的 IOS 。 IOS 也可能在 ROM 或用 TFTP 從 network server 中載入 。

15 15 Router 開機程序 (2/2) 逐行載入存在 NVRAM 中 config 組態檔案 到 RAM 中,並啟動 routing procedure , 提供 IP 給 interface 與媒體介面特性。 如果在 NVRAM 中沒有 config ,利用 TFTP 連上 network server 尋找 config ,如果還 是沒有,執行交談式的組態模組設定程 式,設定系統組態。

16 16 組態設定 Cisco router 在啟動時會用到 configuration file 中下列的資訊: Cisco IOS version Router identification 路由器識別 啟動檔案位置 協定資訊 介面組態設定

17 17 建立 Configuration Information 在特權模式下,由 console 或 virtual terminal 使用 command 來設定。 configure terminal 從 NVRAM 載入設定檔。 configure memory 在特權模式下,由 TFTP server 下載設定 檔到 RAM 中。 copy tftp running-config

18 18 儲存目前的 configuration 顯示目前 RAM 中的設定到螢幕上 show running-config 將 RAM 中的 configuration 存至 NVRAM copy running-config startup-config 將 RAM 中的 configuration 存至 TFTP server copy running-config tftp

19 19 Cisco Commands Two types of commands: Show command :用於檢視 router status 。 只有 show running-config, show startup-config 及 show access-list 需要在特權模式下才能使用。 Setup command :用於設定 router 。 Ex:ip address 192.168.5.254 255.255.255.0

20 20 Show Command CPU RAM ROM Flash NVRAM I/O port Interface Show memory Show running-config Show protocols Show ip route Show version Show sessions Show flash Show startup-config show interfaces show controllers

21 21 Command Mode 為了 security , router 有兩種 command 存 取等級: User EXE mode (使用者模式) 只能檢查 router 的一般狀態,不可改變 router 的 設定。 Privilege EXE mode (特權模式) 可改變 router 的設定,必須輸入 password 。

22 22 Levels of Commands Router>enable Password 輸入密碼 Router#configure terminal Router(config)#interface s0 Rouer(config-if)#no shutdown Router(config-if)#exit Router(config)#exit Router#exit Router> Router# enable disable 或 exit Router(config)# exit terminal Router(config-if)# 特定組態模式 介面組態模式( interface ) 子介面組態模式( subinterface ) 連線介面組態模式( line ) 路由器介面組態模式( router ) 使用者模式 特權模式 全域組 態模式 interface setup ^C 交談設定模式

23 23 Basic Command-User Mode (1/2) 可用問號找尋所要的 command ? /* 可看到所有 command */ show? /* 可看到 show 開頭的 command */ Router> 下常用的 command enable /* 進入特權模式 */ ping 192.168.3.1 telnet R4 traceroute R4

24 24 Basic Command-User Mode (2/2) Router> 下常用的 command show interfaces (sh int) show ip route /* 顯示 routing table*/ show protocols /* 顯示各介面運作情況 */ 介面運作情況有下面各種狀況 : 介面狀況 連線狀況 說明 up up 正常運作中 up down 沒有連接實體網路線或連線有問題 down up 介面有問題 down down 管理員用 shutdown 指令關閉該介面

25 25 Basic Command-Privileged Mode (1/2) Router# 下常用的 command 顯示存於 RAM 上目前使用的組態。 show running-config (sh run) 顯示存於 NVRAM 上下一次開機使用的組態。 show startup-config (sh start) 從 NVRAM 載入設定檔,併入 RAM 中組態。 copy running-config start-config (copy run start) 可清除 counter 重新計數。 clear counters show int /* 顯示數據 */

26 26 Basic Command-Privileged Mode (2/2) 鍵入 setup 便進入交談設定模式,開始設 定組態。用 ^C 離開,設定完畢後才執行 且存入 NVRAM 。 鍵入 config terminal 便進入全域組態模式, 選擇要設定的介面或設備,開始設定此 介面或設備。 R4#config terminal R4(config)#

27 27 全域組態設定 (1/4) 選擇要設定的介面等,鍵入介面名稱 ( ex: e0 、 s0 ),便進入介面組態模式, 開始設定此介面。 R4#config terminal R4(config)#int s 0 /* 設定 serial port 0 */ R4(config-if)#shut /* 關閉 s0 */ R4(config-if)#exit /* 離開 s0 的設定 */ R4(config)# /* 回到全域組態模式 */

28 28 全域組態設定 (2/4) 鍵入 router 便進入路由器組態模式,設定 路由器組態,設定使用的 routing protocol 。 R4#config terminal R4(config)#router ? /* 列出可用的路由協定, ex: rip 、 ospf*/ 根據不同路由協定,可設定其 distance 、 maximum-path 等。 R4(config-if)#no /* 取消設定 */

29 29 全域組態設定 (2/4) 使用 line ,進入連線組態模式,設定線路 組態。 進入路由器組態模式,設定路由器組態, 設定 routing protocol 。 設定 default gateway 。 設定 password (請不要使用)。 設定 access-list (下一實驗會講解。)

30 30 全域組態設定 (4/4) 設定 host name R3(config)#hostname Haha Haha(config)# 設定 banner mtod ( message of today ) 今日訊息,將顯示於所有連到此 router 的 terminal 上。 Haha(config)#ban mtod;Welcome to haha!

31 31 介面組態設定 在介面組態模式中可以設定此介面的 ip address 、 network mask clock rate of serial port ip access group (下一實驗會講解) encapsulation format 設定 layer 2 的封裝方式 for serial port Ex: hdlc 、 slip 、 ppp 、 frame-relay 、 x.25... shutdown /* 關閉該介面 */ no shutdown /* 開啟該介面 */

32 32 R8 設定範例 (1/3) R8>en 輸入密碼進入 privilege mode R8#sh run 顯示內部設定如 IP R8#sh inter 顯示內部介面的設定 down or up R8#sh ip route 顯示 routing 的設定 R8#config t 進入全域組態模式,設定 terminals R8(config)#inter fasteth 0/0 進入介面組態模式,設定 fast Ethernet 0/0 R8(config-if)#ip address 192.168.5.254 255.255.255.0 設定網域 IP address R8(config-if)#exit 離開 e0/0 的設定模式

33 33 R8 設定範例 (2/3) R8(config)#inter s0/0 進入介面組態模式,設定 serial port 0/0 ( 與 WAN 相接 ) R8(config-if)#ip address 192.168.104.110 255.255.255.252 設定網域 IP address R8(config-if)#band 1000000 設定傳輸速度為 100MHz R8(config-if)#encap ppp 設定採用 ppp 傳輸協定封裝資料 R8(config-if)#no shutdown 啟動 s0/0 R8(config-if)#exit 離開 s0/0 的設定模式

34 34 R8 設定範例 (3/3) R8(config)#ip route 0.0.0.0 0.0.0.0 192.168.104.109 設定 default route R8(config)#ip routing 啟動 routing 的設定 R8(config)#exit 離開全域組態模式 R8#wri 寫入 NVRAM

35 35 Cisco Discovery Protocol ( CDP ) CDP 提供取得與此 router 直接連結的 Cisco router 之組態摘要報告。 當 Cisco IOS 開機時, CDP 會自動啟動, 偵測周圍是否有執行 CDP 的 Cisco 設備。 CDP 屬於 data link layer , frame 很小且 simple ,定期交換彼此訊息。

36 36 CDP Commands 顯示自己 router 收到 CDP 更新資料 R8#show cdp neighbors 用表格顯示資料 R8#show cdp neighbors detail 顯示此裝置的資料( ex: R4 ) R8#show cdp entry R4 顯示自己各介面狀態 R8#show cdp interface


Download ppt "1 實驗四 Router 的設定 觀察與嘗試設定 Routers. 2 參考文件 網路工程概論,蔡建新編著,文魁資訊 股份有限公司。"

Similar presentations


Ads by Google