Recuperación de IOS desde un servidor TFTP

 

Escenario: se simula la peor condición, hay un crash de IOS, o un borrado accidental (aquí el borrado es explícito por

cuestiones de simulación) ó un borrado de mantenimiento (podría ser por actualización), seguido por ejemplo, de una

falla de energía eléctrica.

 

Este escenario se simuló tanto en Packet Tracer como con equipos reales.

 

                     

                         

Router_1841#ping 10.0.0.10 (aseguramos previamente la conectividad al TFTP)

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 10.0.0.10, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms

 

Router_1841#sh flash (verificamos archivo de IOS)

 

System flash directory:

File  Length   Name/status

  4   33591768 c1841-advipservicesk9-mz.124-15.T1.bin (ver el número de archivo)

[33591768 bytes used, 30424616 available, 64016384 total]

63488K bytes of processor board System flash (Read/Write)

 

Router_1841#delete flash (borramos el sistema operativo)

Delete filename []? c1841-advipservicesk9-mz.124-15.T1.bin

Delete flash:/c1841-advipservicesk9-mz.124-15.T1.bin? [confirm] (enter)

 

Router_1841#reload (reiniciamos, podría ser una falla eléctrica o un crash)

Proceed with reload? [confirm] (enter)

%SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.

 

System Bootstrap, Version 12.3(8r)T8, RELEASE SOFTWARE (fc1)

Cisco 1841 (revision 5.0) with 114688K/16384K bytes of memory.

 

Boot process failed... (falla de arranque por falta de IOS)

 

The system is unable to boot automatically.  The BOOT

environment variable needs to be set to a bootable

image.

rommon 1 > tftpdnld (necesitará configurarse variables de entorno)

 

usage: tftpdnld

  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)

         FE_SPEED_MODE: 0=10/hdx, 1=10/fdx, 2=100/hdx, 3=100/fdx, 4=Auto(deflt)

 

rommon 2 > IP_ADDRESS=10.0.0.1 (variables mínimas para alcanzar el TFTP server)

rommon 3 > IP_SUBNET_MASK=255.255.255.0

rommon 4 > DEFAULT_GATEWAY=10.0.0.2 (aunque el TFTP sea local y no se utilice)

rommon 5 > TFTP_SERVER=10.0.0.10

rommon 6 > TFTP_FILE=c1841-advipservicesk9-mz.124-15.T1.bin (archivo de IOS)

rommon 7 > tftpdnld (ejecutamos, ahora con variables configuradas)

 

          IP_ADDRESS: 10.0.0.1

      IP_SUBNET_MASK: 255.255.255.0

     DEFAULT_GATEWAY: 10.0.0.2

         TFTP_SERVER: 10.0.0.10

           TFTP_FILE: c1841-advipservicesk9-mz.124-15.T1.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

 

Loading c1841-advipservicesk9-mz.124-15.T1.bin from 10.0.0.10 (carga desde el TFTP a RAM)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

---resumido---

program flash location 0x61fd0000 (copia de RAM a FLASH)

program flash location 0x61fe0000

program flash location 0x61ff0000

program flash location 0x62000000

 

rommon 8 >reset (reinicio del equipo)

 

System Bootstrap, Version 12.3(8r)T8, RELEASE SOFTWARE (fc1)

Cisco 1841 (revision 5.0) with 114688K/16384K bytes of memory.

 

Self decompressing the image :

#######################################################################

################################################################# [OK] (arranque normal)

              Restricted Rights Legend

---resumido---

%SYS-5-CONFIG_I: Configured from console by console

 

Router_1841> enable

Password:

Router_1841# sh flash

 

System flash directory:

File  Length   Name/status

  5   33591768 c1841-advipservicesk9-mz.124-15.T1.bin (el número de archivo cambió de 4 a 5)

[33591768 bytes used, 30424616 available, 64016384 total]

63488K bytes of processor board System flash (Read/Write)

 

Router_1841#

 

Ejemplo de IOS crash en un router 831

 

*Mar  1 00:00:05.847: %LINK-3-UPDOWN: Interface Ethernet1, changed state to up (interfaz de Internet)

*Mar  1 00:00:15.719: %SYS-2-MALLOCFAIL: Memory allocation of 264 bytes failed from 0x800DA25C, alignment 4

Pool: I/O  Free: 684  Cause: Memory fragmentation

Alternate Pool: None  Free: 0  Cause: No Alternate pool

 

-Process= "Pool Manager", ipl= 0, pid= 6

-Traceback= 801396EC 8013A394 800DA260 801489E8 80148C04 80160A1C

*Mar  1 00:00:15.723: %SYS-2-NOBLOCK: printf with blocking disabled.

-Process= "Pool Manager", ipl= 0, pid= 6

-Traceback= 80082820 8013976C 8013A394 800DA260 801489E8 80148C04 80160A1C

Program (breakpoint) Exception (0x700)!

CPU Register Context:

VEC = 700  PC  = 8015B8A0  MSR = 29032  CR  = 30000005

LR  = 8015B850  CTR = 80084920  XER = C000887F

R0  = 8015B850  R1  = 81062238  R2  = 80F00000  R3  = 80F65FB0

R4  = FFFFFFFE  R5  = 0  R6  = 81062210  R7  = 80E10000

R8  = FF000000  R9  = 0  R10 = 9032  R11 = 80F65F48

R12 = A0000000  R13 = FFF32D6C  R14 = 0  R15 = 0

R16 = 0  R17 = 0  R18 = 0  R19 = 0

R20 = 0  R21 = 0  R22 = 0  R23 = 80B144DC

R24 = 4  R25 = 800DA25C  R26 = 800DA25C  R27 = 108

R28 = 4  R29 = 80F7C670  R30 = 0  R31 = 0

 

Stack trace:

PC = 8015B8A0, SP = 81062238

Frame 00: SP = 81062238    RA = 80139774

Frame 01: SP = 81062248    RA = 8013A394

Frame 02: SP = 81062270    RA = 800DA260

Frame 03: SP = 810622A8    RA = 801489E8

Frame 04: SP = 810622C8    RA = 80148C04

Frame 05: SP = 810622E8    RA = 80160A1C

Frame 06: SP = 81062330    RA = 0

 

*** System received a Software forced crash *** (aquí nos notifica del system crash)

 

signal= 0x17, code= 0x700, context= 0x80f7ed98

PC = 0x8015b8a0, Vector = 0x700, SP = 0x81062238

 

 

System Bootstrap, Version 12.2(8r)YN, RELEASE SOFTWARE (fc1) (se reinicia del equipo, en este caso había que

TAC Support: http://www.cisco.com/tac                        desconectar la interfaz Internet ya que el DHCP

Copyright (c) 2002 by cisco Systems, Inc.                    de cablemodem provocaba el crash, reiniciándolo

---resumido---                                               nuevamente,o poner IP fija o cambiar versión IOS)

 

En caso de tener varias imágenes IOS en flash para un troubleshooting rápido

 

Router_1841# sh flash (verificamos espacio disponible)

 

System flash directory:

File  Length   Name/status

  5   33591768 c1841-advipservicesk9-mz.124-15.T1.bin

[33591768 bytes used, 30424616 available, 64016384 total] (30 megas para un IOS de 16 aprox.)

63488K bytes of processor board System flash (Read/Write)

 

Router_1841# copy tftp flash

Address or name of remote host []? 10.0.0.10

Source filename []? c1841-ipbasek9-mz.124-12.bin

Destination filename [c1841-ipbasek9-mz.124-12.bin]? (enter)

 

Accessing tftp://10.0.0.10/c1841-ipbasek9-mz.124-12.bin....

Loading c1841-ipbasek9-mz.124-12.bin from 10.0.0.10: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!! [OK - 16599160 bytes]

 

16599160 bytes copied in 12.062 secs (307930 bytes/sec)

Router_1841# sh flash (verificamos)

 

System flash directory:

File  Length   Name/status

  3   33591768 c1841-advipservicesk9-mz.124-15.T1.bin (IOS actual)

  4   16599160 c1841-ipbasek9-mz.124-12.bin (nuevo IOS de contingencia)

  2   28282    sigdef-category.xml

  1   227537   sigdef-default.xml

[50446747 bytes used, 13569637 available, 64016384 total]

63488K bytes of processor board System flash (Read/Write)

Router_1841#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Router_1841 (config)# boot system flash c1841-ipbasek9-mz.124-12.bin (elejimos imagen a utilizar)

Router_1841 (config)# ^Z

Router_1841#

%SYS-5-CONFIG_I: Configured from console by console

Router# copy ru st (guardamos cambios, este comando es parte de la running-config)

Building configuration...

[OK]

Router_1841# reload (reiniciamos)

Proceed with reload? [confirm] (enter)

%SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.

 

System Bootstrap, Version 12.3(8r)T8, RELEASE SOFTWARE (fc1)

Cisco 1841 (revision 5.0) with 114688K/16384K bytes of memory.

 

Self decompressing the image :

########################################################################## [OK]

              Restricted Rights Legend

---resumido---

Cisco IOS Software, 1841 Software (C1841-IPBASEK9-M), Version 12.4(12), RELEASE SOFTWARE (fc1)

Technical Support: http://www.cisco.com/techsupport

Copyright (c) 1986-2006 by Cisco Systems, Inc.

Compiled Mon 15-May-06 14:54 by pt_team

Image text-base: 0x600790EC, data-base: 0x61480000

---resumido---

Cisco 1841 (revision 5.0) with 114688K/16384K bytes of memory.

Processor board ID FTX0947Z18E

M860 processor: part number 0, mask 49

2 FastEthernet/IEEE 802.3 interface(s)

191K bytes of NVRAM.

63488K bytes of ATA CompactFlash (Read/Write)

 

Press RETURN to get started!

 

%LINK-5-CHANGED: Interface Vlan1, changed state to up

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINK-5-CHANGED: Interface Vlan1, changed state to up

 

%SYS-5-CONFIG_I: Configured from console by console

 

Router_1841# sh runn (verificación)

Building configuration...

 

Current configuration : 510 bytes

!

version 12.4

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Router

!

!

boot system flash c1841-ipbasek9-mz.124-12.bin

!

---resumido---

!

end

!

Router_1841#

 

 

 

(2012)  Boring pretty girls with networking.

Rosario, Argentina