




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、第4章:IOS介紹(網(wǎng)絡(luò)操作系統(tǒng))Chapter4 Introduction to the Cisco IOSThe Cisco Router User InterfaceCisco Internetwork Operation System(IOS)是Cisco 的routers和switches的內(nèi)核Cisco Router IOSIOS的一些功能:1.運載網(wǎng)絡(luò)協(xié)議和功能2.對產(chǎn)生高速流量的設(shè)備進行連接3.增加網(wǎng)絡(luò)安全性4.提供網(wǎng)絡(luò)的可擴展性來簡易化網(wǎng)絡(luò)的增長和冗余問題5.可靠的連接網(wǎng)絡(luò)資源你可以通過以下方式進入IOS:1.通過router的console口,用于本地2.通過modem連接
2、auxiliary(Aux)口,用于遠程3.通過VTY線路來telnetBringing Up a Router當(dāng)啟動1個router的時候,大致將分為以下幾個階段:1.開機自檢(power-on self-test,POST)2.如果1正常, 如果IOS存在的話,將從它的閃存(flash memory)查找和加載IOS到RAM中(2500系列不加載RAM中,直接從閃存中運行).閃存是1種電子可擦除只讀存儲器(electronically erasable programmable read-only memory,EEPROM)3.如果1和2正常,接下來它將在非易失性RAM(NVRAM)中查
3、找啟動配置文件startup-config,假如沒有找到任何啟動配置文件,router將進入到setup模式Setup Modesetup模式可以對router進行些配置,但是我們不推薦使用這個方法對router進行配置.它分為2種模式:1.Basic Management2.Extended Management在setup模式中,代表默認設(shè)置,你可以使用Ctrl+C隨時退出setup模式Command-Line Interface當(dāng)問你是否進入setup模式,選擇no,即進入命令行模式Logging into the Router從用戶模式(user mode)進入到特權(quán)模式(exec m
4、ode),注意提示符的變化:RouterenableRouter#從特權(quán)模式退出到用戶模式:Router#disableRouter退出router命令行:在用戶模式和特權(quán)模式下輸入logout,如下:Router#logoutRouter con0 is now availablePress RETURN to get startedOverview of Router Modes配置router,需要進入到1個叫做配置模式的模式,在特權(quán)模式下輸入configure terminal進入全局配置模式(global configuration mode),在這之下輸入的命令叫做全局命令,一旦輸
5、入,將對整個router產(chǎn)生影響.如下,注意提示符的變化:Router#configConfigruation from terminal,memory or networkterminal?(press Enter)Router(config)#參數(shù)terminal,memory和network的區(qū)別:1.configure terminal:配置router的running-config,所謂running-config即為當(dāng)前運行在動態(tài)RAM(DRAM)的配置文件2.configure memory: 配置router的startup-config,所謂startup-config即為存
6、儲在router的NVRAM里的配置文件3.configure network:配置存儲在TFTP主機的配置文件Interfaces在全局配置模式下切換router接口,輸入interface命令,?用于提示可選參數(shù),為如下:Router(config)#interface ?(略)Serial Serial前半部分為參數(shù),后半部分為描述,接著輸入serial 0,進入router接口配置模式,如下:Router(config)#interface serial 0Router(config-if)#Subinterfaces在router的某個接口劃分邏輯子接口(subinterface),
7、輸入命令進入子接口模式,如下,注意提示符:Router(config)#interface fa0/0.? FastEhernet interface numberRouter(config)#interface fa0/0.1Router(config-subif)#Line Command進入線路配置模式,注意提示符,如下:Router(config)#line console 0Router(config-line)#Routing Protocol Configurations給router配置路由協(xié)議,比如RIP,注意提示符,如下:Router(config)#router ripR
8、outer(config-router)#從全局模式退出到特權(quán)模式可以使用快捷鍵Ctrl+ZEditing and Help Features一些特寫:1.在命令行下輸入?,將得到該模式下可以使用的命令列表以及其描述2.假如你不確定1個命令是如何寫的,比如你只記得是字母c開頭,你可以輸入c加1個?,將得到該模式下可以使用的所有命令:Router#c?clear clock configuration connect copyRouter#clock ?set Set the time and date3.假如你輸入的命令不完整,將得到1個錯誤提示:Imcomplete command,這樣有助
9、于分析命令哪出錯了4.router支持命令縮寫,比如show可以縮寫為sh,sho,但是假如你像如下那樣輸入了不完整的縮寫,將得到錯誤提示:Ambiguous commandRouter#sh te% Ambiguous command: sh teRouter#sh te?tech-support template terminal一切其他的快捷鍵:1.Ctrl+A:把光標(biāo)快速移動到整行的最開始2.Ctrl+E:把光標(biāo)快速移動到整行的最末尾3.Esc+B:后退1個單詞4.Ctrl+B:后退1個字符5.Esc+F:前進1個單詞6.Ctrl+F:前進1個字符7.Ctrl+D:刪除單獨1個字符8.
10、Backspace:刪除單獨1個字符9.Ctrl+R:重新顯示1行10.Ctrl+U:擦除1整行11.Ctrl+W:刪除1個單詞12.Tab:自動補齊命令13.Up arrow或者Ctrl+P:顯示之前最后輸入過的命令14.Down arrow或者Ctrl+N:顯示之前剛剛輸入過的命令其他的一些關(guān)于歷史的命令:1.show history:顯示最后輸入的10條命令,默認是10條,可以修改該值2.terminal history size:修改顯示最后輸入過的的命令的數(shù)量,默認是10條,最大是256條3.show terminal:顯示命令歷史緩存大小,如下:Router#sh terminal
11、(略)History is enabled,history size is 10(略)Router#terminal history size ? Size of history bufferRouter#terminal history size 25Router#sh terminal(略)History is enabled,history size is 25(略)Gather Basic Routing Informationshow version:顯示系統(tǒng)硬件的基本配置和軟件版本,以及配置文件的名字和來源,還有啟動鏡象,最后是configuration register的值Set
12、 Passwords:有5種密碼用于加密你的Cisco router:1.控制口(console)2.輔助口(AUX)3.VTY4.enable password5.enable secretnable Passwordsenable password:給console和AUX口加密,防止未授權(quán)用戶進入特權(quán)模式,但是密碼是非加密形式enable secret:給console和AUX口加密,防止未授權(quán)用戶進入特權(quán)模式,密碼是加密形式,并且一旦起用了這個密碼,將凌駕于enable password之上,如果同時設(shè)置了enable password和enable secret的情況下,必須輸入不同
13、的密碼,如下:Router(config)#enable secret 123Router(config)#enable secret 123The enable password you have chosen is the same as your enable secret.This is not recommended.Re-enter the enable passwordRouter(config)#enable secret 321如果VTY線路的密碼沒有設(shè)置,你將無法使用telnet來連上它Auxiliary Password配置AUX密碼: Router#conf tRout
14、er(config)#line aux ? First line numberRouter(config)#line aux 0Router(config-line)#loginRouter(config-line)#password 123Console Password配置console密碼以及一些輔助命令:Router#conf tRouter(config)#line console ? First line numberRouter(config)#line console 0Router(config-line)#loginRouter(config-line)#password
15、123Router(config-line)#exec-timeout ? Timeout in minutesRouter(config-line)#exec-timeout 0 ? Timeout in secondsRouter(config-line)#exec-timeout 0 0Router(config-line)#logging synchonousexec-timeout命令:如果X分鐘X秒不活動的話將自動退出,默認是10分鐘,0 0代表永遠不自動退出logging synchronous:光標(biāo)跟隨Telnet Password配置VTY密碼:如果你的IOS不是企業(yè)版(En
16、terprise edition),默認你只能有5條VTY線路,線路0到4.配置如下:Router(config-line)#line vty 0 ? Last Line NumberRouter(config-line)#line vty 0 4Router(config-line)#loginRouter(config-line)#password 123剛才說過了,如果你的VTY線路沒有配置密碼的話,你將無法telnet連上它,它會報錯:VTY線路沒有配置密碼.但是你可以取消VTY密碼,這樣就可以在沒有密碼的情況下進行telnet,處于安全考慮,此方法不推薦,配置如下:Router(co
17、nfig-line)#line vty 0 4Router(config-line)#no loginEncryption Your Passwords只有enable secret是加密的,當(dāng)你在特權(quán)模式下輸入sh running-config顯示DRAM的配置文件時,其他密碼將被羅列出來:Router#sh run(略)!enable secret jhdflkdfg$#sdfenable password 123!(略)對密碼進行加密:在全局配置模式下使用service password-encryption命令Bannersbanner類似標(biāo)語,問候語.最常用的是MOTD(messag
18、e of the day),分界符用于分隔信息,但是分隔符不能出現(xiàn)在MOTD信息中,如下:Router(config)#banner motd #The Router is mine#Router(config)#Z(Ctrl+Z)Router#exitRouter con0 is now availablePress RETURN to get startedThe Router is mineRouter其他的3種banner:1.exec banner2.incoming banner3.login bannerRouter Interfaces配置router的接口,一般命令模式采用:
19、interface type number的格式,比如:Router(config)#int ethernet 0但是Cisco的2600,3600,4000和7000等系列采用了物理卡槽和模塊化的端口機制.因此,命令變化為:interface type slot/port,比如:Router(config)#int fastethernet 0% Imcomplete commandRouter(config)#int fastethernet 0?/Router(config)#int fastethernet 0/? Fastethernet interface numberRouter
20、(config)#int fastethernet 0/1配置連接器的介質(zhì)類型,使用media-type命令,不過這個一般是自動檢測,如下:Router(config)#int fa 0/0Router(config-if)#media-type ?100BaseX Use RJ45 for -TX; SC F0 for FXMII Use MII connectorBring Up an Interface打開和關(guān)閉1個接口,分別使用shutdown和no shutdown命令,當(dāng)你關(guān)閉某個接口的時候,使用sh interfaces命令可以查看接口狀態(tài),并且你將看到以下輸出:Router#s
21、h int e0Ethernet0 is administratively down,line protocol is down(略)接口是關(guān)閉的,所以你要手動打開它,如下:Router#conf tRouter(config)#int e0Router(config-if)#no shutRouter(config-if)#ZRouter#sh int e0Ethernet is up,line protocol is up(略)Configuring an IP Address on an Interface給某個接口配置IP地址,使用ip address address mask命令,如
22、下:Router(config)#int e0Router(config-if)#ip address 記得把接口打開:Router(config-if)#no shutRouter(config-if)#Z如果你需要在1個接口添加第二個子網(wǎng)地址,在末尾使用secondary參數(shù),這將替換現(xiàn)有IP地址,如下:Router(config)#int e0Router(config-if)#ip address secondaryRouter(config-if)#Z來驗證下:Router#sh r
23、un(略)!interface Ethernet0ip address secondaryip address !Serial Interface CommandsSerial口一般是連接在CSU/DSU等類型的提供時鐘頻率的設(shè)備上.但是,假如你在個實驗環(huán)境里采用了背對背配置,那么1端將作為DCE設(shè)備提供時鐘頻率.默認Cisco的router都是DTE,所以你必須讓1個serial接口來提供時鐘頻率,采用的命令是:clock rate,如下:Router(config)#int s0Route
24、r(config-if)#clock rate ?Speed (bits per second)1200(略)5600064000(略)Router(config-if)#clock rate 64000% Error: This commands applies only to DCE interfacesRouter(config-if)#int s1Router(config-if)#clock rate 64000確定serial接口是否是DCE線纜使用sh controllers命令,如下:Routersh controllers s 0HD unit 0, idb=0x297DE8
25、, driver structure at 0x29F3A0Buffer size 1524 HD unit 0, V.35 DCE cableCisco的router的默認serial連接帶寬是T-1(1.544Mbps).有的路由協(xié)議要以帶寬做為度來進行衡量,所以,我們給它配置帶寬,使用bandwidth命令,注意參數(shù)單位是kb,如下:Router(config-if)#bandwidth ? Bandwidth in kilobitsRouter(config-if)#bandwidth 64Hostnames給router配置主機名,使用hostname命令,這個是本地標(biāo)志,不影響router在Internet上的工作,注意回車立即生效,如下:Router(config)#hostname NokoNoko(config)#hostname NocoNoco(config)#Descriptionsdescription命令:本地標(biāo)志,可以給接口加描述,以便用于區(qū)分,如下:Noco(config)#int e0Noco(config-if)#description Sales LANNoco(config-if)#Z來驗證下:Noco#sh int e0(略)Description: Sales LAN(略)Viewing and Saving
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 網(wǎng)絡(luò)工程師成長需要具備的素質(zhì)試題及答案
- 西方政治制度與科技創(chuàng)新的關(guān)系試題及答案
- 安全法律培訓(xùn)試題及答案
- 安全發(fā)展理念試題及答案
- 安全度測試題及答案
- 關(guān)于項目管理的學(xué)術(shù)論文探討試題及答案
- 2025年人工智能芯片在智能教育領(lǐng)域的應(yīng)用趨勢研究報告
- 信息系統(tǒng)項目管理師考試方法創(chuàng)新與心理調(diào)適技巧試題及答案
- 機電工程專業(yè)認證與試題及答案指南
- 公共政策的成本效益評估方法試題及答案
- 設(shè)備故障應(yīng)急維修預(yù)案
- (3篇)2025年春季形勢與政策大作業(yè):怎樣正確理解全過程人民民主的歷史邏輯、實踐邏輯、理論邏輯?與專題測驗(1-5)附答案
- 吉林2025年生態(tài)環(huán)境部松遼流域生態(tài)環(huán)境監(jiān)督管理局生態(tài)環(huán)境監(jiān)測與科學(xué)研究中心招聘筆試歷年參考題庫附帶答案詳解
- TSG Z7002-2022特種設(shè)備檢測機構(gòu)核準規(guī)則
- 鍋爐檢修作業(yè)安全保障方案
- 2025-2030中國三醋酸纖維素膜行業(yè)市場現(xiàn)狀供需分析及投資評估規(guī)劃分析研究報告
- 綜合新聞類報紙出版服務(wù)行業(yè)跨境出海戰(zhàn)略研究報告
- 三基三嚴培訓(xùn)課件
- 3D打印技術(shù)考試試卷及答案
- 人教版六年級上冊數(shù)學(xué)百分數(shù)應(yīng)用題專題分類復(fù)習(xí)(課件)
- 中職高教版(2023)語文職業(yè)模塊-第五單元:走近大國工匠(一)展示國家工程-了解工匠貢獻【課件】
評論
0/150
提交評論