《實驗一--Cisco-IOS操作》由會員分享,可在線閱讀,更多相關(guān)《實驗一--Cisco-IOS操作(7頁珍藏版)》請在裝配圖網(wǎng)上搜索。
1、實驗一 Cisco IOS 操作
實驗學(xué)時:2
實驗類型:驗證
一、實驗?zāi)康?
⑴ 掌握路由器基本配置命令;
⑵ 掌握TFTP的安裝與配置,掌握路由器IOS備份、升級方法;
⑶ 掌握路由器口令恢復(fù)的方法。
二、實驗條件
Cisco2621 Router、PacketTrace仿真軟件、具備Windows操作系統(tǒng)的PC機
三、實驗原理及相關(guān)知識
Packet Trace路由仿真軟件的使用,路由器組成及啟動順序,配置寄存器和口令恢復(fù),備份及恢復(fù)IOS和配置文件,升級路由器IOS。
TFTP(trivial file transfer protocol)即簡單文件傳輸協(xié)議,是允
2、許文件在網(wǎng)絡(luò)中從一臺主機傳輸?shù)搅硪慌_主機的簡化的FTP 版本,大多數(shù)網(wǎng)絡(luò)設(shè)備的軟件升級均采用TFTP 方式。
四、實驗步驟
1. 路由器基本配置
⑴ 配置路由器A
Router>en //進入特權(quán)模式
Router#config t //進入全局模式
Router(config)#hostname LabA //設(shè)置主機名
Lab_A(config)#enable secret x203 //設(shè)置加密口令,由用戶模式進入特權(quán)模式起作用。
Lab_A(config)#interface fa0/0 //進入Fastethernet 0/
3、0子接口模式
Lab_A(config-if)#ip address 192.168.0.1 255.255.255.0 //配置Fa0/0接口的IP地址
Lab_A(config-if)#description Lab_A LAN Connection //配置Fa0/0接口的描述字符
Lab_A(config-if)#no shutdown //激活Fa0/0接口
激活Fa0/0接口后,再查看路由器與交換機連接線兩端的狀態(tài)狀態(tài)變化。
Lab_A(config-if)#interface s1/0 //進入serial 1/0子接口模式
Lab_A(confi
4、g-if)#ip address 192.168.1.1 255.255.255.0 //配置serial 0/0接口IP地址
Lab_A(config-if)#description WAN Connection to Lab_B //配置serial 0/0接口的描述字符
Lab_A(config-if)#no shut //激活serial 0/0接口
Lab_A(config-if)#exit //退出子接口模式,返回全局模式
Lab_A(config)#line console 0 //進入Console子接口模式
Lab_A(conf
5、ig-line)#password x203 //配置Console登陸密碼
Lab_A(config-line)#login
Lab_A(config-line)#line vty 0 4 //進入Vty子接口模式
Lab_A(config-line)#password x203 //配置Vty登陸密碼,可以有五個Telnet
Lab_A(config-line)#login
Lab_A(config-line)#exit //退出子接口模式,返回全局模式
Lab_A(config)#banner motd #[Enter] //設(shè)置
6、Banner信息,以字符“#”結(jié)束輸入
This is the Lab_A router!#
Lab_A(config)#^z //即Ctrl+Z的組合鍵,可直接返回特權(quán)模式
Lab_A#copy running-config startup-config //保存上面所做的所有配置
Destination filename [startup-config]? [Enter]
Lab_A# //特權(quán)模式
⑵ 配置路由器B
Router>en //進入特權(quán)模式
Router#config t //進入全局模
7、式
Router(config)#hostname Lab_B //設(shè)置主機名
Lab_B(config-if)#interface s1/0 //進入serial 1/0子接口模式
Lab_B(config-if)#ip address 192.168.1.2 255.255.255.0 //配置serial 0/0接口IP地址
Lab_B(config-if)#description WAN Connection to Lab_A //配置serial 0/0接口的描述字符
Lab_B(config-if)#clock rate 9600
Lab_B(co
8、nfig-if)#no shut //激活serial 0/0接口
⑶ 查看當(dāng)前路由器配置
Lab_A#show running-config //查看路由器當(dāng)前的配置信息。
Lab_A#show startup-config //查看nvram 中的路由器配置信息。
Lab_A#show version //查看IOS版本號,已啟動時間,flash中的IOS的文件名,router里面共有什么的端口,寄存器的值等等。
Lab_A#show flash //查看flash中的內(nèi)容,IOS的長度,文件名,剩余空間,總空間。
9、
2. TFTP軟件安裝
⑴ 配置環(huán)境
配置PC0的IP地址,并測試其與路由器的連通性。
⑵ TFTP軟件安裝與設(shè)置
在PC0上安裝TFTP軟件,并設(shè)置其文件目錄為D盤根目錄。具體設(shè)置為“查看”-“選項”-“TFTP 服務(wù)器根目錄”,選擇D盤即可。
本實驗在Packet Tracer中模擬實現(xiàn),因為PC0不能安裝TFTP軟件,所以選用默認有TFTP功能的Server-TP終端進行驗證實驗。
3. IOS備份與升級
⑴ 查看操作系統(tǒng)的名稱
LabA#sh flash
System flash directory:
File Length Name/status
10、3 50938004 c2800nm-advipservicesk9-mz.124-15.T1.bin //不同的路由器操作系統(tǒng)的名稱不同
2 28282 sigdef-category.xml
1 227537 sigdef-default.xml
[51193823 bytes used, 12822561 available, 64016384 total]
63488K bytes of processor board System flash (Read/Write)
⑵ 備份操作系統(tǒng)
LabA#copy flash: tftp
Sour
11、ce filename []? c2800nm-advipservicesk9-mz.124-15.T1.bin
//此處詢問你要求備份的flash的文件名,輸入Cisco IOS的名稱即可,然后press ENTER。
Address or name of remote host []? 192.168.0.2
//此處詢問你要求存放你的flash的服務(wù)器的地址是什么,這里我們輸入TFTP Server的地址,然后press ENTER。
Destination filename [c2800nm-advipservicesk9-mz.124-15.T1.bin]?
//此處
12、詢問在目的地保存該flash的文件名?我們在此輸入Cisco IOS的名稱即可。
Writing c2800nm-advipservicesk9-mz.124-15.T1.bin....!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 50938
13、004 bytes]
50938004 bytes copied in 10.739 secs (4743000 bytes/sec)
LabA#
以上的信息說明你的保存已經(jīng)成功完成了,copy flash tftp已經(jīng)成功完成了,一旦這個復(fù)制命令完成了,路由器會告訴我們,復(fù)制過去的文件占用了TFTP Server多少空間,一共耗時多少。
備份完成后,查看PC0 D盤是否有操作系統(tǒng)。
⑶ 升級IOS
LabA#cop tftp: flash:
Address or name of remote host []? 192.168.0.2 //TFTP服務(wù)器地址
Source
14、filename []? c2800nm-advipservicesk9-mz.124-15.T1 //需升級的新IOS映象文件名
Destination filename [c2800nm-advipservicesk9-mz.124-15.T1.bin]? c2800nm-advipservicesk9-mz.124-15.T1.bin
%Warning:There is a file already existing with this name
Do you want to over write? [confirm]
Erase flash: before copying?
15、[confirm]
Erasing the flash filesystem will remove all files! Continue? [confirm]
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased
Erase of flash: complete
Accessing tftp://1
16、92.168.0.3/c2800nm-advipservicesk9-mz.124-15.T1.bin...
Loading c2800nm-advipservicesk9-mz.124-15.T1.bin from 192.168.0.3: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
17、!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 50938004 bytes]
50938004 bytes copied in 59.179 secs (62410 bytes/sec)
至此,新的IOS文件已傳至路由器,重啟后IOS升級成功。
4. 口令恢復(fù)
⑴ 連接設(shè)備
重新連接設(shè)備,將PC0通過Console線連接到路由器的C
18、onsole口,如圖所示。
⑵ 查看寄存器值
當(dāng)路由器啟動時,在PC0超級終端界面HyperTerminal(超級終端)同時按下Ctrl和Break 組合鍵來執(zhí)行一個中斷。系統(tǒng)出現(xiàn)rommon提示,
rommon 1 >
在此模式下使用?,查看監(jiān)控模式下可用的哪些命令。也可使用查看Flash:中的內(nèi)容。
rommon 1 >dir flash:
program load complete, entry point: 0x8000f000, size: 0xcb80
Directory of flash:
2 20267528 -rw- c2800nm
19、-advsecurityk9-mz.124-3i.bin
4951 1823 -rw- sdmconfig-2811.cfg
4952 6036480 -rw- sdm.tar
6426 861696 -rw- es.tar
6637 1164288 -rw- common.tar
6922 1038 -rw- home.shtml
6923 113152 -rw- home.tar
6951 527849 -rw- 128MB.sdf
20、
7080 1697952 -rw- securedesktop-ios-3.1.1.45-k9.pkg
7495 416354 -rw- sslclient-win-1.1.3.173.pkg
7597 1189 -rw- pre_autosec.cfg
7598 1272 -rw- startupc_
⑶ 修改配置寄存器的值
不同的路由器修改的方法不同,
Cisco 2800系列方法如下:
rommon 2 > confreg 0x2142
You must reset or power
21、 cycle for new config to take effect
//下次引導(dǎo)時不要配置文件,考慮通常配置寄存器的值是什么,為什么現(xiàn)在是這樣的值。
⑷ 重啟設(shè)備
使用命令reset重新啟動路由器:
rommon 2 >reset
由于進行的是不帶配置文件的啟動,所以系統(tǒng)進入“setup”模式,選擇“no”。
--- System Configuration Dialog ---
Continue with configuration dialog? [yes/no]: no
⑸ 導(dǎo)入配置
將NVRAM中的配置文件導(dǎo)入到running-config文件中
LabA#c
22、opy startup-config running-config
在這一步中,分別是用show run和show star命令查看配置文件,你會發(fā)現(xiàn)在Start中的F0/0以及F0/1端口是no shutdown的。而雖然已經(jīng)將Start 內(nèi)容復(fù)制到run中,并沒有改變run中的F0/0以及F0/1的狀態(tài)。這就是這條命令的局限。
⑹ 修改并保存
修改各類口令:
LabA(config)#enable secret test
LabA(config)#line vty 0 4
LabA(config-line)#password test
LabA(config-line)#line console 0
LabA(config-line)#password test
修改回配置寄存器的值:
LabA(config)#config-register 0x2102
保存修改后的口令
LabA#copy running-config startup-config
五、思考題及其它
⑴ 理解路由器口令恢復(fù)的基本原理以及寄存器值的修改作用。
⑵ 交換機及其他廠家設(shè)備口令恢復(fù)的方法?
⑶ 理解startup-config和running-config的區(qū)別,以及copy startup-config running-config的局限性。