Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Verificar con el comando “show sdm prefer” que la plantilla actual del switch no permite
routing.
Ejecutar “ip routing” y verificar que el switch da un error. Ejecutar “show ip route” y verificar
que el comando me muestra el default gateway (si hubiera alguno configurado) pero no
muestra ninguna tabla de rutas.
SW-1(config)#
1(config)# sdm prefer lanbase
lanbase-routing
SW-1(config)#
1(config)# do reload
Una vez reiniciado el equipo verificar que la plantilla de SDM ahora sí permite routing.
SW-1(config)# ip routing
Las SVI1 y SVI 2 ya deberían estar creadas de un lab anterior. Ejecutar “show ip route” para
mostrar que las rutas directamente conectadas automáticamente aparecen en la tabla de
ruteo.
SW1#show ip route
Gateway of last resort is not set
Comprobar que si intentamos configurar ruteo dinámico, por ejemplo con el comando
“router rip” este comando falla.
LAB 16 : PORT SECURITY
SW-1(config-if)#spanning-tree portfast
Comprobar con el “show mac address-table” y “show running” que se aprendió la dirección
MAC de manera “sticky”.
Probar ahora cambiando la reacción del switch, que ya no sea “shutdown” sino
“restrict”.
Volver a hacer la prueba con la PC-1 y verificar que aprende la MAC de manera
“sticky”. Luego desconectar la PC-1 y conectar la PC-2. El switch generará un log
con una alarma y bloqueará las tramas de la dicha PC pero el puerto no se
colocará en error-disabled, el puerto seguirá levantado.
LAB 17: INTRO A SPANNING-TREE
Si el acceso es por telnet o ssh debemos ejecutar terminal monitor para ver los logs del debug
en tiempo real
Switch#terminal monitor
Conectar un equipo al puerto 1 del switch. Ejecutar “show spanning-tree int f0/1” cada vez
que el debug nos indique que ha cambiado de estado. A continuación se resaltan los
resultados del debug.
00:23:43: setting bridge id (which=3) prio 32769 prio cfg 32768 sysid 1 (on)
id 8001.0011.21fe.9e40
00:23:43: set portid: VLAN0001 Fa0/1: new port id 8001
00:23:43: STP: VLAN0001 Fa0/1 -> listening
00:23:44: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1,
changed state to up
Switch#
00:23:58: STP: VLAN0001 Fa0/1 -> learning
Switch#
Switch#sh spanning-tree int f0/1
Revisar en los logs anteriores que el estado “listening” duró 15 segundos y el estado
“learning” también.
Desconectar el cable. Ejecutar el siguiente comando
Switch(config)#int f0/1
Switch(config-if)#spanning-tree portfast
Volver a conectar el cable y comprobar que esta vez el puerto pasó al estado “forwarding”
inmediatemente.
Switch#sh spanning-tree int f0/1
Deshabilitar el debug
Switch#undebug all
Conectar un cable entre el puerto 1 y el puerto 2 del mismo switch. Esto creará un bucle.
Verificar con el comando “show spanning-tree int f0/1” y también “show spanning-tree int
f0/2”. En ambos comandos vemos que el “designated path cost” empatan porque es igual a
cero. Luego en ambos comando vemos que el designated bridge empata. La razón por la cual
se bloquea al puerto 2 es porque el puerto 2 tiene peor (mayor) “designated port id” que el
puerto 1.
Switch(config)#default
(config)#default int f0/23
Switch(config)#default
(config)#default int f0/24
Switch(config)#int
(config)#int range f0/23 - 24
Switch(config-if)#switchport
if)#switchport mode trunk
Switch(config-if)#switchport
if)#switchport nonegotiate
Verificar que todos los puertos del “root bridge” están en estado forwarding con el comando
“show spanning-tree”.
tree”. Realizar también ““show spanning-tree
tree int f0/23 detail” y “show
spanning-tree
tree int f0/24 detail”
Switch(config)#int
(config)#int rang f0/23 - 24
Switch(config-if)#switchport
if)#switchport trunk allowed vlan 1,2
Forzar a que el SW-1
1 sea root de la VLAN 1 y SW-2
SW sea root de la VLAN2
SW-1(config)#Spanning-tree
tree vlan 1 priority 0
SW-2(config)#Spanning-tree
tree vlan 2 priority 0
Switch#show spanning-tree
tree
VLAN0001
Spanning tree enabled protocol ieee
Switch(config)#spanning-
-tree mode rapid-pvst
Switch#debug spanning-tree
tree events
Volver a conectarr los cables y comprobar que el ping tiene éxito inmediatamente.
Revisar también los logs del debug para comprobar la convergencia rápida.
Ahora comprobaremos el “alternate port”. Verificar en la VLAN1 cuál de los puertos es “root
port” y cual es el “alternate port” con el comando “show spanning-tree vlan 1” en cada
switch.
Verificar que el “ping –t” sigue activo. Verificar cuál de los 2 trunks tiene el “root port”.
Desconectar dicho trunk. El ping no deberá perderse.
Volver a realizar el “show spanning-tree” y comprobar que el puerto que antes era
“alternate” ahora es “root”.
LAB 19:: Protección de Spanning Tree
19.1 BPDUFILTER
Switch(config)#default
(config)#default int f0/1
Switch(config)#default
config)#default int f0/2
Switch(config)#int
(config)#int range f0/1 - 2
Switch(config-if)#switchport
if)#switchport mode access
Switch(config-if)#spanning
if)#spanning-tree portfast
Switch(config-if)#spanning
if)#spanning-tree bpdufilter enable
Comprobar que se forma un bucle y que los puerto no son bloqueados por Spanning-Tree
Spanning
Switch#sh spanning-tree
tree blockedports
Switch(config)#int
(config)#int range f0/1 - 2
Switch(config-if)#no spanning-tree
spanning bpdufilter enable
Volver a conectar los cables y comprobar que esta vez los puertos “ignoran” la configuración
portfast y negocian los estados de spanning-tree.
spanning ree. Revisar otra vez el comando “show
spanning-tree
tree blockedports” y comprobar que ahora hay un puerto bloqueado.
19.2 BPDUGUARD
Switch(config)#int
(config)#int range f0/1 - 2
Switch(config-if)#no spanning-tree
spanning bpdufilter enable
Switch(config-if)#spanning
if)#spanning-tree bpduguard enable
Switch(config)#int
fig)#int range f0/1 - 2
Switch(config-if)#no
no spanning-tree
spanning bpduguard enable
Switch(config)#spanning
panning-tree portfast bpduguard default