Switch LAB Parte1
Switch LAB Parte1
Switch LAB Parte1
Luego seleccionar la tarjeta de red y hacer click en “Start” para capturar el tráfico.
En la línea de comandos de Windows usar los sgtes comandos para renovar la dirección IP
C:\ECITEC>ipconfig/release
C:\ECITEC>ipconfig/renew
Lo más probable es que se hayan capturado cientos de paquetes. Procedemos a usar un filtro
para ver sólo el protocolos DHCP. La cadena bootp significa protocolo DHCP. Colocar dicha
cadena en el campo “filter” según se ve en la siguiente figura :
Además podemos ver el diagrama de secuencia. Ir al menú “Statistics” y escoger la opción
“Flow Graph”. En las opciones escoger “displayed packets”
Nos mostrará el siguiente flujo. Notar el valor “Transaction ID”. Todos los paquetes con el
mismo “Transaction ID” pertenecen a la misma transacción DHCP.
LAB 2: SNIFFER y ARP
Iniciar el Wireshark. Ir al menú “Capture” y escoger la opción “Interfaces”.
Luego seleccionar la tarjeta de red y hacer click en “Start” para capturar el tráfico.
C:\ECITEC>arp –d *
C:\ECITEC>ping 8.8.8.8 *
C:\ECITEC>arp –a
Lo más probable es que se hayan capturado cientos de paquetes. Procedemos a usar un filtro
para ver sólo los protocolos icmp y arp.
El símbolo de doble pipe “||” significa “OR lógico”. El filtro completo a utilizar es el siguiente:
icmp||ip
Revisar los detalles de cada paquete y verificar que la IP y la dirección MAC del default
gateway vistas en Wireshark coinciden con las del comando “arp –a” de Windows
LAB 3 : Conexión a la consola del switch, reseteo de la configuración, “enable
secret”
Conectar el puerto de consola y utilizar el Putty para ingresar a la línea de comandos del
switch.
En caso contrario podemos resetear la configuración con los siguientes comandos. Cuando
nos pida grabar la configuración le decimos que “no”.
Press RETURN to get started!
Switch>
Switch>enable
Switch#erase startup-config
Switch#delete vlan.dat
Switch#reload
System configuration has been modified. Save? [yes/no]: no
Building configuration...
[OK]
Proceed with reload? [confirm]
Una vez reiniciado el switch procedemos a colocar el “enable secret”. Si volvemos al “user-
exec mode” y queremos volver al “privileged-exec mode” ahora nos pedirá un password
Switch>
Switch>enable
Switch#config t
Switch(config)#enable secret cisco
Switch(config)#^z
Switch#disable
Switch>enable
Password:
Switch#
Ejecutar los comandos de edición “Ctrl-E”, “Ctrl-A”, etc y ejecutar “show history”
LAB 4 : Revisión inicial del switch
Ejecutar los siguientes comandos :
Show version
Show version | i image
Show license
Show env all
Show inventory
Dir
Show boot
Show sdm prefer
Show power inline
Show interface status
Show log
Show clock
Show energywise version
Switch#show license
Index 1 Feature: lanlite
Period left: 0 minute 0 second
Index 2 Feature: lanbase
Period left: Life time
License Type: Permanent
License State: Active, In Use
License Priority: Medium
License Count: Non-Counted
Non
Conectar una PC al puerto 1 del switch. Verificar que la IP de la “interface vlan 1” esté UP
El servidor telnet está habilitado por defecto, pero necesita que habiliten un password de
línea. Para comprobar esto iniciar una sesión Telnet desde una PC utilizando “Putty”.
Podemos poner una IP estática 192.168.1.2 a la PC para realizar el Telnet hacia la IP
192.168.1.1
Switch(config-line)#line vty 0 15
Switch(config-line)#password cisco
Switch(config-line)#login
Switch#show users
Line User Host(s) Idle Location
0 con 0 idle 00:08:16
* 1 vty 0 idle 00:00:00 192.168.1.2
Interface User Mode Idle Peer Address
Switch#show line
Tty Typ Tx/Rx A Modem Roty AccO AccI Uses Noise Overruns Int
* 0 CTY - - - - - 0 0 0/0 -
* 1 VTY - - - - - 1 0 0/0 -
2 VTY - - - - - 0 0 0/0 -
3 VTY - - - - - 0 0 0/0 -
4 VTY - - - - - 0 0 0/0 -
5 VTY - - - - - 0 0 0/0
Podemos usar el comando “clear line” para botar a los usuarios de otras líneas. Notar que
uno no se puede “botar” a sí mismo
Switch#show users
Line User Host(s) Idle Location
0 con 0 idle 00:00:03
* 1 vty 0 idle 00:00:00 192.168.1.2
Interface User Mode Idle Peer Address
Switch#clear line 1
% Not allowed to clear current line [OK]
Switch#clear line 0
[confirm]
[OK]
Switch#show users
Line User Host(s) Idle Location
* 1 vty 0 idle 00:00:00 192.168.1.2
Interface User Mode Idle Peer Address
5.2) SSH Server
SW-1(config)#line vty 0 4
SW-1(config-line)# transport input ssh
SW-1#show ip ssh
SSH Enabled - version 1.99
Authentication timeout: 120 secs; Authentication retries: 3
SW-1(config)#ip ssh version 2
SW-1(config)#do sh ip ssh
SSH Enabled - version 2.0
Authentication timeout: 120 secs; Authentication retries: 3
SW-1(config)#ip ssh version 1
SW-1(config)#do sh ip ssh
SSH Enabled - version 1.5
Authentication timeout: 120 secs; Authentication retries: 3h
Verificar desde la PC utilizando Putty que SSH tiene éxito, pero telnet falla.
Opcional : Terminal monitor. Conectar más cables y verificar que no aparecen logs en el
switch Cisco. Desconectar dichos cables. Luego ejecutar el comando “terminal monitor” y
volver a conectar los cables. Verificar que ahora sí aparecen logs.
Switch#terminal monitor
Switch#terminal no monitor
LAB 6 : Cisco Network Assistant
Como prerequisito a la instalación de Cisco Network Assistant se debe instalar Java.
El Cisco Network Assitant necesita que se habilite la función http server en el switch.
Si el switch no tiene usuarios entonces el Cisco CNA utiliza username en blanco y como
password utiliza el “enable secret”.
Usamos “community” para conectarse a un grupo de switches al mismo tiempo. Notar que
“community” no tiene nada que ver con SNMP community.
Name : Gi1/0/1
Administrative Speed: auto
Administrative Duplex: auto
Administrative Auto-MDIX: on
Administrative Power Inline: N/A
Operational Speed: auto
Operational Duplex: auto
Operational Auto-MDIX: on
Conectar una PC al puerto 1 del switch, verificar que el puerto 1 diga “a-full” y “a-100”.
Verificar que no hay CRCs y tampoco haya colisiones. Verificar que el puerto se coloca en la
VLAN 1
Conectar un teléfono IP al puerto 2 del switch, verificar que el teléfono IP esté energizado
gracias a la función PoE. Verificar que el puerto se coloca en la VLAN 1
Conectar un switch contra otro switch utilizando un cable directo. En teoría se debería usar
un cable cruzado, pero gracias al auto-MDIX también se puede usar un cable directo.
Comprobar que el puerto levanta con el comando “show interface status”.Verificar que el
puerte se coloca en la VLAN 1
LAB 8 : MAC address table
Ejecutar los siguientes comandos :
Utilizar la herramienta “macof” del sistema operativo Kali Linux y ejecutar un ataque de MAC
Flooding. Verificar con el “show mac address-table count”
Switch(config)# vlan 2
Switch(config-vlan)# name VLAN-DOS
Conectar 2 PC , una al puerto 1 y la otra al puerto 2 del switch y verificar que el servidor DHCP
le asignó una IP con el siguiente comando :
Switch#show ip dhcp binding
IP address Client-ID/
Client Lease expiration Type
Hardware address/
User name
192.168.2.11 24d9.214
24d9.2141.0ddd Jan 12 2013 03:42 AM Automatic
192.168.2.12 24d9.214a.6dd3 Jan 12 2013 04:59 AM Automatic
Switch(config)# hostname SW
SW-1
SW-1(config)#
SW-1(config)#
config)# int g1/0/1
SW-1(config-if)#
if)# sw mode access
SW-1(config-if)#
if)# sw access vlan 1
SW-1(config)#
config)# int g1/0/2
SW-1(config-if)#
if)# sw mode access
SW-1(config-if)#
if)# sw access vlan 2
SW-1(config)#
config)# int g1/0/24
SW-1(config-if)# sw trunk encapsulation dot1q
SW-1(config-if)#
if)# sw mode trunk
SW-1(config-if)#
if)# sw nonegotiate
Switch(config)# hostname SW
SW-2
SW-2(config)#
config)# int vlan 1
SW-2(config-if)#
if)# ip address 192.168.1.2 255.255.255.0
SW-2(config-if)#
if)# int vlan 2
SW-2(config-if)#
if)# ip address 192.168.2.2 255.255.255.0
255.255.255.0
SW-2(config)#
config)# int g1/0/1
SW-2(config-if)#
if)# sw mode access
SW-2(config-if)#
if)# sw access vlan 1
SW-2(config)# int g1/0/2
SW-2(config-if)# sw mode access
SW-2(config-if)# sw access vlan 2
Realizar ping entre las PCs de la VLAN 1 y entre los SVI 1 de cada switch. El ping debe ser
exitoso.
Realizar ping entre las PCs de la VLAN 2 y entre los SVI 2 de cada switch. El ping debe ser
exitoso.
Modificar las vlans permitidas en el trunk. Permitir sólo la vlan 2 y la vlan 4. La vlan 4 no
existe pero no importa.
Volver a realizar el ping entre la PCs de la VLAN 1 y entre los SVI 1 de cada switch. El ping
debe fallar.
Volver a realizar el ping entre la PCs de la VLAN 2 y entre los SVI 2 de cada switch. El ping
debe ser exitoso.
LAB 11 : Configuración de VTP
Verificar con un “show vlan brief” que la vlan fue creada en el SW-2. Verificar también con un
“show vtp status”
Tratar de crear una VLAN, por ej la VLAN 123 en el SW-2, comprobar que sale un mensaje de
error.
Verificar que la VLAN 550 no existe en el SW-2. Verificar con un “show vlan brief” y un “show
vtp status”.
Tratar de crear una VLAN en el SW-2, por ej. la VLAN 123 comprobar que ahora sí es posible
crear una VLAN.
La función CDP está activada por defecto. Ejecutar “show cdp neighbor”. El SW-1 debería
poder ver al SW-2
Switch(config)#device-sensor accounting
Switch(config)#device-sensor notify all-changes
Verificar con el siguiente comando que el switch ha descubierto mucha información de los
equipos conectados a él. Lamentablente muestra la información en hexadecimal
Configurar
figurar etherchannel en modo “LACP”
SW-1(config)#interface
1(config)#interface range g1/0/23 – 24
Sw-1(config-range)#shut
range)#shut
SW-1(config-range)#channel
range)#channel-protocol lacp
SW-1(config-range)#channel
range)#channel-group 1 mode active
SW-1(config)#interface
1(config)#interface po 1
SW-1(config-if)#
if)# sw mode trunk
SW-1(config-if)#
if)# sw nonegotiate
SW-1(config-if)#
if)# sw trunk allowed vlan 1,2
SW-2(config)#interface
2(config)#interface range g1/0/23 – 24
Sw-2(config-range)#shut
range)#shut
SW-2(config-range)#channel
range)#channel-protocol lacp
SW-2(config-range)#channel
range)#channel-group 2 mode active
SW-2(config)#interface
2(config)#interface po 2
SW-2(config-if)#
if)# sw mode trunk
SW-2(config-if)#
if)# sw nonegotiate
SW-2(config-if)#
if)# sw trunk allowed vlan 1,2
También verificar con “show interface Po1” , “show int trunk” en ambos switches
En el puerto 1 usar
sar la VLAN 1 como vlan de datos y VLAN 2 como VLAN de voz.
SW-1(config)#
1(config)# int g1/0/2
SW-1(config-if)#switchport
if)#switchport mode access
SW-1(config-if)#switchport
if)#switchport access vlan 1
IP address Client-ID/
Client Lease expiration Type
Hardware address/
User name
192.168.1.11 24d9.2141.0ddd Jan 12 2013 03:42 AM Automatic
192.168.2.11 24d9.214a.6dd3 Jan 12 2013 04:59 AM Automatic
Verificar también que la vlan de voz funcionó con el comando “show interface switchport”
SW-1#sh int g1/0/1 switchport
Name: Gi1/0/1
Switchport: Enabled
Administrative Mode: static access
Operational Mode: static access
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: native
Negotiation of Trunking: Disabled
Access Mode VLAN: 1 (VLAN01)
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL
Trunking VLANs Active: 1
Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: 2
Appliance trust: none
Realizar un ping desde la PC2 hacia la IP del teléfono. Debe ser exitoso.