Cisco路由器升级IOS
今天把公司里的一台老式Cisco路由器拿出来看了看,还能用,就是IOS的版本有点儿低,而且之前同事装的IOS版本还无法把路由器的所有接口都认出来,于是乎动手重新安装了IOS,我的路由器是2600,新的IOS版本为:c2600-i-mz.123-26,这个IOS是我从网上找的。一般124的都是企业级的路由器,我的这台不是,凑合用吧。
1、首先上网下载一个Cisco TFTP Server,下载回来后解压缩,运行”TFTPServer.exe”,运行了这个程序也就代表着你的这台计算机就是一台TFTP服务器了,依次单击“查看”–“选项”按钮,我基本都是默认设置。这里说明一下“TFTP服务器根目录”,意思就是说我们从交换机或者路由器设备上拷贝回来的文件全部保存在这个目录下,并且这个程序是不能关闭的,要运行着这个程序。
2、使用Console口连接路由器,配置终端进入路由器的操作界面
c2600>enable ——进入配置特权模式
c2600#show flash: ——查看flash下的存储量及文件
System flash directory: ——-系统flash目录
File Length Name/status
1 5415320 c2600-c-mz.122-4.T1.bin ——现在路由器所使用的IOS
[5415384 bytes used, 10837544 available, 16252928 total] ——-flash使用量、剩余量及总存储量
16384K bytes of processor board System flash (Read/Write)
3、配置路由器端口,最好是配置0/0的端口,找一根网线接入路由器的0/0以太网接口。配置IP地址并启用此端口,为什么是0/0接口,而不是其他端口,如果我们升级路由器失败了,我们可以进入路由器的rommon模式,而rommon模式下与网络连接的接口只能是0/0接口
c2600#conf t ——进入全局配置模式
c2600(config)#int f0/0 ——进入路由器的f0/0端口
c2600(config-if)#ip add 10.0.23.112 255.255.255.0 ——-给f0/0端口配置ip地址及子网掩码
c2600(config-if)#no shut ——-启用f0/0接口
4、备份flash中现有的IOS
c2600#copy flash: tftp ——拷贝flash中的文件到tftp服务器中
Source filename []? c2600-c-mz.122-4.T1.bin —–输入要从flash当中拷贝出的文件名
Address or name of remote host []? 10.0.23.4 —–tftp服务器的ip地址,即开启cisco tftp server软件的计算机
Destination filename [c2600-c-mz.122-4.T1.bin]? ——到tftp服务器上的文件保存名称是否为原名,如果不想保存原名就在“?”后,输入自己想要的名称,这里我保持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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!! ——-拷贝进度条
5415320 bytes copied in 48.284 secs (112819 bytes/sec) —–文件拷贝字节数及所耗时间。
此时tftp服务器上也会显示从路由器接收文件的信息,直到“Wed Mar 12 12:32:36 2014: 成功.”出现。
5、此时TFTP Server的根目录下就会出现我们刚刚备份出来的IOS文件,将新的IOS放到该目录下。如图
6、上传新的IOS文件到路由器中
c2600#copy tftp flash: ——拷贝文件从tftp服务器到flash中
Address or name of remote host []? 10.0.23.4 ——tftp服务器的ip地址
Source filename []? c2600-i-mz.123-26.bin ——新IOS的文件名,这里一定要加上后缀名。
Destination filename [c2600-i-mz.123-26.bin]? ——使用原文件名,直接回车即可
Loading c2600-i-mz.123-26.bin from 10.0.23.4 (via FastEthernet0/0):!!!!!!!!!!!! —-tftp服务器通过f0/0接口上传文件
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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show flash:
System flash directory:
File Length Name/status
1 5415320 c2600-c-mz.122-4.T1.bin
2 7754580 c2600-i-mz.123-26.bin
[13170028 bytes used, 3082900 available, 16252928 total]
16384K bytes of processor board System flash (Read/Write)
8、删除原来的IOS文件,使路由器加载新的IOS文件,如果上传新IOS文件时提示“not enough space”,请先执行删除IOS命令,删除后千万不要断开路由器或者重启路由器,上传新的IOS文件后,再重启路由器。
c2600#delete flash: ——-删除flash中的文件
Delete filename []? c2600-c-mz.122-4.T1.bin ——–删除文件名称
Delete flash:c2600-c-mz.122-4.T1.bin? [confirm] ——–确认删除?直接回车即可
c2600#reload ——–重启交换机
System configuration has been modified. Save? [yes/no]: y ——-系统设置被变更,是否保存,y是
Warning: Attempting to overwrite an NVRAM configuration previously written
by a different version of the system image.
Overwrite the previous NVRAM configuration?[confirm]
Building configuration…
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Proceed with reload? [confirm] ——-执行重启?直接回车即可
01:50:33: %SYS-5-RELOAD: Reload requested
System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1)
Copyright (c) 2000 by cisco Systems, Inc.
C2600 platform with 32768 Kbytes of main memory
program load complete, entry point:0x80008000, size: 0x765238
Self decompressing the image :#################################################
############################################################################[OK
]
Smart Init is disabled. IOMEM set to: 10
Using iomem percentage: 10
Restricted Rights Legend
Use, duplication, or disclosure by theGovernment is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software – Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.
cisco Systems, Inc.
170 West Tasman Drive
San Jose, California 95134-1706
Cisco Internetwork Operating SystemSoftware
IOS C2600 Software (C2600-I-M), Version 12.3(26), RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2008 by cisco Systems, Inc.
Compiled Mon 17-Mar-08 15:23 by dchih
cisco 2621 (MPC860) processor (revision0x600) with 29696K/3072K bytes of memory
.
Processor board ID JAD052402RV (3679060894)
M860 processor: part number 0, mask 49
Bridging software.
X.25 software, Version 3.0.0.
3 FastEthernet/IEEE 802.3 interface(s)
1 Serial network interface(s)
32K bytes of non-volatile configuration memory.
16384K bytes of processor board System flash (Read/Write)
Press RETURN to get started!
9、正常进入路由器后,输入show ver显示系统信息。
c2600#show ver
Cisco Internetwork Operating System Software
IOS C2600 Software (C2600-I-M), Version 12.3(26), RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2008 by cisco Systems, Inc.
Compiled Mon 17-Mar-08 15:23 by dchih
ROM: System Bootstrap, Version 12.1(3r)T2,RELEASE SOFTWARE (fc1)
c2600 uptime is 7 minutes
System returned to ROM by reload
System image file is “flash:c2600-i-mz.123-26.bin” ——-查看是否系统使用的是新IOS文件。有点儿废话,没走新的怎么启动的
cisco 2621 (MPC860) processor (revision0x600) with 29696K/3072K bytes of memory
.
Processor board ID JAD052402RV (3679060894)
M860 processor: part number 0, mask 49
Bridging software.
X.25 software, Version 3.0.0.
3 FastEthernet/IEEE 802.3 interface(s)
1 Serial network interface(s)
32K bytes of non-volatile configuration memory.
16384K bytes of processor board System flash (Read/Write)
Configuration register is 0x2102
10、接下来我们说一下安装IOS失败后出现的问题及解决方法,我自己总结了以下几点:
10.1、误删除IOS,路由器没有IOS。
10.2、IOS版本不对,不支持路由器。
10.3、路由器安装的IOS造成路由器内存不足。
11、以上几种情况最简单的方法就是进入rommon模式,将路由器断电,将网线插入路由器的f0/0端口与tftp服务器连接,将Console口与tftp服务器进行连接,进入终端,开启路由器电源,在加电的前几秒按“Ctrl+Break”键进入rommon模式,要开启tftp服务器上的tftp server程序。
rommon 1 > set ——显示动态监视器
PS1=rommon ! >
IP_ADDRESS=10.0.23.112
IP_SUBNET_MASK=255.255.255.0
DEFAULT_GATEWAY=10.0.23.254
TFTP_SERVER=10.0.23.4
TFTP_FILE=c2600-i-mz.123-26.bin
BSI=0
RANDOM_NUM=1139268605
RET_2_RTS=
RET_2_RCALTS=
?=0
rommon 2 > IP_ADDRESS=10.0.23.112 ——路由器f0/0接口ip地址,再次提示rommon模式下只认0/0接口,其他接口都无效
rommon 3 > IP_SUBNET_MASK=255.255.255.0 ——–配置子网掩码
rommon 4 > DEFAULT_GATEWAY=10.0.23.254 ——–网关
rommon 5 > TFTP_SERVER=10.0.23.4 ——tftp服务器的ip地址
rommon 6 > TFTP_FILE=c2600-i-mz.123-26.bin ——tftp服务器根目录上的IOS文件
rommon 7 > sync ——-保存设置
rommon 8 > tftpdnld ——-从tftp服务器上下载指定文件
IP_ADDRESS: 10.0.23.112
IP_SUBNET_MASK: 255.255.255.0
DEFAULT_GATEWAY: 10.0.23.254
TFTP_SERVER: 10.0.23.4
TFTP_FILE: c2600-i-mz.123-26.bin
Invoke this command for disaster recoveryonly.
WARNING: all existing data in all partitions on flash will be lost!
Do you wish to continue? y/n: [n]: y ——输入y直接回车,将会删除flash下的所有文件并且拷贝文件到Flash中
Receiving c2600-i-mz.123-26.bin from10.0.23.4 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!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!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
File reception completed.
Copying file c2600-i-mz.123-26.bin to flash.
Erasing flash at 0x60fc0000
program flash location 0x60760000
rommon 9 > boot ——-重新启动并加载新的IOS文件
program load complete, entry point: 0x80008000, size: 0x765238
Self decompressing the image : #################################################
############################################################################[OK
]
Smart Init is disabled. IOMEM set to: 10
Using iomem percentage: 10
Restricted Rights Legend
Use, duplication, or disclosure by theGovernment is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software – Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.
cisco Systems, Inc.
170 West Tasman Drive
San Jose, California 95134-1706
Cisco Internetwork Operating SystemSoftware
IOS C2600 Software (C2600-I-M), Version 12.3(26), RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2008 by cisco Systems, Inc.
Compiled Mon 17-Mar-08 15:23 by dchih
cisco 2621 (MPC860) processor (revision0x600) with 29696K/3072K bytes of memory
.
Processor board ID JAD052402RV (3679060894)
M860 processor: part number 0, mask 49
Bridging software.
X.25 software, Version 3.0.0.
3 FastEthernet/IEEE 802.3 interface(s)
1 Serial network interface(s)
32K bytes of non-volatile configuration memory.
16384K bytes of processor board System flash (Read/Write)
SETUP: new interface Serial0/0 placed in“shutdown” state
SETUP: new interface FastEthernet0/1 placed in “shutdown” state
SETUP: new interface FastEthernet1/0 placed in “shutdown” state
%Error opening tftp://255.255.255.255/network-confg (Timed out)
%Error opening tftp://255.255.255.255/cisconet.cfg (Timed out)
%Error opening tftp://255.255.255.255/router-confg (Timed out)
%Error opening tftp://255.255.255.255/ciscortr.cfg (Timed out)
PressRETURN to get started!
最后说明一下,如果升级完成后,发现输入”write”无法保存配置,那么使用erase清空nvram,实际上startup-config保存在nvram存储器中。
Router#erase nvram:
Erasing the nvram filesystem will remove all configuration files! Continue?[con
firm]
[OK]
Erase of nvram: complete
至此Cisco路由器的IOS灌入升级,就完成了,还有一种模式是在rommon模式下用xmodem命令灌入,利用的是console口,使用的是波特率传输,那速度简直是爽爆了,两个多小时才能完成,如果有时间大家可以试试,保准让你的菊花一紧,掉头走人。最后附上Cisco TFTP软件。
本文出自 “Azrael技术笔记” 博客,谢绝转载!
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。