文章出处:www.net1980.com
         在我们的日常维护中,偶然会遇到一些路由器自动重启的故障。那么大家都会自然地猜测到是否设备已经运行一段长时间,设备稳定性开始减低。或者可能有工作人员把电源拨松了,又或者设备负荷过重等原因。那么究竟引起路由器重启的"元凶"是谁呢?
我们这里介绍一个简单又实用的方法来找到“元凶”。首先我们把所有情况分为四种类型。
1        冷启动
2        热启动
3        Abort,Trace Trap错误启动
4        Error错误启动
一.   冷启动
“冷启动”是指路由器物理上断电后重新加电所造成的重启。在特权模式下使用show version命令。
Router#show version
Cisco Internetwork Operating System Software
IOS (tm) 2500 Software (C2500-JS-L), Version 12.2(10b), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2002 by cisco Systems, Inc.
Compiled Fri 12-Jul-02 02:13 by pwade
Image text-base: 0x0307AA24, data-base: 0x00001000
ROM: System Bootstrap, Version 11.0(10c), SOFTWARE
BOOTLDR: 3000 Bootstrap Software (IGS-BOOT-R), Version 11.0(10c), RELEASE SOFTWARE (fc1)
R1 uptime is 9 minutes
System returned to ROM by power-on
System p_w_picpath file is "flash:/c2500-js-l.122-10b"
cisco 2500 (68030) processor (revision F) with 16384K/2048K bytes of memory.
Processor board ID 04796554, with hardware revision 00000000
Bridging software.
X.25 software, Version 3.0.0.
SuperLAT software (copyright 1990 by Meridian Technology Corp).
TN3270 Emulation software.
Basic Rate ISDN software, Version 1.1.
1 Ethernet/IEEE 802.3 interface(s)
2 Serial network interface(s)
1 ISDN Basic Rate interface(s)
32K bytes of non-volatile configuration memory.
16384K bytes of processor board System flash (Read ONLY)
Configuration register is 0x2002
显示结果中红色字体“ System returned to ROM by power-on ”表示设备上一次启动是冷启动。
 
二.   热启动
热启动是指路由器通过重启命令(例如reload)重启设备。在特权模式下使用show version命令。
Router#show version
Cisco Internetwork Operating System Software
IOS (tm) 2500 Software (C2500-JS-L), Version 12.2(10b), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2002 by cisco Systems, Inc.
Compiled Fri 12-Jul-02 02:13 by pwade
Image text-base: 0x0307AA24, data-base: 0x00001000
ROM: System Bootstrap, Version 11.0(10c), SOFTWARE
BOOTLDR: 3000 Bootstrap Software (IGS-BOOT-R), Version 11.0(10c), RELEASE SOFTWARE (fc1)
R1 uptime is 9 minutes
System returned to ROM by relaod
System p_w_picpath file is "flash:/c2500-js-l.122-10b"
cisco 2500 (68030) processor (revision F) with 16384K/2048K bytes of memory.
Processor board ID 04796554, with hardware revision 00000000
Bridging software.
X.25 software, Version 3.0.0.
SuperLAT software (copyright 1990 by Meridian Technology Corp).
TN3270 Emulation software.
Basic Rate ISDN software, Version 1.1.
1 Ethernet/IEEE 802.3 interface(s)
2 Serial network interface(s)
1 ISDN Basic Rate interface(s)
32K bytes of non-volatile configuration memory.
16384K bytes of processor board System flash (Read ONLY)
Configuration register is 0x2002
显示结果中红色字体“ System returned to ROM by reload ”表示设备上一次启动是热启动。
 
三.   Abort,Trace Trap错误启动
               Abort,Trace Trap错误很可能是由于寄存器设置了不正确的值,如0x002,导致的。将寄存器设置成0x2使路由器在正常情况下也接受break键,即使是路由器处于正常的工作状态,接收到break键也会使路由器进入ROMmon模式。在特权模式下使用show version命令。
   Router#show version
Cisco Internetwork Operating System Software
IOS (tm) 2500 Software (C2500-JS-L), Version 12.2(10b), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2002 by cisco Systems, Inc.
Compiled Fri 12-Jul-02 02:13 by pwade
Image text-base: 0x0307AA24, data-base: 0x00001000
ROM: System Bootstrap, Version 11.0(10c), SOFTWARE
BOOTLDR: 3000 Bootstrap Software (IGS-BOOT-R), Version 11.0(10c), RELEASE SOFTWARE (fc1)
R1 uptime is 9 minutes
System returned to ROM by trace trap at PC 0x32C2064
System p_w_picpath file is "flash:/c2500-js-l.122-10b"
cisco 2500 (68030) processor (revision F) with 16384K/2048K bytes of memory.
Processor board ID 04796554, with hardware revision 00000000
Bridging software.
X.25 software, Version 3.0.0.
SuperLAT software (copyright 1990 by Meridian Technology Corp).
TN3270 Emulation software.
Basic Rate ISDN software, Version 1.1.
1 Ethernet/IEEE 802.3 interface(s)
2 Serial network interface(s)
1 ISDN Basic Rate interface(s)
32K bytes of non-volatile configuration memory.
16384K bytes of processor board System flash (Read ONLY)
Configuration register is 0x2002
显示结果中红色字体“ System returned to ROM by trace trap at PC 0x32C2064表示设备上一次启动是Abort,Trace Trap错误启动。
为了防止路由器无端进入ROMmon模式,需要将寄存器的值配置成为0x102或0x2102,0x2102是路由器黓认配置的值。
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#config-register 0x2102
Router(config)#^Z
 
四、Error错误启动
             Error错误是指软件问题造成的错误。在特权模式下使用show version命令。
Router#show version
Cisco Internetwork Operating System Software
IOS (tm) 2500 Software (C2500-JS-L), Version 12.2(10b), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2002 by cisco Systems, Inc.
Compiled Fri 12-Jul-02 02:13 by pwade
Image text-base: 0x0307AA24, data-base: 0x00001000
ROM: System Bootstrap, Version 11.0(10c), SOFTWARE
BOOTLDR: 3000 Bootstrap Software (IGS-BOOT-R), Version 11.0(10c), RELEASE SOFTWARE (fc1)
R1 uptime is 9 minutes
System returned to ROM by error – a SegV exception,PC 0x80245f7C
System p_w_picpath file is "flash:/c2500-js-l.122-10b"
cisco 2500 (68030) processor (revision F) with 16384K/2048K bytes of memory.
Processor board ID 04796554, with hardware revision 00000000
Bridging software.
X.25 software, Version 3.0.0.
SuperLAT software (copyright 1990 by Meridian Technology Corp).
TN3270 Emulation software.
Basic Rate ISDN software, Version 1.1.
1 Ethernet/IEEE 802.3 interface(s)
2 Serial network interface(s)
1 ISDN Basic Rate interface(s)
32K bytes of non-volatile configuration memory.
16384K bytes of processor board System flash (Read ONLY)
Configuration register is 0x2002
    显示结果中红色字体“ System returned to ROM by error – a SegV exception,PC 0x80245f7C”表示设备上一次启动是Error错误启动。这里就不对这种错误详细说明了。
                通过以上的方法,我们就能够轻松地找出引起路由器重启的“元凶”,也减少排除故障的时长,增加了工作效率。