Вы находитесь на странице: 1из 35

UNIVERSIDAD SAN FRANCISCO XAVIER DE CHUQUISACA

UNIV: CARLOS G. MOLLINEDO PILLCO UNIV. NATALIA FLORES ACUA MATERIA: SEGURIDAD DE REDES TITULO: COMANDOS DE SWITCH PARA HARDENING FECHA: 05-03-12

Este es un resumen de varios comandos aplicables en switch cisco de la serie catalyst Si nos hemos conectado desde la consola puede que nos pida una contrasea (ya lo iremos viendo) o directamente se nos presente ante nosotros al igual que una revelacin. switch> Vamos ahora a comprobar en que nivel de privilegios nos estamos moviendo ejecutando los primeros comandos. switch > sh privilege Current privilege level is 1 Con este nivel de usuario muy poquitas cosas aparte de algunas consultas vamos a poder realizar. Para empezar a jugar de verdad tenemos que entrar en modo privilegiado. switch > enable (=ena) En este punto siempre nos va a pedir una contrasea que por defecto es cisco, y os sorprenderas de la cantidad de dispositivos que harn caso a esa mgica palabra. Las password por defecto son el brete Sesamo de la informtica. Para que molestarse en cambiarla. Hay dos reglas por excelencia en este mundo. La primera es ya lo modificar o har mas tarde, y la segunda es si funciona para que vamos a tocar. Switch # (la presencia de esta almohadilla es buena seal) Volvemos a comprobar ahora el nuevo nivel de privilegios con que contamos. Switch # sh privilege Current privilege level is 15 Esto si que ya tiene otra pinta. Ahora vamos a ver como se nos presenta el Switch cuando entramos en los diferentes modos. Si entramos en modo configuracin : Switch # configure terminal (=conf t) switch (config) # Y ya cuando estemos configurando alguna de las interfaces : switch (config) # interface gigabitEthernet 1/0/23 switch (config-if) # Para salir de los diferentes modos podemos utilizar la palabra exit. switch (config-if) # exit switch (config) #

O end En caso de querer salir directamente al modo privilegiado. switch (config-if) # end switch # Realizamos la misma accin con ^Z Con un nuevo exit salimos al modo usuario switch #exit switch > Y si ya tecleamos logout o nuevamente exit salimos completamente del Switch. Si en modo privilegiado ejecutamos la orden para reiniciar el router: switch # reload Y durante los primeros 60s de inicio del Switch pulsamos la tecla break, entraremos en lo que se conoce como modo monitor, modo que nos va a servir en el caso de tener problemas a la hora de cargar la IOS. rommon # > Volviendo al modo usuario ejecutando : rommon # > continue Vemos que podemos introducir los comandos de forma abreviada (configure terminal o conf t) adems de jugar con el tabulador introduciendo nicamente el inicio del comando y el se encargara de completarlo. switch# conf<Tab> switch# configure Si queremos conocer los comandos o las opciones de alguno en concreto jugaremos con el smbolo ?. switch #? Exec commands: <1-99> Session number to resume access-enable Create a temporary Access-List entry access-template Create a temporary Access-List entry archive cd ................... manage archive files Change current directory

Miramos a ver lo que nos dice el comando help. switch # help Help may be requested at any point in a command by entering a question mark '?'. If nothing matches, the help list will be empty and you must backup until entering a '?' shows the available options. Two styles of help are provided: 1. Full help is available when you are ready to enter a command argument (e.g. 'show ?') and describes each possible argument. 2. Partial help is provided when an abbreviated argument is entered and you want to know what arguments match the input (e.g. 'show pr?'.) Lo que ya hemos comentado. Podemos utilizar ?, para conocer mas sobre los comandos y sobre sus argumentos. Veamos un ejemplillo. switch # configure ? memory Configure from NV memory network Configure from a TFTP network host terminal Configure from the terminal Tenemos la posibilidad de consultar los comandos que ya hemos ido introduciendo. switch # sh history term mon sh debugging Por defecto nos guarda 10 lneas, pero podemos ampliarlo. switch (config) # terminal history size 250 Y jugar con los cursores para que nos reescriba los ltimos comandos tecleados. Ahora vamos a guardar un pequeo histrico, muy til en caso de ser necesario comprobar lo que ha estado pasando. switch (config)#logging buffered 64000 switch (config)#logging history size 250 Cuando queramos eliminar una configuracin se utiliza la palabra no. Si en este caso por ejemplo no queremos utilizar la configuracin a nivel de histrico realizada. switch # terminal no history

Muy importante ese no ya que se trata de lo que vamos a anteponer siempre que queramos borrar parte de la configuracin. El juego de teclas Ctrl-A, nos permitir movernos al inicio de lo que hemos tecleado y pulsando Ctrl-E nos desplazaremos al final de la lnea. Otro comando muy importante es el comando show (sh) para mostrar elementos de la configuracin, y prometo lo vamos a utilizar hasta la saciedad. Bueno vamos a empezar a hacer algunas cosillas. Nos ponemos en modo configuracin y vamos a empezar cambiando el nombre que nos presenta el dispositivo. switch (config) # hostname Mi_Switch Y ahora vamos a ponerle algunas contraseas. Las de conexin por telnet por ejemplo: Mi_Switch (config) # line vty 0 4 Mi_Switch (config) # password nueva_pass Ahora modificamos las que nos solicita cuando nos conectemos por consola. Mi_Switch (config) #line console 0 Mi_Switch (config) #login Mi_Switch (config) #password nueva_pass Y por ltimo la mas importante. La de entrada en modo privilegiado, y esta la generamos de forma cifrada. Mi_Switch (config) #enable secret new_password Posteriormente y en este mismo documento vamos a ver como activar ssh . Ahora salimos del modo configuracin y vamos a ir viendo algunas interioridades del dispositivo al que estamos conectados. Mi_Switch # show ver Cisco IOS Software, C3750 Software (C3750-IPBASE-M), Version 1X.X(XX)SE5, RELEASE SOFTWARE (fc1) Copyright (c) 1986-2007 by Cisco Systems, Inc. Compiled Thu 19-Jul-07 19:15 by nachen Image text-base: 0x00003000, data-base: 0x01080000 ROM: Bootstrap program is C3750 boot loader BOOTLDR: C3750 Boot Loader (C3750-HBOOT-M) Version 1X.x(xxr), RELEASE SOFTWARE (fc1) name-Sp uptime is 0 weeks, 0 days, 1 hours, 5 minutes System returned to ROM by power-on System image file is

.......... Como veis nos da un montn de informacin sobre la IOS cargada, el tiempo que lleva levantado.. Lanzamos nuestro primer diagnstico : Mi_Switch # sh diagnostic post Stored system POST messages: Switch 1 --------POST: CPU MIC register Tests : Begin POST: CPU MIC register Tests : End, Status Passed POST: PortASIC Memory Tests : Begin POST: PortASIC Memory Tests : End, Status Passed POST: CPU MIC interface Loopback Tests : Begin POST: CPU MIC interface Loopback Tests : End, Status Passed POST: PortASIC RingLoopback Tests : Begin POST: PortASIC RingLoopback Tests : End, Status Passed POST: PortASIC CAM Subsystem Tests : Begin POST: PortASIC CAM Subsystem Tests : End, Status Passed POST: PortASIC Port Loopback Tests : Begin POST: PortASIC Port Loopback Tests : End, Status Passed Pero podemos preparar algn diagnstico : Mi_Switch # diagnostic start switch 1 test 1 Y posteriormente ver la informacin que nos devuelve : Mi_Switch # sh diagnostic result switch 1 Switch 1: SerialNo : YUULLDX0 Overall diagnostic result: UNTESTED Test results: (. = Pass, F = Fail, U = Untested) 1) TestPortAsicStackPortLoopback ---> U 2) TestPortAsicLoopback ------------> U 3) TestPortAsicCam -----------------> U

4) TestPortAsicRingLoopback --------> U 5) TestMicRingLoopback -------------> U 6) TestPortAsicMem -----------------> U Vemos los diagnsticos que tenemos lanzados: Mi_Switch # sh diagnostic status <BU> - Bootup Diagnostics, <HM> - Health Monitoring Diagnostics, <OD> - OnDemand Diagnostics, <SCH> - Scheduled Diagnostics ====== ================================= =============================== ====== Card Description 1 2 N/A N/A Current Running Test N/A N/A Run by ------ --------------------------------- ------------------------------- ------

====== ================================= =============================== ====== Seguimos mirando cositas. Ahora nos toca comprobar el estado de la CPU. Mi_Switch # show processes cpu CPU utilization for five seconds: 6%/0%; one minute: 7%; five minutes: 7% PID Runtime(ms) Invoked 1 2 3 5 34 0 5985 574 5 2376 1891 2281851 uSecs 5Sec 1Min 5Min TTY Process 0 0.00% 0.00% 0.00% 0 Load Meter 8946 0.00% 0.10% 0.06% 0 Check heaps 59 0.00% 0.00% 0.00% 0 Chunk Manager 0 0.00% 0.00% 0.00% 0 CEF RP IPC Backg 2518 0.00% 0.00% 0.00% 0 Pool Manager

4 12095866 1352065 ...................

O incluso ver un histrico del uso de la CPU : Mi_Switch # show processes cpu history 7776666677777666668888888888777776666666666666667777788888 100 90 80 70 60

50 40 30 20 10 ********************************************************** 0....5....1....1....2....2....3....3....4....4....5....5.... 0 5 0 5 0 5 0 5 0 5 CPU% per second (last 60 seconds) 1 44 100 90 80 70 60 50 40 30 20 * ** ** #* ** ** #* * ** #* * * * # 43 32 4

8998919982688898988878872888888889987899599888888889986888

10 ########################################################## 0....5....1....1....2....2....3....3....4....4....5....5.... 0 5 0 5 0 5 0 5 0 5 CPU% per minute (last 60 minutes) * = maximum CPU% # = average CPU% 4444444444544444444444444446311141111114111141111113111131111114111141 6842642755774623535755361420911120112123011042120214110171111116101101 100 90 80 70 60 * * * * * * * * * * * * * * * * * * * * 50 ** * ***** * * **** * * 40 ***************************** * 30 ***************************** * 20 ***************************** *

10 ###################################################################### 0....5....1....1....2....2....3....3....4....4....5....5....6....6....7. 0 5 0 5 0 5 0 5 0 5 0 5 0

CPU% per hour (last 72 hours) * = maximum CPU% # = average CPU% Ahora vamos a ver que podemos llegar a conocer sobre el estado de la memora : Mi_Switch # show memory Head Total(b) Used(b) Free(b) Lowest(b) Largest(b) 8449564 4125156 3885316 3989576 Processor 1D0AA50 91547056 29022824 62524232 60725268 61665840 I/O 7400000 12574720 ..... Mi_Switch #show processes memory Processor Pool Total: 91547056 Used: 29021980 Free: 62525076 I/O Pool Total: 12574720 Used: 8449404 Free: 4125316 PID TTY Allocated 0 0 1 0 2 0 ........... Una cosa de la que vamos a tirar muchsimo es comprobar y ver la configuracin que esta corriendo en la maquina (RAM ). Mi_Switch # sh running Current configuration : 6682 bytes ! version 1X.X no service pad service timestamps debug datetime localtime service timestamps log datetime localtime ! hostname Mi_Switch ! ........................... Esto es muy importante ya que podemos ver la configuracin actual que esta corriendo en el dispositivo. Si realizamos algn tipo de modificacin en la mquina es aqui donde van a quedar reflejados los cambios. Pero estos se guardan en RAM y son voltiles. Es decir si no los Freed Holding Getbufs Retbufs Process 0 0 0 0 0 *Init* 0 *Sched* 0 Chunk Manager 0 Load Meter 13876 39208

0 0 46510528 13495924 30791388 13876 2062240 835100 180 818240 180 0 0 121256380 120012788 3908

552792 11687216 3583592 *Dead*

guardamos y apagamos el switch se perdern y a tirarnos de los pelos!. Por ello es necesario guardarlos en lo que se conoce como NVRAM . Mi_Switch # copy running-config startup-config O simplemente Mi_Switch # wr Tambien podemos realizar el paso inverso que es el de volver a cargar lo que tenemos guardado en NVRAM sobre la RAM en caso de que las modificaciones no nos terminen de cuadrar. Lo mismo que podemos ver lo que se esta ejecutando, podemos comprobar lo que esta guardado en la NVRam y se va a ejecutar cuando reiniciemos nuestro Catalyst, para poder comparar los cambios por ejemplo. Mi_Switch # sh startup-config Current configuration : 6682 bytes ! version 1X.X no service pad service timestamps debug datetime localtime service timestamps log datetime localtime ! hostname Mi_Switch ! El comando show tambin nos permite filtrar la informacin que nos va a mostrar, ejecutndolo de la siguiente forma : Mi_Switch # show running-config | include Lo_que_buscamos Mi_Switch # show ip interfaces brief | exclude Lo_que excluimos Incluso llegar a mostrar la configuracin a partir de la primera lnea con que se tropiece: Mi_Switch # show running-config | begin interface Es cierto que podemos reiniciar el switch de forma remota, incluso aplicndole un intervalo para el reinicio. Para que nos puede servir esto?. Por ejemplo si nos hemos conectado de forma remota y no disponemos de una mas remotas en caso de cometer un error de configuracin que nos deje sin acceso al Switch. Si lo hemos configurado para que se reinicie en X minutillos al menos estaremos cubiertos. Pero cuidadin a ver si no hemos guardado los cambios y se nos reinicia. Mi_Switch # reload ? LINE at cancel Reason for reload Reload at a specific time/date Cancel pending reload

in slot <cr>

Reload after a time interval Slot number card

standby-cpu Standby RP

Si queremos comprobar la hora : Mi_Switch # sh clock *20:39:01.773 GMT Sat Feb 4 2012 Vamos ahora a ver los usuarios se encuentran conectados : Mi_Switch # sh users Line User Host(s) idle Idle Location * 1 vty 0 00:00:00 172.100.10.1

A nivel informativo, podemos poner unos banner de aviso que siempre nos pueden venir bien. Mi_Switch # banner login Solo se permite acceder a este equipo a personal autorizado Si tenemos una infraestructura montada con diferentes dispositivos Cisco, podemos hacer uso del protocolo CDP que nos va a permitir conocer como se relacionan las maquinitas entre si.. Comprobamos que lo tenemos activado: Mi_Switch # sh cdp Global CDP information: Sending CDP packets every 60 seconds Sending a holdtime value of 180 seconds Sending CDPv2 advertisements is enabled Y ahora le preguntamos por los vecinillos de su alrededor que tiene conectados : Mi_Switch # sh cdp neighbors Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone Device ID 2960_00 Gig 1/0/29 2960_00 Gig 2/0/29 ........ Vemos sobre que interfaces esta corriendo : 147 SI WS-C2960- Fas 0/47 156 SI WS-C2960- Fas 0/48 Local Intrfce Holdtme Capability Platform Port ID

Mi_Switch #sh cdp interface GigabitEthernet1/0/1 is up, line protocol is up Encapsulation ARPA Sending CDP packets every 60 seconds Holdtime is 180 seconds GigabitEthernet1/0/2 is up, line protocol is up Encapsulation ARPA Sending CDP packets every 60 seconds Holdtime is 180 seconds GigabitEthernet1/0/3 is up, line protocol is up Encapsulation ARPA Sending CDP packets every 60 seconds Holdtime is 180 seconds .................... Y en detalle informacin de alguno de nuestros vecinos : Mi_Switch #sh cdp entry C500 ------------------------Device ID: C500 Entry address(es): IP address: 10.100.10.243 Platform: cisco WS-CE500-24PC, Capabilities: Switch IGMP Interface: GigabitEthernet2/0/5, Port ID (outgoing port): GigabitEthernet2 Holdtime : 158 sec Version : Cisco IOS Software, CE500 Software (CE500-LANBASE-M), Version 1X.X(25)SEG4, RELEASE SOFTWARE (fc1) Copyright (c) 1986-2007 by Cisco Systems, Inc. Compiled Mon 13-Aug-07 17:34 by yenanh ............................. Ahora vamos a ver el estado de las interfaces, esas bocas donde conectamos los cablecitos de red, con unas lucecillas que nos van informando de su estado. Mi_Switch #sh ip interface brief Interface Vlan1 Vlan20 Vlan30 IP-Address unassigned unassigned OK? Method Status Protocol up up

YES NVRAM administratively down down YES manual up

10.100.5.254 YES NVRAM up

GigabitEthernet1/0/1 unassigned GigabitEthernet1/0/2 unassigned GigabitEthernet1/0/3 unassigned ........ GigabitEthernet1/0/17 unassigned .........

YES unset up YES unset up YES unset up YES unset up

up up up up

Obtenemos contadores de las interfaces : Mi_Switch # show interfaces counters Port Gi1/0/1 Gi1/0/2 Gi1/0/3 Gi1/0/4 InOctets InUcastPkts InMcastPkts InBcastPkts 16284332242 4277636363 2439260549 29124384600 75167733 22038607 12111995 66011692 33892 356595 1273524 1349831 0 119795 37134 253620

Y comprobamos si tienen algun tipo de error : Mi_Switch #sh interfaces counters errors Port Gi1/0/1 Gi1/0/2 Gi1/0/3 Gi1/0/4 Align-Err FCS-Err Xmit-Err Rcv-Err UnderSize 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Podemos filtrar la informacin a una nica interface : #show interfaces gigabitEthernet 1/0/17 counters Port Gi1/0/17 Port Gi1/0/17 InOctets InUcastPkts InMcastPkts InBcastPkts 284708285 585828 1962163 216197

OutOctets OutUcastPkts OutMcastPkts OutBcastPkts 184472676 584727 98765 813516

Mi_switch# sh interfaces gigabitEthernet 1/0/17 counters errors Port Align-Err FCS-Err Xmit-Err Rcv-Err UnderSize 0 0 0 0 0 Runts

Gi1/0/17 Port

Single-Col Multi-Col Late-Col Excess-Col Carri-Sen

Giants Gi1/0/17 0 Ponemos los contadores a 0 para ver si se siguen reproduciendo los errores. Mi_Switch #clear counters Muchas veces va a ser muy interesante conocer la Mac conectada a cada una de las bocas Mi_Switch #sh mac-address-table Mac Address Table ------------------------------------------Vlan Mac Address ---- ----------Type Ports Gi1/0/3 Gi1/0/2 Gi2/0/4 Gi2/0/2 Gi2/0/29 Gi1/0/29 0 0 0 0 0 0

-------- -----

1 001e.14b9.c201 DYNAMIC 1 001e.14b9.c881 DYNAMIC 1 001e.14b9.ca02 DYNAMIC 1 001e.14b9.e282 DYNAMIC 1 001e.4974.692f DYNAMIC 1 001e.4974.6930 DYNAMIC

Igualmente podemos restringirlo la informacin a una nica interface o Vlan (ya las veremos mas tarde) : Mi_switch# sh mac-address-table interface gigabitEthernet 1/0/17 Mi_switch# show mac address-table dynamic vlan 30 Mac Address Table ------------------------------------------Vlan Mac Address ---- ----------Type Ports Gi1/0/36 Gi1/0/31 Gi2/0/39 Gi1/0/35 Gi1/0/34 Gi2/0/35 Gi2/0/34 Gi2/0/33

-------- -----

30 0007.e92f.1d63 DYNAMIC 30 0009.0f09.0c06 DYNAMIC 30 000c.295d.a9f2 DYNAMIC 30 000c.7617.aec9 DYNAMIC 30 0012.793a.25cb DYNAMIC 30 0013.211d.4079 DYNAMIC 30 0019.bb38.bed6 DYNAMIC 30 001a.4bdc.32fa DYNAMIC

Mac Address Table Total Mac Addresses for this criterion: 8 Ahora vamos a ir entrando ms en detalle en alguna de las interfaces para ver informacin como si esta levantada, MTU, velocidad a la que negocia, trfico que se mueve, errores Si queremos ver que nos dice el fichero de configuracin sobre la interface sin tener que ir recorrindolo de forma completa. Mi_switch#sh running-config interface gigabitEthernet 1/0/17 Building configuration... Current configuration : 203 bytes ! interface GigabitEthernet1/0/17 description Conexion-VLAN10-DMZ switchport trunk encapsulation dot1q switchport trunk native vlan 38 switchport trunk allowed vlan 10,38 switchport mode trunk end Y conocer el estado de una determinada interface : Mi_switch# sh interfaces gigabitEthernet 1/0/17 status Port Name Status Vlan Duplex Speed Type a-full a-100

Gi1/0/17 Conexion-VLAN10-DM connected trunk 10/100/1000BaseTX Mi_Switch #sh interfaces gi 1/0/17 capabilities GigabitEthernet1/0/17 Model: Type: Speed: Duplex: Trunk mode: Channel: WS-C3750G-48TS 10/100/1000BaseTX 10,100,1000,auto half,full,auto 802.1Q,ISL on,off,desirable,nonegotiate yes

Trunk encap. type:

Broadcast suppression: percentage(0-100)

Flowcontrol: Fast Start: QoS scheduling: CoS rewrite: ToS rewrite: UDLD: Inline power: SPAN: PortSecure: Dot1x:

rx-(off,on,desired),tx-(none) yes rx-(not configurable on per port basis),tx-(4q2t) yes yes yes no source/destination yes yes

Mi_Switch #sh interfaces gigabitEthernet 1/0/17 switchport Name: Gi1/0/17 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 35 (Server) Administrative Native VLAN tagging: enabled Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk Native VLAN tagging: enabled Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enabled: 10,35 Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Mi_Switch #sh interfaces gigabitEthernet 1/0/17 GigabitEthernet1/0/17 is up, line protocol is up (connected) Hardware is Gigabit Ethernet, address is 001d.15ad.b291 (bia 001d.15ad.b291)

Description: Conexion-VLAN10 MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) Full-duplex, 100Mb/s, media type is 10/100/1000BaseTX input flow-control is off, output flow-control is unsupported ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:00, output 00:00:03, output hang never Last clearing of "show interface" counters 3w0d Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo Output queue: 0/40 (size/max) 5 minute input rate 1000 bits/sec, 1 packets/sec 5 minute output rate 1000 bits/sec, 1 packets/sec 2758473 packets input, 284092943 bytes, 0 no buffer Received 2174449 broadcasts (0 multicasts) 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 watchdog, 1958590 multicast, 0 pause input 0 input packets with dribble condition detected 1493558 packets output, 184046439 bytes, 0 underruns 0 output errors, 0 collisions, 0 interface resets 0 babbles, 0 late collision, 0 deferred 0 lost carrier, 0 no carrier, 0 PAUSE output 0 output buffer failures, 0 output buffers swapped out Mi_Switch #sh controllers ethernet-controller gigabitEthernet 1/0/17 Transmit GigabitEthernet1/0/17 184901883 Bytes 587326 Unicast frames 98841 Multicast frames 811732 Broadcast frames 0 Too old frames 0 Deferred frames 0 MTU exceeded frames 0 1 collision frames 0 2 collision frames 0 3 collision frames Receive 584175 Unicast frames 1959251 Multicast frames 215803 Broadcast frames 146977335 Multicast bytes 20946961 Broadcast bytes 0 Alignment errors 1 FCS errors 0 Oversize frames 110978897 Unicast bytes

284244290 Bytes

0 4 collision frames 0 5 collision frames 0 6 collision frames 0 7 collision frames 0 8 collision frames 0 9 collision frames 0 10 collision frames 0 11 collision frames 0 12 collision frames 0 13 collision frames 0 14 collision frames 0 15 collision frames 0 Excessive collisions 0 Late collisions 0 VLAN discard frames 0 Excess defer frames 744191 64 byte frames 433315 127 byte frames 106126 255 byte frames 213518 511 byte frames 570 1023 byte frames 179 1518 byte frames 0 Too large frames 0 Good (1 coll) frames 0 Good (>1 coll) frames

0 Undersize frames 0 Collision fragments 420565 Minimum size frames 1968394 65 to 127 byte frames 145235 128 to 255 byte frames 224548 256 to 511 byte frames 248 512 to 1023 byte frames 240 1024 to 1518 byte frames 0 Overrun frames 0 Pause frames 0 Symbol error frames 0 Invalid frames, too large 0 Valid frames, too large 0 Invalid frames, too small 0 Valid frames, too small 0 Too old frames 0 Valid oversize frames 0 System FCS error frames 0 RxPortFifoFull drop frame

Comprobamos si tenemos activado el protocolo Spanning Tree , muy importante e interesante para evitar bucles dentro de nuestra de red, controlando la degradacin o incluso en el peor de los casos la cada completa. Mi_Switch #sh spanning-tree summary Switch is in rapid-pvst mode Root bridge for: VLAN0001, VLAN0020 Extended system ID Portfast Default is enabled is disabled

PortFast BPDU Guard Default is disabled Portfast BPDU Filter Default is disabled Loopguard Default UplinkFast is disabled is disabled EtherChannel misconfig guard is enabled Stack port is StackPort1

BackboneFast

is disabled

Configured Pathcost method used is short Name VLAN0001 VLAN0020 ........................... Aqu debemos detenernos un momentito para conocer un poco sobre lo que son las Vlan. Se trata de un concepto que nos va a permitir separadas las redes de forma lgica dentro de un mismo Switch fsico. Nos acordamos de los dominios de difusin (broadcast) que estuvimos comentando?, pues nos va permitir separarlos con la ventaja que no solo aporta en el trafico que no se genera, sino en que adems separamos completamente las redes con las ventajas de control que eso implica. Cuando definimos interfaces dentro de una Vlan solo van a tener visibilidad entre ellas. Pero aqu aparece el concepto de modo trunk , en el que una interface configurada en este modo va a poder transportar mltiples VLAN. En un puerto definido de este modo, vamos a ser nosotros quienes vamos a poder definir si tiene visibilidad sobre todas las Vlans que tengamos definidas en el Switch, o solo sobre aquellas que nos interese, adems de poder indicar con cual est trabajando de forma nativa. Si tenemos varios Switches conectados entre si, podemos hacer uso del protocolo VTP (VLAN Trunking Protocol) que nos va a permitir gestionar de forma eficaz las Vlans. Por comentarlo de forma resumida esta parte del VTP, decir que va a poder trabajar en 3 modos diferentes: server, client y transparent. Vamos a tener que configurarlo sobre un mismo dominio, y siempre tendremos al menos un server que es quien maneja el cotarro. Si realizamos modificaciones sobre las Vlans, estas se distribuyen al resto de los switches que se encuentren dentro del mismo dominio. Luego tendremos switches con VTP en modo cliente que recogern de forma automtica todos los cambios, y sobre los cuales no se van a poder realizar modificaciones. Y por ltimo los de modo transparent, en el que no se pueden crear o modificar vlans que afecten al resto de la electrnica pero que si que se prodrn generar Vlans a nivel local. VTP puede operar sin contrasea con lo que es sencillo hacer la pueta por lo que es muy recomendable asignarle una. Vamos a ver ahora si lo tenemos activado Mi_switch# sh vtp status VTP Version Configuration Revision Number of existing VLANs VTP Operating Mode VTP Domain Name :2 : 35 : 23 : Server : Nuestro_Dominio Blocking Listening Learning Forwarding STP Active 0 0 0 0 0 0 12 21 12 21

---------------------- -------- --------- -------- ---------- ----------

Maximum VLANs supported locally : 1005

VTP Pruning Mode VTP V2 Mode VTP Traps Generation MD5 digest

: Disabled : Disabled : Disabled : 0x87 0xD0 0xAF 0x7A 0xC8 0xBA 0x5C 0x69

Configuration last modified by 10.100.X.2 at 5-12-11 23:47:10 Local updater ID is 10.100.X.253 on interface Vl10 (lowest numbered VLAN interface found) Si queremos configurar VTP : Mi_switch#vlan database Mi_switch#vtp domain nombre_dominio Mi_switch#vtp (client | server | transparent) Mi_switch#exit Otra forma de hacer lo mismo prodra ser : Mi_switch# vtp ? domain file Set the name of the VTP administrative domain. Configure IFS filesystem file where VTP configuration is stored.

interface Configure interface as the preferred source for the VTP IP updater address. mode Configure VTP device mode password Set the password for the VTP administrative domain pruning Set the adminstrative domain to permit pruning version Set the adminstrative domain to VTP version Vamos ahora a ver las vlan que tenemos definidas y los puertos definidos sobre cada una de ellas : Mi_switch# sh vlan VLAN Name 1 default 10 Gestion Status Ports active Gi1/0/49, Gi1/0/50 active Gi1/0/14, Gi1/0/21, Gi1/0/41

---- -------------------------------- --------- -------------------------------

Entramos en detalle en alguna Vlan : #sh vlan id 10 VLAN Name 10 Gestion Status Ports active Gi1/0/2, Gi1/0/3, Gi1/0/4

---- -------------------------------- --------- -------------------------------

VLAN Type SAID 10 enet 100010 Remote SPAN VLAN ---------------Disabled

MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 1500 - 0 0

---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------

Primary Secondary Type

Ports

------- --------- ----------------- -----------------------------------------Si ahora queremos ver todos los puertos definidos en modo trunk : Mi_Switch#sh interfaces trunk Port Gi1/0/2 Gi1/0/3 Gi1/0/4 ................. Port Gi1/0/2 Gi1/0/3 Port Gi1/0/2 Gi1/0/3 Vlans allowed on trunk 1-4094 1-4094 Vlans allowed and active in management domain 1,10,30-33,37-42 1,10,100-101,104 Mode on on on Encapsulation Status 802.1q 802.1q 802.1q trunking trunking trunking 1 1 1 Native vlan

...................

................... Vemos que para el trunking estamos utilizando el protocolo IEEE 802.1Q conocido tambien como dot1Q. Vamos a ver la configuracin trunk definida en una de las interfaces Mi_Switch# sh interfaces gigabitEthernet 1/0/17 trunk Port Mode Encapsulation Status 802.1q trunking Native vlan 38

Gi1/0/17 on Port

Vlans allowed on trunk

Gi1/0/17 10,38

Port

Vlans allowed and active in management domain

Gi1/0/17 10,38 Port Vlans in spanning tree forwarding state and not pruned

Gi1/0/17 10,38 Ahora que ya sabemos alguna cosita ms sobre las Vlan, vamos a juntarlo todo y jugar un poquito con las interfaces y Vlans. Vamos a generar una vlan de partida y luego le vamos a asignar una interface o aun rango de ellas. Lo podemos hacer del modo antiguo que por el mensaje que nos muestra ya vemos que no es muy recomendable. Mi_Switch#vlan database % Warning: It is recommended to configure VLAN from config mode, as VLAN database mode is being deprecated. Please consult user documentation for configuring VTP/VLAN in config mode. Mi_Switch(vlan)#vlan 2 name gestion Mi_Switch(vlan)#exit APPLY completed. Exiting.... O en modo configuracin que es lo que se recomienda. Mi_Switch#configure terminal Mi_Switch(config)#interface vlan 2 Mi_Switch(config)#exit Podemos utilizar esa vlan como la de gestin y asignarle una direccin para que nos podamos conectar con una session remota. Configuramos Ip en una vlan : Mi_Switch#configure terminal Mi_Switch(config)#interface Vlan10 Mi_Switch(config)#ip address 10.100.5.250 255.255.255.0 Mi_Switch(config)#no ip route-cache Mi_Switch(config)#exit Mi_Switch# Ahora comprobamos lo que hemos hecho : Mi_Switch#show ip interface brief Interface IP-Address OK? Method Status Protocol

......... Vlan10 ...... O de igual modo : Mi_Switch#show running-config interface vlan 10 Building configuration... Current configuration : 89 bytes ! interface Vlan10 description VLAN Gestion ip address 10.100.5.250 255.255.255.0 end Si ahora sacamos la lista de las vlan que tenemos generadas: Mi_Switch#sh vlan VLAN Name 10 Gestion Mi_Switch#sh protocols Global values: Internet Protocol routing is enabled Vlan10 is up, line protocol is up Como hemos comentado, vamos ahora a meter una interface o un rango de interfaces dentro de esa vlan. Mi_Switch#configure t Seleccionamos una unica interface: Mi_Switch (config)#interface gigabitEthernet 1/0/1 O un rango de ellas: Mi_Switch#interface range gigabitEthernet 1/0/1-5 Y para dentro de la Vlan Mi_Switch (config-if)#description Gestion Status Ports active 10.100.5.250 YES NVRAM up up

---- -------------------------------- --------- -------------------------------

Mi_Switch (config-if)#switchport access vlan 10 Mi_Switch (config-if)#switchport mode access Si volvemos a sacar el detalle de la vlan : Mi_Switch#sh vlan id 10 VLAN Name 10 Gestion Status Ports active Gi1/0/1

---- -------------------------------- --------- -------------------------------

Vemos que tenemos asociado una interface a esa vlan. Vamos ahora a definir una interface en modo trunk : Mi_Switch# configure terminal Mi_Switch (config-if)#description Conexion SW_01 (Gi 0/1) Mi_Switch (config-if)#switchport trunk encapsulation dot1q Mi_Switch (config-if)#switchport mode trunk Mi_Switch (config-if)#exit Mi_Switch# Como ya hemos comentado en caso de querer deshacer lo que acabamos de hacer, anteponemos la palabra no a la misma configuracin. Mi_Switch# configure terminal Mi_Switch (config-if)#no description Conexion SW_01 (Gi 0/1) Mi_Switch (config-if)#no switchport trunk encapsulation dot1q Mi_Switch (config-if)#no switchport mode trunk Mi_Switch (config-if)#exit Mi_Switch#sh interfaces gigabitEthernet 1/0/1 trunk Port Gi1/0/1 Mode on Encapsulation Status 802.1q trunking 1 Native vlan

Vamos ahora a apagar una de las interfaces: Mi_Switch# configure terminal Mi_Switch (config-if)#shutdown Y para volver a levantarla : Mi_Switch (config-if)#no shutdown

Ya hemos comentado que las vlan no se van a ver entre si, pero si tenemos un switch que trabaje en capa 3 podemos jugar con esto tambin. Lo normal es que subamos el trunk a un router o firewall y jugar en ese punto, pero lo podemos hacer en el propio Switch. Generamos una regla: Mi_Switch#configure terminal Mi_Switch#(config)#access-list 101 deny ip 10.10.1.0 0.0.0.255 172.10.1.0 0.0.0.255 Mi_Switch#(config)#access-list 101 permit ip 172.16.1.0 0.0.0.255 any Y la aplicamos a la vlan : Mi_Switch#configure terminal Mi_Switch (config)#interface vlan 10 Mi_Switch (config-if)#ip access-group 101 in Mi_Switch (config-if)#exit Incluso podemos comprobar cuando se han modificado por ltima vez las vlan comprobando la fecha del siguiente fichero: Mi_Switch#sh flash Directory of flash:/ 3 -rwx 4 -rwx ...... Aprovechando que empezamos a saber alguna cosa ms, para ver como afecta a la configuracin de nuestro Cisco Catalyst la configuracin de un team (juntar tarjetas de red). Podramos por por ejemplo tener un servidor con 2 tarjetas de red con las que generar un team pero en un modo activo-pasivo con lo que nicamente queramos dotar de redundancia al equipo en caso de caida de una de las tarjetas. En este caso no es necesario realizar ningn tipo de configuracin en el Switch, ya que nicamente vamos a tener una tarjeta levantada enviando la MAC. Pero si adems de esa redundancia queremos sumar la capacidad, entonces podemos realizar lo que se conoce como una agregacin de puertos (Lynk Agregation ) con lo que sumamos la velocidad de cada una de las tarjetas. Al juntar ambas tarjetas, se le asigna una nica Mac a ese grupo, de tal forma que si no le decimos nada al switch, a este le llega la misma MAC por 2 bocas diferentes. Vamos a ver como solucionamos esto. Primero configuramos el EtherChannel : Mi_Switch# conf t Mi_Switch (config)#interface Port-channel1 Mi_Switch (config-if)# description Etherchannel Team Servidor1 15726 Jul 12 1993 04:58:18 +02:00 config.text 1636 May 13 2010 01:47:10 +02:00 vlan.dat

Mi_Switch (config-if)# switchport access vlan 12 Mi_Switch (config-if)# switchport trunk encapsulation dot1q Mi_Switch (config-if)# switchport trunk native vlan 12 Mi_Switch (config-if)# switchport trunk allowed vlan 12 Mi_Switch (config-if)# switchport mode trunk Mi_Switch (config-if)# spanning-tree portfast Mi_Switch (config-if)# spanning-tree bpduguard enable Mi_Switch (config-if)#end Mi_Switch# Y ahora configuramos las 2 bocas que van a participar en la agregacin : Mi_Switch# conf t Mi_Switch (config)#interface GigabitEthernet1/0/1 Mi_Switch (config-if)# description Servidor tarjeta 1 Mi_Switch (config-if)# switchport access vlan 12 Mi_Switch (config-if)# switchport trunk encapsulation dot1q Mi_Switch (config-if)# switchport trunk native vlan 12 Mi_Switch (config-if)# switchport trunk allowed vlan 12 Mi_Switch (config-if)# switchport mode trunk Mi_Switch (config-if)# channel-group 1 mode active Mi_Switch (config-if)# end Mi_Switch # Mi_Switch# conf t Mi_Switch (config)#interface GigabitEthernet1/0/2 Mi_Switch (config-if)# description Servidor tarjeta 2 Mi_Switch (config-if)# switchport access vlan 12 Mi_Switch (config-if)# switchport trunk encapsulation dot1q Mi_Switch (config-if)# switchport trunk native vlan 12 Mi_Switch (config-if)# switchport trunk allowed vlan 12 Mi_Switch (config-if)# switchport mode trunk Mi_Switch (config-if)# channel-group 1 mode active Mi_Switch (config-if)# end Mi_Switch # Podramos haber forzado las velocidades de los puertos de la siguiente forma: Mi_Switch (config-if)# speed 1000 Mi_Switch (config-if)# duplex full Y ahora comprobamos lo que hemos hecho :

Mi_Switch #show etherchannel 1 summary Flags: D - down P - in port-channel

I - stand-alone s - suspended H - Hot-standby (LACP only) R - Layer3 U - in use S - Layer2 f - failed to allocate aggregator

u - unsuitable for bundling w - waiting to be aggregated d - default port Number of channel-groups in use: 2 Number of aggregators: 2

Group Port-channel Protocol Ports ------+-------------+-----------+----------------------------------------------1 Po2(SU) LACP Gi1/0/1(P) Gi2/0/2(P)

Ahora vamos a ver como podemos realizar un poquito de debug y monitorizacin para mantener nuestros Catalyst lo mas libre de errores posible. Si estamos conectados a travs de una sesion de telnet o ssh, y queremos que nos muestre los mensajes que por defecto salen por consola : Mi_Switch#term mon Para desactivarlo : Mi_Switch#term no mon Podemos comprobar si tenemos algo de debugging activado : Mi_Switch#sh debugging Condition 1: interface Gi1/0/14 (1 flags triggered) Flags: Gi1/0/14 Y podemos activarlo si nos interesa comprobar en detalle o dar una solucin a un problema : Mi_Switch#debug ? aaa adjacency all archive arp AAA Authentication, Authorization and Accounting adjacency Enable all debugging debug archive commands IP ARP and HP Probe transactions

auto backup ...........

Debug Automation Switch Backup Interface debugging

Si queremos desactivar todos los debug que tengamos aplicados : Mi_Switch#no debug all A modo de monitorizacin puede ser interesante activar el protocolo snmp para poder conectarnos con un sistema de monitorizacin remota que nos va a reportar determinada informacin como el estado de las interfaces, consumos Lo vamos a activar nicamente como solo lectura. Mi_Switch#snmp-server community password_aqui RO Tambin con fines de monitorizacin es interesante activar el syslog para que reporte determinados eventos a un syslog centrar, y poder as consultar la informacin de una forma sencilla y centralizada. Mi_Switch#Logging on Mi_Switch#logging trap warnings (o loq ue queramos) Mi_Switch#Logging Facility Local7 Mi_Switch#Logging IP_Syslog_server Consultamos la configuracin: Mi_Switch#sh logging Syslog logging: enabled (0 messages dropped, 1 messages rate-limited, 0 flushes, 0 overruns, xml disabled, filtering disabled) Console logging: level debugging, 641452 messages logged, xml disabled, filtering disabled Monitor logging: level debugging, 175 messages logged, xml disabled, filtering disabled Logging to: vty1(0) Buffer logging: level debugging, 641452 messages logged, xml disabled, filtering disabled Exception Logging: size (4096 bytes) Count and timestamp logging messages: disabled File logging: disabled Trap logging: level informational, 641462 message lines logged Logging to 10.100.1.10, 5305 message lines logged, xml disabled, filtering disabled Log Buffer (64000 bytes):

En caso de querer ver la tabla de rutas : Mi_Switch#sh ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is 10.200.6.254 to network 0.0.0.0 172.39.0.0/24 is subnetted, 2 subnets C C C C 172.31.100.0 is directly connected, Vlan100 172.31.104.0 is directly connected, Vlan104 10.200.6.0 is directly connected, Vlan10 10.200.4.0 is directly connected, Vlan33

10.0.0.0/24 is subnetted, 2 subnets

S* 0.0.0.0/0 [1/0] via 10.100.5.1 Asignar una ruta por defecto: Podemos definir la ruta por defecto : Mi_Switch#ip default-gateway 172.20.139.129

O la tabla ARP : Mi_Switch#sh arp Protocol Address Age (min) Hardware Addr Type Interface 11 002e.4562.908f ARPA Vlan20 8 002e.4562.a948 ARPA Vlan20 0 002e.4562.7a7e ARPA Vlan20 13 002e.4562.94e6 ARPA Vlan20 Y para borrar la tabla arp : Internet 100.30.104.219 Internet 100.30.104.223 Internet 100.30.104.222 Internet 100.30.104.221 Mi_Switch#clear arp Ya comente en su dia que en las redes switcheadas no se podia colocar alegremente un sniffer. Si tenemos acceso al Switch lo que podemos hacer es port mirroring para mandar una copia de todo lo que pasa por un determinado puerto, un rango o una vlan hacia otro puerto y quedarnos escuchando en el. Mi_Switch (config)# monitor session 1 source interface Gi1/0/1 Mi_Switch (config)# monitor session 1 destination interface Gi1/0/24 Mi_Swtich#show monitor detail

Session 1 --------Type Source Ports RX Only ................ Para comprobar errores en caso de caida del Switch y ver que ha podido pasar, tenemos tambin la opcin : Mi_Switch# sh stacks Interrupt level stacks: Level Called Unused/Size Name 4 2394549592 8332/9000 NETWORK INTERFACE CHIP 5 0 9000/9000 SUPERVISOR EXCEPTIONS 6 2759114589 8908/9000 NS16550 VECTOR .............................. Incluso podemos activar un servidor DHCP : My_Switch(config)#service dhcp My_Switch(config)#ip dhcp excluded-address 10.100.1.1 10.100.1.10 My_Switch(config)#ip dhcp pool LAN_To My_Switch(DHCP-config)#network 10.100.1.0 255.255.255.0 My_Switch(DHCP-config)#default-router 10.100.1.1 My_Switch(DHCP-config)#lease 10 My_Switch(DHCP-config)#dns-server 10.100.1.2 Vamos a comentar que relacionado con la seguridad de los puertos podemos hacer uso deport-security, por ejemplo para controlar que equipos se pueden conectar en determinadas bocas. Mi_Switch(config-if)#switchport port-security ? aging Port-security aging commands Max secure addresses mac-address Secure mac address maximum <cr> Lo activamos sobre una determinada interface : Mi_Switch(config-if)#switchport port-security violation Security violation mode : Local Session : : Non

Ahora solo la MAC conectada se prodra conectar a traves de ese puerto, pero podriamos indicarle nuevas MAC. Mi_Switch(config-if)#switchport port-security mac-address Y determinar la accin que se va a realizar en caso de que se produzca una violacin Mi_Switch(config-if)#switchport port-security violation [shutdown restrict protect] Y por ltimo comprobar si lo tenemos aplicado en algn puerto: Mi_Switch# sh port-security Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action (Count) (Count) (Count) ----------------------------------------------------------------------------------------------------------------------------------------------------Total Addresses in System (excluding one mac per port) :0 Max Addresses limit in System (excluding one mac per port) : 6144 Ahora vamos a ver como podemos activar el acceso a travs de ssh que anteriormente hemos comentado. Si la IOS instalada no soporta cryto para conectarnos por ssh: Mi_Switch#show ip ssh ^ % Invalid input detected at '^' marker. Debemos buscar una IOS actualizada que corresponda a nuestros modelo y que la soporte para actualizar nuestro Switch. Antes de nada debemos comprobar si tenemos 2 Switches en modo stack , ya que debemos actualizar ambos Switches. Mi_Switch #sh switch Switch/Stack Mac Address : 001e.14xx.b280 H/W Current Switch# Role Mac Address *1 2 Master 001e.14xx.b280 Member 001e.14bb.5f80 Priority Version State 15 1 0 0 Ready Ready ----------------------------------------------------------

Y realizar una copia de los ficheros que tenemos actualmente y nos interesan. Podemos utilizar los siguientes comandos para obtener esa informacin: Mi_Switch# sh boot BOOT path-list Config file : flash:c3560-ipbase-mz.122-35.SE5/c3560-ipbase-mz.122-35.SE5.bin : flash:/config.text

Private Config file : flash:/private-config.text Enable Break Manual Boot Auto upgrade : no : no : yes

HELPER path-list : Auto upgrade path : Mi_Switch#show flash Directory of flash:/ 2 -rwx 3 -rwx 5 drwx 463 -rwx 1636 Jun 18 1993 04:13:23 +02:00 vlan.dat 5 Jul 14 1993 20:16:30 +02:00 private-config.text 192 Mar 1 1993 01:07:18 +01:00 c3560-ipbase-mz.122-35.SE5 7289 Jul 14 1993 20:16:30 +02:00 config.text

32514048 bytes total (23451136 bytes free) dir flash1: Como debemos copiar esa informacin es interesante comprobar las diferentes opciones para poder realizarlo. Es interesante tener instalado un servidor TFTP en nuestro equipo para realizar este proceso: Mi_Switch#copy flash:c3560-ipbase-mz.122-35.SE5 ? flash: ftp: http: null: nvram: rcp: Copy to flash: file system Copy to ftp: file system Copy to http: file system Copy to null: file system Copy to nvram: file system Copy to rcp: file system

running-config Update (merge with) current system configuration startup-config Copy to startup configuration system: tftp: vb: Copy to system: file system Copy to tftp: file system Copy to vb: file system

Mi_Switch#copy flash:c3560-ipbase-mz.122-35.SE5 tftp Mi_Switch#copy flash:config.text tftp Comprobamos la cantidad de memoria flash disponible : Mi_Switch# sh flash

..32514048 bytes total (23451136 bytes free) Si tenemos problemas de espacio para cargar la nueva IOS debemos borrar la antigua. Mi_Switch#delete /r/f flash:c3560-ipbase-mz.122-35.SE5 Copiamos la nueva IOS: # copy tftp flash1 >Address or name of remote host? 192.168.1.10 >source filename? c3750-ipbasek9-mz-122-55.SE1.bin >Destination filename? c3750-ipbasek9-mz-122-55.SE1.bin Si en vez de un archivo bin, trabajamos con un tar entonces lo podemos realizar de la siguiente forma: Mi_Switch#archive tar /xtract tftp://10.100.1.10/c3560-ixqXXX-tar.XXX-XXEAXXa.tar flash: Y ahora toca verificar la copia para comprobar que se ha subido correctamente. Mi_Switch#verify /md5 flash1:c3750-ipbasek9-mz-122-55.SE1.bin Ahora toca decirle cual es la IOS es con la que tiene que arrancar a nuestro Catalyst. Mi_Switch#show boot BOOT path-list : flash:c3750-ipbase-mz.122-35.XXX/c3750-ipbase-mz.122-35.XX5.bin Config file : flash:/config.text Private Config file : flash:/private-config.text Enable Break : no Manual Boot : no HELPER path-list : Auto upgrade : yes Auto upgrade path : ------------------Switch 2 ------------------BOOT path-list : flash:c3750-ipbase-mz.122-35.XXX/c3750-ipbase-mz.122-35.XXX.bin Config file : flash:/config.text Private Config file : flash:/private-config.text Enable Break : no Manual Boot : no HELPER path-list : Auto upgrade : no

Auto upgrade path : Mi_Switch#boot system switch all flash:c3750-ipbasek9-mz-122-55.SE1.bin Y por ltimo toca reiniciar, y como siempre en estos casos cruzar los dedos esperando que la suerte nos acompae. Mi_Switch#reload Una vez reiniciado, solo queda comprobar que se ha cargado la versin. Mi_Switch#sh version Una vez tenemos instalada la nueva IOS que soporte crypto, podemos proceder a configurar ssh : Mi_Switch(config)#hostname nombre_host Mi_Switch(config)#ip domain-name dominio.com Mi_Switch(config)#crypto key generate rsa The name for the keys will be: nombre_host.dominio.com Choose the size of the key modulus in the range of 360 to 2048 for your General Purpose Keys. Choosing a key modulus greater than 512 may take a few minutes. How many bits in the modulus [2048]: % Generating 2048 bit RSA keys ...[OK] Mi_Switch(config)#ip ssh time-out 20 Mi_Switch(config)#ip ssh authentication-retries 3 Mi_Switch(config)#username root password password Antes de cerrar la entrada nicamente a SSH, la seguimos permitiendo por telnet para comprobar que nos podemos conectarAntes de cerrar la entrada nicamente a SSH, la seguimos permitiendo por telnet para comprobar que nos podemos conectar. Mi_Switch(config)#line vty 0 4 Mi_Switch(config-line)#transport input all Mi_Switch(config-line)#login local Y una vez comprobada que la conexion a tarves de ssh nos funciona correctamente, forzamos a que se haga solo a travs de un clientes ssh: Mi_Switch(config)#line vty 0 4 Mi_Switch(config-line)#transport input ssh Para poder comprobar los parametros : Mi_Switch#show ip ssh En caso de querer desconectar a un usuario conectado por ssh :

Mi_Switch#disconnect ssh Y por ltimo para habilitar ssh en versin 2 Mi_Switch(config)#ip ssh version 2 Si algo sale mal, siempre tenemos la opcin de debuggear Mi_Switch#debug ip ssh Creo que por hoy va ser suficiente. Espero que no os haya resultado muy pesado.

Вам также может понравиться