Utilización
del puerto USB en un router Cisco 1841
Fecha: 29 de septiembre del 2014 Clase:
temas del módulo 4 de Exploration 4
Escenario
Estas pruebas
se mencionan en el módulo 4 de Exploration 4 como procedimiento por consola y
protocolo x-modem (fuera de banda,no es IP),
en este
escenario las realizamos por el puerto USB de un router Cisco 1841, mediante un
pendrive Kingston de 2 GB formateado en FAT desde
el mismo
router y se realizan tareas de upgrade o arranque de emergencia por pérdida de
la memoria flash.
1.- Se realiza un upgrade de IOS vía USB en vez del clásico TFTP
ISP#sh
version (verificamos versión de IOS)
Cisco IOS
Software, 1841 Software (C1841-SPSERVICESK9-M), Version 12.4(1c), RELEASE
SOFTWARE (fc1)
Technical
Support: http://www.cisco.com/techsupport
Copyright (c)
1986-2005 by Cisco Systems, Inc.
Compiled Tue
25-Oct-05 17:10 by evmiller
ROM: System
Bootstrap, Version 12.3(8r)T9, RELEASE SOFTWARE (fc1)
ISP uptime is
1 minute
System
returned to ROM by power-on
System image
file is "flash:c1841-spservicesk9-mz.124-1c.bin" (IOS estándar)
---resumido---
Cisco 1841
(revision 6.0) with 117760K/13312K bytes of memory.
Processor
board ID FTX1034W111
2
FastEthernet interfaces
1
Serial(sync/async) interface
DRAM
configuration is 64 bits wide with parity disabled.
191K bytes of
NVRAM.
31360K bytes
of ATA CompactFlash (Read/Write)
Configuration
register is 0x2102
ISP#sh
flash (verificamos el contenido de la flash)
-#-
--length-- -----date/time------ path
1 22406740 Aug 22 2006 23:36:22 +00:00
c1841-spservicesk9-mz.124-1c.bin
2 1821 Aug 22 2006 23:50:14 +00:00
sdmconfig-18xx.cfg
3 4734464 Aug 22 2006 23:50:48 +00:00
sdm.tar
4 833024 Aug 22 2006 23:51:08 +00:00
es.tar
5 1052160 Aug 22 2006 23:51:32 +00:00
common.tar
6 1038 Aug 22 2006 23:51:52 +00:00
home.shtml
7 102400 Aug 22 2006 23:52:10 +00:00
home.tar
8 491213 Aug 22 2006 23:52:30 +00:00
128MB.sdf
9 1684577 Aug 22 2006 23:53:04 +00:00
securedesktop-ios-3.1.1.27-k9.pkg
10 398305 Aug 22 2006 23:53:32 +00:00
sslclient-win-1.1.0.154.pkg
11 143377 Jul 04 2007 19:07:22 +00:00
crashinfo_20070704-190722
12 0 Jul 04 2007 19:09:06 +00:00
crashinfo_20070704-190906
0 bytes available (31932416 bytes used) (la flash no tiene espacio)
Conectamos
el pendrive en el puerto USB:
ISP#
*Feb 13
14:23:22.691: %USB_HOST_STACK-6-USB_DEVICE_CONNECTED: A Full speed USB device
has been inserted in port 0.
*Feb 13
14:23:23.447: %USBFLASH-5-CHANGE: usbflash0 has been inserted!
ISP>sh
usb?
usb usbflash0:
ISP>sh
usbflash0: (verificamos el contenido del
pendrive)
-#-
--length-- -----date/time------ path
1 24355180 Dec 05 2011 15:07:04
c1841-advipservicesk9-mz.124-9.T1.bin
1973780480
bytes available (24379392 bytes used)
Generamos
una copia de backup en la unidad USB para realizar un potencial rollback:
ISP#copy
flash:c1841-spservicesk9-mz.124-1c.bin usbflash0:
Destination
filename [c1841-spservicesk9-mz.124-1c.bin]?
Copy in
progress...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
---resumido---
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
22406740
bytes copied in 66.852 secs (335169 bytes/sec)
ISP#delete
flash:c1841-spservicesk9-mz.124-1c.bin (borramos el
archivo del sistema operativo)
Delete
filename [c1841-spservicesk9-mz.124-1c.bin]? (enter)
Delete
flash:c1841-spservicesk9-mz.124-1c.bin? [confirm] (enter)
Verificamos
contenido del pendrive:
ISP#dir
ubflash0: (vemos
el respaldo del sistema operativo del router y la actualización)
Directory of
usbflash0:/
1
-rw- 24355180 Dec 05 2011 15:07:04 +00:00 c1841-advipservicesk9-mz.124-9.T1.bin (actualización)
2
-rw- 22406740 Feb 13 2012 14:29:58 +00:00 c1841-spservicesk9-mz.124-1c.bin (original)
1998159872
bytes total (1951367168 bytes free)
Realizamos
la copia del upgrade a la flash:
ISP#copy
usbflash0:c1841-advipservicesk9-mz.124-9.T1.bin flash:
Destination
filename [c1841-advipservicesk9-mz.124-9.T1.bin]?
Delete
filename [c1841-spservicesk9-mz.124-1c.bin]?
Delete
flash:c1841-spservicesk9-mz.124-1c.bin? [confirm]
Copy in
progress...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
--resumido---
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
24355180
bytes copied in 86.904 secs (280254 bytes/sec)
Curiosidad
en el contenido de la flash: no aparece la
imagen de IOS copiada.
ISP#sh
flash: (con este comando NO se visualiza)
-#-
--length-- -----date/time------ path
1 1821 Aug 22 2006 23:50:14 +00:00
sdmconfig-18xx.cfg
2 4734464 Aug 22 2006 23:50:48 +00:00
sdm.tar
3 833024 Aug 22 2006 23:51:08 +00:00
es.tar
4 1052160 Aug 22 2006 23:51:32 +00:00
common.tar
5 1038 Aug 22 2006 23:51:52 +00:00
home.shtml
6 102400 Aug 22 2006 23:52:10 +00:00
home.tar
7 491213 Aug 22 2006 23:52:30 +00:00
128MB.sdf
348160
bytes available (31584256 bytes used)
ISP#dir
flash: (con este comando SI se visualiza)
Directory of
flash:/
9
-rw- 24355180 Feb 13 2012 14:36:24 +00:00 c1841-advipservicesk9-mz.124-9.T1.bin
1
-rw- 1821 Aug 22 2006 23:50:14 +00:00 sdmconfig-18xx.cfg
2
-rw- 4734464 Aug 22 2006 23:50:48 +00:00 sdm.tar
3
-rw- 833024 Aug 22 2006 23:51:08 +00:00 es.tar
4
-rw- 1052160 Aug 22 2006 23:51:32 +00:00 common.tar
5
-rw- 1038 Aug 22 2006 23:51:52 +00:00 home.shtml
6
-rw- 102400 Aug 22 2006 23:52:10 +00:00 home.tar
7
-rw- 491213 Aug 22 2006 23:52:30 +00:00 128MB.sdf
31932416
bytes total (348160 bytes free)
Verificamos
alguna configuración de seguridad: para no
visualizar el archivo mediante este comando.
ISP#sh
secure boot
%IOS image
and configuration resilience is not active
Reiniciamos
para cargar la imagen nueva:
ISP#reload
Proceed with
reload? [confirm] (enter)
*Feb 13
14:38:25.827: %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload
command.
System
Bootstrap, Version 12.3(8r)T9, RELEASE SOFTWARE (fc1)
*Feb 13
14:39:45.535: %SYS-5-RESTART: System restarted --
Cisco IOS
Software, 1841 Software (C1841-ADVIPSERVICESK9-M), Version 12.4(9)T1, RELEASE
SOFTWARE (fc2)
Technical
Support: http://www.cisco.com/techsupport
Copyright (c)
1986-2006 by Cisco Systems, Inc.
Compiled Wed
30-Aug-06 15:13 by prod_rel_team
*Feb 13
14:39:45.535: %SNMP-5-COLDSTART: SNMP agent on host ISP is undergoing a cold
start
*Feb 13
14:39:45.707: %SYS-6-BOOTTIME: Time taken to reboot after reload = 78 seconds
*Feb 13
14:39:45.855: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is OFF
*Feb 13
14:39:45.855: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is OFF
Verificamos
nueva versión:
ISP>enable
ISP#sh ver
Cisco IOS
Software, 1841 Software (C1841-ADVIPSERVICESK9-M),
Version 12.4(9)T1, RELEASE SOFTWARE
(fc2)
Technical
Support: http://www.cisco.com/techsupport
Copyright (c)
1986-2006 by Cisco Systems, Inc.
Compiled Wed
30-Aug-06 15:13 by prod_rel_team
ROM: System
Bootstrap, Version 12.3(8r)T9, RELEASE SOFTWARE (fc1)
ISP uptime is
1 minute
System
returned to ROM by reload at 14:38:25 UTC Mon Feb 13 2012
System
image file is "flash:c1841-advipservicesk9-mz.124-9.T1.bin"
---resumido----
Cisco 1841
(revision 6.0) with 117760K/13312K bytes of memory.
Processor
board ID FTX1034W111
2
FastEthernet interfaces
1
Serial(sync/async) interface
1 Virtual
Private Network (VPN) Module
DRAM
configuration is 64 bits wide with parity disabled.
191K bytes of
NVRAM.
1951344K
bytes of USB Flash usbflash0 (Read/Write)
31360K bytes
of ATA CompactFlash (Read/Write)
Configuration
register is 0x2102
ISP#sh
flash: (con este comando NO se visualizaba…ahora si)
-#-
--length-- -----date/time------ path
1 24355180 Feb 13 2012 14:36:24 +00:00
c1841-advipservicesk9-mz.124-9.T1.bin
2 1821 Aug 22 2006 23:50:14 +00:00
sdmconfig-18xx.cfg
3 4734464 Aug 22 2006 23:50:48 +00:00
sdm.tar
4 833024 Aug 22 2006 23:51:08 +00:00
es.tar
5 1052160 Aug 22 2006 23:51:32 +00:00
common.tar
6 1038 Aug 22 2006 23:51:52 +00:00
home.shtml
7 102400 Aug 22 2006 23:52:10 +00:00
home.tar
8 491213 Aug 22 2006 23:52:30 +00:00
128MB.sdf
348160 bytes
available (31584256 bytes used)
ISP#
2.- Realizando el arranque desde un pendrive en caso de que la
flash falle
Cordoba>enable
Password:
Cordoba#format usbflash0: (formateamos
el pendrive)
Format
operation may take a while. Continue? [confirm] (enter)
Format
operation will destroy all data in "usbflash0:". Continue? [confirm] (enter)
Format: All
system sectors written. OK...
Format: Total
sectors in formatted partition: 3903201
Format: Total
bytes in formatted partition: 1998438912
Format:
Operation completed successfully.
Format of
usbflash0: complete
Cordoba#
Cordoba#sh flash (verificamos
contenido de la flash)
-#-
--length-- -----date/time------ path
1 40464820 Dec 01 2026 02:44:00 c1841-adventerprisek9-mz.124-24.T.bin (IOS activo)
2 45703272 Aug 01 2012 19:22:42
c1841-advipservicesk9-mz.151-4.M4.bin
3 1252 Sep 13 2012 01:00:36 R1
4 0 Feb 27 2013 09:01:36 iosips
5 0 Feb 27 2013 09:09:12 ips
6 704 Feb 27 2013 09:10:12
ips/Rosario-sigdef-default.xml
7 255 Feb 27 2013 09:10:14
ips/Rosario-sigdef-delta.xml
8 4365 Feb 27 2013 09:10:14
ips/Rosario-sigdef-typedef.xml
9 1469 Feb 27 2013 09:10:14
ips/Rosario-sigdef-category.xml
10 304 Feb 27 2013 09:10:14
ips/Rosario-seap-delta.xml
11 491 Feb 27 2013 09:10:16
ips/Rosario-seap-typedef.xml
12 9553609 Feb 27 2013 09:17:20
ips/IOS-S416-CLI.pkg
13 1038 May 13 2013 23:39:04 home.shtml
14 2746 May 13 2013 23:39:04
sdmconfig-18xx.cfg
15 112640 May 13 2013 23:39:04 home.tar
16 1505280 May 13 2013 23:39:10 common.tar
17 6389760 May 13 2013 23:39:34 sdm.tar
18 1697952 May 13 2013 23:39:48
securedesktop-ios-3.1.1.45-k9.pkg
19 415956 May 13 2013 23:39:56
sslclient-win-1.1.4.176.pkg
20 931840 May 13 2013 23:40:06 es.tar
21 1400 Jun 08 2013 15:54:56 2013-8-6
22 1734 Apr 12 2014 13:32:26 o
414441472
bytes available (106913792 bytes used)
Cordoba#
Cordoba#copy flash usbflash0: (backup del sistema operativo al pendrive)
Source
filename [c1841-adventerprisek9-mz.124-24.T.bin]? (enter)
Destination
filename [c1841-adventerprisek9-mz.124-24.T.bin]? (enter)
Copy in
progress...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
---resumido---
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
40464820
bytes copied in 133.260 secs (303653 bytes/sec)
Cordoba#
Cordoba#show usbflash0: (verificamos
la copia del archivo)
-#-
--length-- -----date/time------ path
1 40464820 Oct 29 2014 22:08:38
c1841-adventerprisek9-mz.124-24.T.bin
1957691392
bytes available (40468480 bytes used)
Cordoba# (apagamos el
equipo, retiramos la flash y lo encendemos nuevamente)
System
Bootstrap, Version 12.4(13r)T, RELEASE SOFTWARE (fc1)
Technical
Support: http://www.cisco.com/techsupport
Copyright (c)
2006 by cisco Systems, Inc.
PLD version
0x10
GIO ASIC
version 0x127
c1841
platform with 262144 Kbytes of main memory
Main memory
is configured to 64 bit mode with parity disabled
Readonly
ROMMON initialized
flash:
CompactFlash not present. (memoria retirada para esta prueba)
rommon 1 >
dir usbflash0: (verificamos
pendrive)
program load
complete, entry point: 0x8000f000, size: 0x3d180
Directory of
usbflash0:
2 40464820
-rw- c1841-adventerprisek9-mz.124-24.T.bin
0 0
-rw- ERNESTO
rommon 2 >
boot usbflash0:
c1841-adventerprisek9-mz.124-24.T.bin (arranque
desde el pendrive)
program load
complete, entry point: 0x8000f000, size: 0x3d180
program load
complete, entry point: 0x8000f000, size: 0x3d180
program load
complete, entry point: 0x8000f000, size: 0x2697014
Self
decompressing the image :
######################################################
###############################################################################
##############################################
[OK]
Smart Init is
enabled
---resumido---
Cisco IOS
Software, 1841 Software (C1841-ADVENTERPRISEK9-M), Version 12.4(24)T, RELEASE
SOFTWARE (fc1)
Technical
Support: http://www.cisco.com/techsupport
Copyright (c)
1986-2009 by Cisco Systems, Inc.
Compiled Wed
25-Feb-09 15:36 by prod_rel_team
---resumido---
Installed
image archive
Cisco 1841
(revision 7.0) with 239616K/22528K bytes of memory.
Processor
board ID FTX1144X02D
2
FastEthernet interfaces
4 Low-speed
serial(sync/async) interfaces
1 Virtual
Private Network (VPN) Module
DRAM
configuration is 64 bits wide with parity disabled.
191K bytes of
NVRAM.
1951616K
bytes of USB Flash usbflash0 (Read/Write)
SETUP: new
interface NVI0 placed in "shutdown" state
% Crashinfo
may not be recovered at flash:crashinfo (memoria
retirada para esta prueba)
% This file
system device reports an error
Press RETURN
to get started!
Cordoba> (boot OK)
3.- Enviando mensajes syslog al pendrive
Cuando no
enviamos los mensajes syslog a un server, los mensajes se pierden si el router
pierde alimentación
o se reinicia
por algun motivo, por lo tanto intentaremos guardar los mismos, no en la flash
del equipo, sino en
el pendrive,
ya que estamos con pruebas del USB.
Cordoba(config)#logg on (activa
syslog)
Cordoba(config)#logg buffered (almacena
syslog en la memoria RAM)
Cordoba(config)#logg persistent url usbflash0: (almacena syslog en el pendrive)
%File system
type of "usbflash0:/" is not supported
Cordoba(config)#
Pruebas con un Cisco 1941
*Oct 31
16:57:22.798: %USBFLASH-5-CHANGE: usbflash0 has been inserted!
Cisco_1941#sh file system (verificamos
pendrive)
File Systems:
Size(b) Free(b) Type
Flags Prefixes
- - opaque
rw archive:
- - opaque
rw system:
- - opaque
rw tmpsys:
- - opaque
rw null:
- -
network rw tftp:
* 256487424 188612608 disk
rw flash0: flash:#
- - disk
rw flash1:
262136 255100 nvram
rw nvram:
- - opaque
wo syslog:
- - opaque
rw xmodem:
- - opaque
rw ymodem:
- -
network rw rcp:
- -
network rw http:
- -
network rw ftp:
- -
network rw scp:
- -
opaque ro tar:
- -
network rw https:
- - opaque
ro cns:
7995752448 4552060928
usbflash rw usbflash0: (pendrive de 8 GB OK, el anterior de 2 GB
no lo reconoce)
Cisco_1941#config t
Cisco_1941(config)#logg on
Cisco_1941(config)#logg buffered
Cisco_1941(config)#logg persistent url usbflash0: (no reconoce el path)
Translating
"persistent"...domain server (255.255.255.255)
^
% Invalid
input detected at '^' marker.
Cisco_1941(config)#logg persistent url ? (verificamos posibles alternativas, no es una posibilidad
el pendrive)
flash0:
Filesystem name
flash1:
Filesystem name
flash:
Filesystem name
Cisco_1941(config)#
end
Connection
lost !
(2012)
Tales for lonely nights
Rosario, Argentina