Unternehmensberatung Lemberg
IOS-Recovery

IOS-Recovery / Upgrade Cisco 2600-Serie

Hier möchte ich zwei Verfahren beschreiben, Cisco-Router der Serie 2600 mit einem neuen IOS zu versehen. Zum einen durch ein normales IOS-Upgrade, zum anderen nach Austausch des eingebauten Flash-Speichers, bzw. nach versehentlichen Löschen.

Geplantes IOS-Upgrade auf vorhandenem Flash

Benötigt wird entweder eine Consolenverbindung per gedrehtes Kabel oder eine Telnet-Session auf das Zielsystem. Ferner muß ein TFTP-Server zur Verfügung stehen, entweder als Dienst auf irgendeinem Management-System im Netz, oder als Dienst auf der lokalen Arbeitsstation.
Das Update geschieht in diesem einfachen Fall als TFTP-Kopiervorgang, der im enable-Modus des Routers/Switches angestoßen werden kann :

C2610-Testlab#sh ha
Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-I-M), Version 12.0(28d), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2005 by cisco Systems, Inc.
Compiled Fri 19-Aug-05 16:34 by pwade
Image text-base: 0x80008088, data-base: 0x80609A30

ROM: System Bootstrap, Version 11.3(2)XA4, RELEASE SOFTWARE (fc1)

C2610-Testlab uptime is 3 minutes
System restarted by reload
System image file is "flash:c2600-i-mz.120-28d.bin"

cisco 2610 (MPC860) processor (revision 0x202) with 26624K/6144K bytes of memory.
Processor board ID JAB031604RS (3155786434)
M860 processor: part number 0, mask 49
Bridging software.
X.25 software, Version 3.0.0.
Basic Rate ISDN software, Version 1.1.
1 Ethernet/IEEE 802.3 interface(s)
1 ISDN Basic Rate interface(s)
32K bytes of non-volatile configuration memory.
8192K bytes of processor board System flash (Read/Write)
        
Configuration register is 0x2102

C2610-Testlab#

Zunächst aber eine kleine Bestandsaufnahme : Wir haben einen Cisco2610, mit der laufenden Version 12.0.28d, insgesamt 32 MByte Memory (DRAM) und 8 MByte Flash. Unser neues Image sollte sinnigerweise keine höheren Ansprüche an das System stellen, da im schlimmsten Fall das System gar nicht mehr vernünftig hochfährt. Also werden wir es auf die Version 12.1.27b upgraden, laut Cisco-Homepage benötigt das Image 32 MByte RAM und 8 MByte Flash.

C2610-Testlab#copy tftp: flash:
Address or name of remote host []? 192.168.0.231
Source filename []? c2600-i-mz.121-27b.bin
Destination filename [c2600-i-mz.121-27b.bin]?
Accessing tftp://192.168.0.231/c2600-i-mz.121-27b.bin...
Erase flash: before copying? [confirm]
Erasing the flash filesystem will remove all files! Continue? [confirm]
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased
Erase of flash: complete
Loading c2600-i-mz.121-27b.bin from 192.168.0.231 (via Ethernet0/0): !!! ...gekürzt...
[OK - 4523396/9046016 bytes]

Verifying checksum...  OK (0x6338)
4523396 bytes copied in 43.643 secs (105195 bytes/sec)
C2610-Testlab#

Die Befehlssequenz “copy tftp: flash:” startet das IOS-Upgrade. Ein paar Parameter müssen noch nachgereicht werden, nämlich die IP-Adresse des TFTP-Servers und natürlich der Name des Images. Sollte das Image nicht mehr auf den vorhandenen Flash-Speicher passen, fragt das System nach, ob der Flash-Speicher gelöscht werden kann. Sollte noch genügend Platz für ein zweites Image sein, wird es parallel zum vorhanden Image auf das Flash abgelegt. jetzt sollte entweder das alte Image per “delete”-Befehl gelöscht werden, oder aber per “boot system”-Befehl eine Auswahl zwischen den Images getan werden.
So, noch ein reboot des Systems und dann sollte sich folgendes Bild ergeben :

C2610-Testlab#sh ha
Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-I-M), Version 12.1(27b), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2005 by cisco Systems, Inc.
Compiled Tue 16-Aug-05 17:55 by pwade
Image text-base: 0x80008088, data-base: 0x80833630

ROM: System Bootstrap, Version 11.3(2)XA4, RELEASE SOFTWARE (fc1)

C2610-Testlab uptime is 2 minutes
System returned to ROM by reload
System image file is "flash:c2600-i-mz.121-27b.bin"

cisco 2610 (MPC860) processor (revision 0x202) with 26624K/6144K bytes of memory.
Processor board ID JAB031604RS (3155786434)
M860 processor: part number 0, mask 49
Bridging software.
X.25 software, Version 3.0.0.
Basic Rate ISDN software, Version 1.1.
1 Ethernet/IEEE 802.3 interface(s)
1 ISDN Basic Rate interface(s)
32K bytes of non-volatile configuration memory.
8192K bytes of processor board System flash (Read/Write)
        
Configuration register is 0x2102

C2610-Testlab
#

IOS-Recovery in neuem Flash / nach versehentlichen Löschen

Wie ärgerlich, aus Versehen das Flash gelöscht.... Oder aber endlich ein neues, größeres eingebaut, welches leider absolut leer ist.... OK, wir machen ein IOS-Recovery. Erwartungsgemäß fährt der Router im Rommon hoch, dem allerletzten Strohhalm. Erstmal ein “?” eingeben, um das Command-Environment zu prüfen :

rommon 1 > ?
alias              set and display aliases command
boot               boot up an external process
break              set/show/clear the breakpoint
confreg            configuration register utility
cont               continue executing a downloaded image
context            display the context of a loaded image
cookie             display contents of cookie PROM in hex
dev                list the device table
dir                list files in file system
dis                display instruction stream
dnld               serial download a program module
frame              print out a selected stack frame
help               monitor builtin command help
history            monitor command history
meminfo            main memory information
repeat             repeat a monitor command
reset              system reset
set                display the monitor variables
stack              produce a stack trace
sync               write monitor environment to NVRAM
sysret             print out info from last system return
tftpdnld           tftp image download
unalias            unset an alias
unset              unset a monitor variable
xmodem             x/ymodem image download
rommon 2 >

Am besten, man zündet erstmal ein “tftpdnld” ohne genaues Wissen, so werden einem die benötigten Parameter gezeigt, die man dann per Drag&Drop einfach benennen kann.

rommon 2 > tftpdnld

Missing or illegal ip address for variable IP_ADDRESS
Illegal IP address.

usage: tftpdnld [-r]
  Use this command for disaster recovery only to recover an image via TFTP.
  Monitor variables are used to set up parameters for the transfer.
  (Syntax: "VARIABLE_NAME=value" and use "set" to show current variables.)
  "ctrl-c" or "break" stops the transfer before flash erase begins.

  The following variables are REQUIRED to be set for tftpdnld:
           IP_ADDRESS: The IP address for this unit
       IP_SUBNET_MASK: The subnet mask for this unit
       DEFAULT_GATEWAY: The default gateway for this unit
           TFTP_SERVER: The IP address of the server to fetch from
             TFTP_FILE: The filename to fetch

  The following variables are OPTIONAL:
         TFTP_VERBOSE: Print setting. 0=quiet, 1=progress(default), 2=verbose
     TFTP_RETRY_COUNT: Retry count for ARP and TFTP (default=7)
         TFTP_TIMEOUT: Overall timeout of operation in seconds (default=7200)
         TFTP_CHECKSUM: Perform checksum test on image, 0=no, 1=yes (default=1)

  Command line options:
   -r: do not write flash, load to DRAM only and launch image
rommon 3 >

Sodele, jetzt die fehlenden Parameter (REQUIRED) benennen. Auch wenn sich der TFTP-Server im selben Subnet befindet, muß dennoch ein Default-Gateway benannt werden.

rommon 3 > IP_ADDRESS=192.168.0.248
rommon 4 > IP_SUBNET_MASK=255.255.255.0
rommon 5 > DEFAULT_GATEWAY=192.168.0.1
rommon 6 > TFTP_SERVER=192.168.0.231
rommon 7 > TFTP_FILE=c2600-i-mz.122-32.bin
rommon 8 > tftpdnld

         IP_ADDRESS: 192.168.0.248
     IP_SUBNET_MASK: 255.255.255.0
     DEFAULT_GATEWAY: 192.168.0.1
         TFTP_SERVER: 192.168.0.231
           TFTP_FILE: c2600-i-mz.122-32.bin

Invoke this command for disaster recovery only.
WARNING: all existing data in all partitions on flash will be lost!
Do you wish to continue? y/n:  [n]:  y

Receiving c2600-i-mz.122-32.bin from 192.168.0.231 !!! **gekürzt** !!!
File reception completed.
Copying file c2600-i-mz.122-32.bin to flash.
Erasing flash at 0x60fc0000
program flash location 0x60550000
rommon 9 >

Zum Schluß noch ein “i” oder “boot” und der Router rebootet. Er läuft jetzt in das neue Image hoch.


Wie immer kann hier nur grob die ganze Thematik angerissen werden. Für nähere Beratungen und konkrete Fragestellungen steht Ihnen die Unternehmensberatung Lemberg  gerne zur Verfügung. Bitte kontaktieren Sie uns !

Karriere   Kontakt   Impressum