Diferència entre revisions de la pàgina «A4. Transferència d'arxius»

De Wiki IES Marianao. Departament Informàtica
Dreceres ràpides: navegació, cerca
(Restaurar contrasenya (Switch))
(Carregar imatge IOS (Switch))
Línia 226: Línia 226:
 
!--- If the Xmodem file transfer is successful, you return to the  
 
!--- If the Xmodem file transfer is successful, you return to the  
 
!--- switch: prompt.
 
!--- switch: prompt.
 
 
switch:
 
switch:
 
 
switch: boot flash:c2955-i6q4l2-mz.121-13.EA1.bin
 
switch: boot flash:c2955-i6q4l2-mz.121-13.EA1.bin
 
</pre>
 
</pre>

Revisió del 22:12, 12 gen 2015

torna M7 - Planificació i administració de xarxes


Transferència d'arxius

Per transferir arxius entre els dispositius (CISCO) i un ordinador es fa servir el protocol TFTP. Aquest és un protocol lleuger, semblant al FTP que funciona sobre el port 69 UDP.


Les principals utilitats són:

  • Guardar / Restaurar la configuració
  • Actualitzar IOS
  • Guardar / Restaurar IOS (Sistema Operatiu)


Els exemples es basen en el IOS d'un CISCO de la sèrie 1700 (Router).


Reiniciar configuració

La configuració inicial es troba a la memòria nvram, només cal esborrar-la.

Router#delete nvram:startup-config
Delete filename [startup-config]?
Delete nvram:startup-config? [confirm]
[OK]
Router#
Router#
Router#reload
Proceed with reload? [confirm]

Configurar el servidor TFTP a Ubuntu

http://www.davidsudjiman.info/2006/03/27/installing-and-setting-tftpd-in-ubuntu/

Es pot comprovar si funciona fent

$netstat -l -udp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address StatePID/Program name
udp 0 0 *:59450 *:*-
udp 0 0 *:bootpc *:*-
udp 0 0 *:tftp *:*-
udp 0 0 *:mdns *:*-

Guardar / Restaurar configuració.

Configurar IP de la mateixa xarxa que el servidor TFTP

Router(config)#interface FastEthernet 0
Router(config-if)#ip address 192.168.2.7 255.255.255.0
Router(config-if)#no shut
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#exit
Router#show ip interface brief
Interface IP-Address OK? Method Status Prol
FastEthernet0 192.168.2.7 YES manual up up

Per guardar la configuració

Router#copy running-config tftp
Address or name of remote host []? 192.168.2.40
Destination filename [router-confg]? running-config
.!!
1453 bytes copied in 8.332 secs (174 bytes/sec)

Per restaurar la configuració (Cal que el fitxer de configuració estigui a la carpeta del tftp, amb permisos suficients 777)


Router#copy tftp running-config
Address or name of remote host [192.168.2.40]?
Source filename [running-config]?
Destination filename [running-config]?
Accessing tftp://192.168.2.40/running-config...
Loading running-config from 192.168.2.40 (via FastEthernet0): !
[OK - 1453 bytes]

1453 bytes copied in 10.468 secs (139 bytes/sec)
Router#

Guardar IOS.

El IOS es guarda en la part de la memòria del Router anomenada FLASH


Router#dir flash:
Directory of flash:/

1 -rw- 13672808 <no date> c1700.bin

33292284 bytes total (19619412 bytes free)
Router#copy flash: tftp
Router#copy flash: tftp:
Router#copy flash: tftp
Source filename []?
?File name not specified
%Error parsing filename (No such file or directory)
Router#dir flash:
Directory of flash:/

1 -rw- 13672808 <no date> c1700.bin

33292284 bytes total (19619412 bytes free)
Router#copy flash: tftp
Source filename []? c1700.bin
Address or name of remote host []? 192.168.2.40
Destination filename [c1700.bin]?
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
13672808 bytes copied in 60.828 secs (224778 bytes/sec)

Mode Monitor

El mode monitor de ROM és un estat en que arrenca el router si no disposa de IOS o existeix algun error que no permet carregar-lo (s'ha cancel·lat la càrrega d'aquest per exemple).


Aquest mode té un conjunt senzill de comandes que permeten recuperar el IOS, establir comunicacions TFTP o canviar el registre del router i restablir contrasenyes per exemple.


Es pot forçar entrar en mode monitor enviant CTRL + BREAK durant la càrrega inicial (CTRL + SHIFT + BREAK + C, al Packet Tracer 5.3).


rommon 1>dir flash:


Configurar comunicació TFTP

/* Aquesta és l’adreça que s’assignarà a la interfase del router */

rommon 1> IP_ADDRESS=192.168.1.2

rommon 2> IP_SUBNET_MASK=255.255.255.0

/* Aquesta és la informació del servidor TFTP */

rommon 3> DEFAULT_GATEWAY=192.168.1.10

rommon 4> TFTP_SERVER=192.168.1.10


rommon 5> TFTP_FILE=c1700-y-mz.122-2.XJ.BIN

/* Executa la descàrrega i reinicia*/

rommon 6> tftpdnld

rommon 7> reset

Restaurar contrasenya

Cal modificar el registre del Router (normalment en valors 0x2102 o 0x10) per desactivar la càrrega de la configuració a l'inici ( 0x2142)

rommon 1> confreg 0x2142

rommon 2> reset


Modifica l’arxiu de configuració com has realitzat a les activitats anteriors i torna a posar el valor del registre inicial. Guarda els canvis en la configuració a l’arxiu de configuració inicial


router1# config-register 0x2102

router1# copy running-config startup-config

Restaurar contrasenya (Switch)

En els switchs 2950 Series es pot entrar mode switch: presionant "mode" mentre s'encèn

switch: flash_init
switch: load_helper
switch: delete flash:config.text
switch: boot

(Això no està disponible des del Packet Tracer)

Carregar imatge IOS (Switch)

La càrrega en aquest cas s'ha de fer per la connexió de consola i és molt lenta

switch: flash_init
switch: load_helper
switch: copy xmodem: flash:c2955-i6q4l2-mz.121-13.EA1.bin
Begin the Xmodem or Xmodem-1K transfer now...
CCCCCCC.........................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
.............................................................................
File "xmodem:" successfully copied to "flash:c2955-i6q4l2-mz.121-13.EA1.bin"

!--- If the Xmodem file transfer fails for some reason, restart the process.
!--- If the Xmodem file transfer is successful, you return to the 
!--- switch: prompt.
switch:
switch: boot flash:c2955-i6q4l2-mz.121-13.EA1.bin


(Això no està disponible des del Packet Tracer)