CCNA中文筆記第4章IOS介紹_第1頁
CCNA中文筆記第4章IOS介紹_第2頁
CCNA中文筆記第4章IOS介紹_第3頁
CCNA中文筆記第4章IOS介紹_第4頁
CCNA中文筆記第4章IOS介紹_第5頁
已閱讀5頁,還剩6頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、CCNA中文筆記第 4章:IOS介紹Chap ter4 In troduction to the Cisco IOSThe Cisco Router User In terfaceCisco Internetwork Operation System(IOS) 是 Cisco 的 routers 和 switches 的內(nèi)核Cisco Router IOSIOS的一些功能:1. 運(yùn)載網(wǎng)絡(luò)協(xié)議和功能2. 對產(chǎn)生高速流量的設(shè)備進(jìn)行連接3增加網(wǎng)絡(luò)安全性4提供網(wǎng)絡(luò)的可擴(kuò)展性來簡易化網(wǎng)絡(luò)的增長和冗余問題5可靠的連接網(wǎng)絡(luò)資源你可以通過以下方式進(jìn)入 IOS:1. 通過router的con sole 口,用于

2、本地2. 通過modem連接auxiliary(Aux) 口,用于遠(yuǎn)程3 .通過VTY線路來tel netBringing Up a Router當(dāng)啟動1個router的時候,大致將分為以下幾個階段:1. 開機(jī)自檢(power-on self-test,POST)2. 如果1正常,如果IOS存在的話,將從它的閃存(flash memory)查找和加載IOS到RAM中(2500系列不加載 RAM 中,直接從閃存中運(yùn)行).閃存是1種電子可擦除只讀存儲器(electronically erasable programmable read-only memory,EEPROM)3. 如果1和2正常,接

3、下來它將在非易失性RAM(NVRAM)中查找啟動配置文件 startup-config,假如沒有找到任 何啟動配置文件,router將進(jìn)入到setup模式Setup Modesetup模式可以對router進(jìn)行些配置,但是我們不推薦使用這個方法對router進(jìn)行配置.它分為2種模式:1. Basic Man ageme nt2. Exte nded Man ageme nt在setup模式中,代表默認(rèn)設(shè)置,你可以使用Ctrl+C隨時退出setup模式Comma nd-L ine In terface當(dāng)問你是否進(jìn)入setup模式,選擇no,即進(jìn)入命令行模式Loggi ng into the Ro

4、uter從用戶模式(user mode)進(jìn)入到特權(quán)模式(exec mode),注意提示符的變化:Routere nableRouter#從特權(quán)模式退出到用戶模式:Router#disableRouter退出router命令行:在用戶模式和特權(quán)模式下輸入logout,如下:Router#logoutRouter conO is now availablePress RETURN to get startedOverview of Router Modes配置router需要進(jìn)入到1個叫做配置模式的模式,在特權(quán)模式下輸入 con figure termi nal進(jìn)入全局配置模式(global co

5、n figuration mode),在這之下輸入的命令叫做全局命令,一旦輸入,將對整個router產(chǎn)生影響.如下,注意提示符的變化:Router#c onfigCon figruati on from term in al,memory or n etworkterm in al?(press En ter)Router(c on fig)#參數(shù) terminal,memory 和 network 的區(qū)另U :1. configure terminal:配置 router 的 running-config,所謂 running-config 即為當(dāng)前運(yùn)行在動態(tài)RAM(DRAM)的配置文件2.

6、 configure memory:配置 router 的 startup-config,所謂 startup-config 即為存儲在 router 的 NVRAM 里的配置文件3. configure network:配置存儲在TFTP主機(jī)的配置文件Interfaces在全局配置模式下切換router接口,輸入in terface命令,?用于提示可選參數(shù),為如下:Router(c on fig)# in terface ?(略)Serial Serial前半部分為參數(shù),后半部分為描述,接著輸入serial 0,進(jìn)入router接口配置模式,如下:Router(c on fig)# in t

7、erface serial 0Router(c on fig-if)#Subinterfaces在router的某個接口劃分邏輯子接口(sub in terface),輸入命令進(jìn)入子接口模式,如下,注意提示符:Router(co nfig)#i nterface fa0/0.?0-4294967295FastEhernet in terface numberRouter(co nfig)#i nterface fa0/0.1Router(c on fig-subif)#Line Command進(jìn)入線路配置模式,注意提示符,如下:Router(c on fig)#li ne con sole 0

8、Router(c on fig-li ne)#Routing Protocol Configurations給router配置路由協(xié)議,比如RIP,注意提示符,如下:Router(c on fig)#router ripRouter(c on fig-router)#從全局模式退出到特權(quán)模式可以使用快捷鍵Ctrl+ZEditing and Help Features一些特寫:1. 在命令行下輸入?,將得到該模式下可以使用的命令列表以及其描述2. 假如你不確定1個命令是如何寫的,比如你只記得是字母c開頭,你可以輸入c加1個?,將得到該模式下可以 使用的所有命令:Router#c?clear cl

9、ock con figurati on connect copyRouter#clock ?set Set the time and date3假如你輸入的命令不完整,將得到1個錯誤提示:lmcomplete comma nd,這樣有助于分析命令哪出錯了4. router支持命令縮寫,比如show可以縮寫為sh,sho,但是假如你像如下那樣輸入了不完整的縮寫,將得到錯誤提示:Ambiguous comma ndRouter#sh te% Ambiguous comma nd: sh teRouter#sh te?tech-support template term inal一切其他的快捷鍵:1

10、. Ctrl+A:把光標(biāo)快速移動到整行的最開始2. Ctrl+E:把光標(biāo)快速移動到整行的最末尾3. ESC+B:后退1個單詞4. Ctrl+B:后退1個字符5. ESC+F:前進(jìn)1個單詞6. Ctrl+F:前進(jìn)1個字符7. Ctrl+D:刪除單獨1個字符8. Backspace :刪除單獨1個字符9. Ctrl+R:重新顯示1行10. Ctrl+U:擦除1整行11. Ctrl+W:刪除1個單詞12. Tab:自動補(bǔ)齊命令13. Up arrow或者Ctrl+P:顯示之前最后輸入過的命令14. Down arrow或者Ctrl+N:顯示之前剛剛輸入過的命令其他的一些關(guān)于歷史的命令:1. show

11、 history:顯示最后輸入的10條命令,默認(rèn)是10條,可以修改該值2. terminal history size:修改顯示最后輸入過的的命令的數(shù)量,默認(rèn)是10條最大是256條3. show terminal:顯示命令歷史緩存大小,如下:Router#sh termi nal(略)History is en abled,history size is 10(略)Router#term inal history size ? Size of history bufferRouter#term inal history size 25Router#sh termi nal(略)History

12、is en abled,history size is 25(略)Gather Basic Rout ing In formatio nshow version:顯示系統(tǒng)硬件的基本配置和軟件版本,以及配置文件的名字和來源,還有啟動鏡象,最后是configuration register 的值Set Passwords:有5種密碼用于加密你的 Cisco router:1.控制口(console)2輔助口 (AUX)3. VTY4. e nable password5. e nable secretEnable Passwordsen able password給con sole和AUX 口加密

13、,防止未授權(quán)用戶進(jìn)入特權(quán)模式,但是密碼是非加密形式en able secret:給con sole和AUX 口加密,防止未授權(quán)用戶進(jìn)入特權(quán)模式 ,密碼是加密形式,并且一旦起用了這個密碼: 將凌駕于enable password之上,如果同時設(shè)置了 enable password和enable secret的情況下 必須輸入不同的密碼,如 下:Router(c on fig)#e nable secret 123Router(c on fig)#e nable secret 123The en able password you have chose n is the same as your

14、en able secret.This is not recomme nded.Re-e nter theen able passwordRouter(c on fig)#e nable secret 321如果VTY線路的密碼沒有設(shè)置,你將無法使用telnet來連上它Auxiliary Password配置AUX密碼:Router#c onf tRouter(c on fig)#li ne aux ? First li ne nu mberRouter(c on fig)#li ne aux 0Router(c on fig-li ne)#logi nRouter(c on fig-li n

15、e)#password 123Console Password配置con sole密碼以及一些輔助命令:Router#c onf tRouter(c on fig)#li ne con sole ? First li ne nu mberRouter(c on fig)#li ne con sole 0Router(c on fig-li ne)#logi nRouter(c on fig-li ne)#password 123Router(config-line)#exec-timeout ? Timeout in min utesRouter(config-line)#exec-timeo

16、ut 0 ?0-2147483Timeout in seco ndsRouter(config-line)#exec-timeout 0 0Router(c on fig-li ne)#loggi ng syn cho nousexec-timeout命令:如果X分鐘X秒不活動的話將自動退出,默認(rèn)是10分鐘,0 0代表永遠(yuǎn)不自動退出logging synchronous:光標(biāo)跟隨Telnet Password配置VTY密碼:如果你的IOS不是企業(yè)版(Enterprise edition),默認(rèn)你只能有 5條VTY線路,線路0到4.配置如下:Router(co nfig-li ne)#l ine

17、 vty 0 ? Last Line NumberRouter(c on fig-l in e)#li ne vty 0 4Router(c on fig-li ne)#logi nRouter(c on fig-li ne)#password 123剛才說過了,如果你的VTY線路沒有配置密碼的話,你將無法tel net連上它,它會報錯:VTY線路沒有配置密碼 但是你可以取消 VTY密碼,這樣就可以在沒有密碼的情況下進(jìn)行telnet,處于安全考慮,此方法不推薦,配置如下:Router(c on fig-l in e)#li ne vty 0 4Router(c on fig-li ne)# n

18、o logi nEn crypti on Your Passwords只有enable secret是加密的,當(dāng)你在特權(quán)模式下輸入sh running-config顯示DRAM的配置文件時,其他密碼將被羅列出來:Router#sh run(略)!en able secret jhdflkdfg$#sdfen able password 123!(略)對密碼進(jìn)行加密:在全局配置模式下使用service password-encryption命令Bannersbanner類似標(biāo)語,問候語.最常用的是 MOTD(message of the day),分界符用于分隔信息,但是分隔符不能出現(xiàn)在 MOT

19、D信息中,如下:Router(c on fig)#ba nner motd #The Router is mi ne#Router(co nfig)#AZ(Ctrl+Z)Router#exitRouter conO is now availablePress RETURN to get startedThe Router is mi neRouter其他的3種banner:l.exec banner2.i ncoming banner3ogin bannerRouter In terfaces配置router的接口,一般命令模式采用:in terface type number的格式,比如:R

20、outer(c on fig)# int ether net 0但是Cisco的2600,3600,4000和7000等系列采用了物理卡槽和模塊化的端口機(jī)制 .因此,命令變化為:in terface type slot/port,比如:Router(c on fig)# int fastether net 0% Imcomplete comma ndRouter(con fig)# int fastethernet 0?/Router(co nfig)# int fastethernet 0/? Fastether net in terface nu mberRouter(c on fig)#

21、 int fastether net 0/1配置連接器的介質(zhì)類型,使用media-type命令,不過這個一般是自動檢測,如下:Router(config)#int fa 0/0Router(c on fig-if)#media-type ?100BaseX Use RJ45 for -TX; SC F0 for -FXMII Use MII co nn ectorBring Up an In terface打開和關(guān)閉1個接口,分別使用shutdown和no shutdown命令,當(dāng)你關(guān)閉某個接口的時候 令可以查看接口狀態(tài),并且你將看到以下輸出:Router#sh int e0Ethernet0

22、 is administratively down,line protocol is down(略)接口是關(guān)閉的,所以你要手動打開它,如下:Router#c onf tRouter(c on fig)# int e0Router(c on fig-if)# no shutRouter(co nfig-if)#AZRouter#sh int e0Ether net is up,l ine protocol is up(略)Con figuri ng an IP Address on an In terface給某個接口配置 IP地址,使用ip address address mask命令,如下:

23、Router(c on fig)# int e0Router(co nfig-if)#ip address 記得把接口打開:Router(c on fig-if)# no shutRouter(co nfig-if)#AZ如果你需要在1個接口添加第二個子網(wǎng)地址,在末尾使用secondary參數(shù),這將替換現(xiàn)有Router(c on fig)# int e0Router(co nfig-if)#ip address seco ndaryRouter(co nfig-if)#AZ來驗證下:Route

24、r#sh run(略)!in terface Ethernet0,使用 sh in terfaces 命IP地址,如下:ip address seco ndaryip address !Serial In terface Comma ndsSerial 口一般是連接在 CSU/DSU等類型的提供時鐘頻率的設(shè)備上但是,假如你在個實驗環(huán)境里采用了背對背配置,那么1端將作為DCE設(shè)備提供時鐘頻率 默認(rèn)Cisco的router都是DTE,所以你必須讓1個serial接口來提供 時鐘頻率,采用的命令是:

25、clock rate,如下:Router(c on fig)# int s0Router(c on fig-if)#clock rate ?Speed (bits per sec ond)1200(略)5600064000(略)Router(config-if)#clock rate 64000% Error: This comma nds applies only to DCE in terfacesRouter(c on fig-if)# int s1Router(config-if)#clock rate 64000確定serial接口是否是 DCE線纜使用sh controllers命

26、令,如下:Routersh con trollers s 0HD un it 0, idb=0x297DE8, driver structure at 0x29F3A0Buffer size 1524 HD unit 0, V .35 DCE cableCisco的router的默認(rèn)serial連接帶寬是T-1(1.544Mbps).有的路由協(xié)議要以帶寬做為度來進(jìn)行衡量,所以,我們給它配置帶寬,使用bandwidth命令,注意參數(shù)單位是 kb,如下:Router(config-if)#bandwidth ?1-10000000Bandwidth in kilobitsRouter(config

27、-if)#bandwidth 64Hostnames給router配置主機(jī)名,使用host name命令,這個是本地標(biāo)志,不影響router在In ternet上的工作,注意回車立即生 效,如下:Router(config)#hostname NokoNoko(c on fig)#host name NocoNoco(c on fig)#Descriptionsdescription命令:本地標(biāo)志,可以給接口加描述,以便用于區(qū)分,如下:Noco(c on fig)# int e0Noco(config-if)#description Sales LANNoco(co nfig-if)#AZ來驗

28、證下:Noco#sh int e0(略)Descriptio n: Sales LAN(略)View ing and Saving Con figurati ons將 running-config(DRAM)的文件復(fù)制到 startup-config(NVRAM)里,使用 copy running-config startup-config 命令:Noco#copy run start可以使用 erase startup-config命令刪除 startup-config文件,如下:Noco#erase startup-c onfig(略)Noco#sh start% Non-volatile

29、 con figurati on memory is n ot prese nt假如在這個情況下在特權(quán)模式使用reload命令重新啟動router,將進(jìn)入setup模式Verify ing Your Con figurati onpi ng:采用了 ICMP echo requests 和 repliestraceroute:使用ICMP和IP TTL來跟蹤包所經(jīng)過的路徑Verify ing with the show ip in terface Comma ndshow ip in terface:提供router接口的層 3信息,包括:1接口狀態(tài)2.IP地址和掩碼3.訪問列表(access

30、-list)信息4一些其他的基本的IP信息Using the show ip in terface brief Comma ndshow ip in terface brief:和show ip in terface類似,只是提供簡潔點的總結(jié)信息Usi ng the show con trollers Comma ndsh controllers:顯示物理接口的信息,還提供serial 口線纜信息,如下:Router#sh con trollers serial 0/0(略)buffer size 1524 HD unit 0, V .35 DTE cable(略)Router#sh con trollers serial 0/1(略)buffer size 1524 HD unit 1, V .35 DCE cable(略)。When you are old and grey and full of sleep,And no ddi ng by the fire, take dow n this book,And slowly read, and dream of th

溫馨提示

  • 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)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論