Está en la página 1de 13

LAB 15 : IP ROUTING

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.

Cambiar la plantilla de SDM y rreiniciar el equipo.

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.

Switch# show sdm prefer

The current template is "lanbase


"lanbase-routing" template.
The selected template optimizes the resources in
the switch to support this level of features for
0 routed interfaces and 255 VLANs.
number of unicast mac addresses: 4K
number of IPv4 IGMP groups + multicast routes: 0.25K
number
ber of IPv4 unicast routes: 0.75K
number of directly-connected
directly connected IPv4 hosts: 0.75K
number of indirect IPv4 routes: 1K
number of IPv4 policy based routing aces: 0
number of IPv4/MAC qos aces: 0.125k
number of IPv4/MAC security aces: 0.375k
Verificar también que ahora sí permite el comando “ip 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

C 192.168.1.0 is directly connected, Vlan1


C 192.168.2.0 is directly connected, Vlan2

Ejecutar un ping desde la PC de la VLAN 1 hacia la PC de la VLAN 2 y comprobar que es


exitoso.

Comprobar que podemos agregar rutas estáticas

SW-1(config)# ip route 10.10.10.0 255.255.255.0 192.168.1.10

Comprobar que si intentamos configurar ruteo dinámico, por ejemplo con el comando
“router rip” este comando falla.
LAB 16 : PORT SECURITY

Colocar el comando “spanning-tree portfast” para que el puerto negocie más


rápido :

SW-1(config-if)#spanning-tree portfast

Configurar el puerto g1/0/1 del switch con los siguientes comandos :

switchport port security


switchport port-security maximum 1
switchport port-security violation shutdown
switchport port-security aging time 2
switchport port-security aging type inactivity
switchport port-security mac-address sticky

Comprobar con el “show mac address-table” y “show running” que se aprendió la dirección
MAC de manera “sticky”.

Show running | i sticky


switchport port-security mac-address sticky 1234.1234.1234

En el ejemplo pongo como referencia que aprendió una dirección “1234.1234.1234”. De


ahora en adelante sólo aceptará dicha MAC. Si conecto otro equipo con una MAC diferente
entonces el puerto se pondrá en estado “error disabled”. Verificar con los sgtes comandos :

Show int status | i err-disabled


g1/0/1 err-disabled 1 auto auto 10/100BaseTX

Show int status err-disabled


Port Name Status Reason
g1/0/1 port err-disabled psecure-violation
Switch# show port-security
Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action
(Count) (Count) (Count)
--------------------------------------------------------------------------
g1/0/1 24 1 1 Shutdown
---------------------------------------------------------------------------
Total Addresses in System (excluding one mac per port) : 0
Max Addresses limit in System (excluding one mac per port) : 6176

Limpiar las direcciones MAC aprendidas de manera “sticky”.

SW-1(config-if)#no switchport port-security mac-address sticky [mac-address]

“Revivir” el puerto g1/0/1 con los sgtes comandos :

SW-1(config)# int g1/0/1


SW-1(config-if)# shutdown
SW-1(config-if)# no shutdown

Probar ahora cambiando la reacción del switch, que ya no sea “shutdown” sino
“restrict”.

SW-1(config)# int g1/0/1


SW-1(config-if)# switchport port-security violation 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

17.1 REVISION DE LOS ESTADOS DE SPANNING TREE

Activar el debug de spanning-tree.

Switch#debug spanning-tree events


Spanning Tree event debugging is on

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#sh spanning-tree int f0/1

VLAN0001 Role Sts Cost Prio.Nbr Type


---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Desg LIS 19 128.1 P2p

Switch#
00:23:58: STP: VLAN0001 Fa0/1 -> learning
Switch#
Switch#sh spanning-tree int f0/1

Vlan Role Sts Cost Prio.Nbr Type


---------------- ---- --- --------- -------- --------------------------------
VLAN0001 Desg LRN 19 128.1 P2p
Switch#
00:24:13: STP: VLAN0001 Fa0/1 -> forwarding
Switch#
Switch#sh spanning-tree int f0/1

Vlan Role Sts Cost Prio.Nbr Type


---------------- ---- --- --------- -------- --------------------------------
VLAN0001 Desg FWD 19 128.1 P2p

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

Vlan Role Sts Cost Prio.Nbr Type


---------------- ---- --- --------- -------- --------------------------------
VLAN0001 Desg FWD 19 128.1 P2p Edge

Deshabilitar el debug
Switch#undebug all

17.2 UN BUCLE CONTRA SÍ MISMO

Colocar la config por defecto de los puertos 1 y 2


Switch(config)#default int f0/1
Switch(config)#default int f0/2

Conectar un cable entre el puerto 1 y el puerto 2 del mismo switch. Esto creará un bucle.

Verificar cuál es el “root bridge”


Switch#sh spanning-tree root
Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- - -------- ----- --- --- ------------
VLAN0001 8193 0018.191f.e080 0 2 20 15

Switch#sh spanning-tree bridge id


VLAN0001 8193 0018.191f.e080
Verificar con el comando “show int status” que todos los puertos están levantados. Sin
embargo con el comando “show spanning-tree blockedports” vemos que el puerto f0/2 está
bloqueado.

Switch#sh int status

Port Name Status Vlan Duplex Speed Type


Gi0/1 connected 1 auto auto unknown
Gi0/2 connected 1 auto auto unknown

Switch#sh spanning-tree blockedports

Name Blocked Interfaces List


-------------------- ------------------------------------
VLAN0001 Gi0/2

Number of blocked ports (segments) in the system : 1

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#sh spanning-tree int g0/2 detail


Port 2 (GigabitEthernet0/2) of VLAN0001 is designated forwarding
Port path cost 4, Port priority 128, Port Identifier 128.2.
Designated root has priority 32769, address 5000.0001.0000
Designated bridge has priority 32769, address 5000.0001.0000
Designated port id is 128.2, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
Link type is shared by default
BPDU: sent 20, received 72
17.3 BUCLE CON 2 SWITCHES
SWITCHES, USANDO SOLO LA VLAN 1 POR DEFECTO

Configurar un trunk en el puerto 23 y también en el puerto 24

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

Conectar el puerto 23 del SW-1


SW con el puerto 23 del SW-2.
También conectar el puerto 24 del SW-1
SW con el puerto 24 del SW-2.

Ejecutar “show spanning-tree


tree root” y “show spanning-tree
spanning tree bridge id” en cada switch. Verificar
que ambos switches han escogido el mismo root.

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”

Ir al switch que no es root. Realizar también “show spanning


spanning-tree
tree int f0/23 detail” y “show
spanning-tree
tree int f0/24 detail” Verificar que ambos puertos han empatado en “designated
“designate
bridge id” y desempatan en “designated port id”. Aquel que tenga menor “designated port
id” gana y se queda en “forwarding”. El otro se queda en “blocking”.
17.4
.4 BUCLE CON 2 SWITCHES Y CON 2 VLANS

Crear VLAN 2 y permitir la vlan1 y la vlan 2 en ambos


ambos trunks creados en el paso anterior

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

Comprobar con “show spanning-tree


spanning tree root” que cada switch es root en una vlan diferente

Comprobar con “show spanning-tree


spanning tree int f0/23” que dicho puerto tiene el rol de “root port”
en una VLAN y el rol de “designated port”
por en otra VLAN.
LAB 18:: Rapid Spanning Tree

Configurar los SVI, los trunks y las vlans de acuerdo a la figura

Ejecutar “show spanning-tree”


tree” y verificar que la palabra IEEE significa que está corriendo el
spanning-tree
tree tradicional en cada VLAN, o sea PVST+

Switch#show spanning-tree
tree
VLAN0001
Spanning tree enabled protocol ieee

!!! líneas omitidas por brevedad

Desconectar los cables temporalmente. Ejecutar el siguiente comando en ambos switches,


switches
habilitar también el debug

Switch(config)#spanning-
-tree mode rapid-pvst

Switch#debug spanning-tree
tree events

Ejecutar un “ping –tt “desde la PC 1 (IP 192.168.1.x) hacia la IP del SW-2


SW 2 192.168.1.2

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.

Ejecutar “show spanning-tree”


tree” y verificar que dice “rstp”
Switch#show spanning-tree
VLAN0001
Spanning tree enabled protocol rstp

!!! líneas omitidas por brevedad

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.

Switch#show spanning-tree vlan 1


VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 1
Address 000d.bdd3.4e80
Cost 19
Port 2 (FastEthernet0/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)


Address 0011.bba6.b000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Role Sts Cost Prio.Nbr Type


------------------- ---- --- --------- -------- ------------------------------
--
Fa0/1 Root FWD 19 128.1 P2p
Fa0/2 Altn BLK 19 128.2 P2p

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

Desconectar los puertos 1 y 2 del SW


SW-1.

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

Conectar un teléfono IP tanto al puerto 1 como al puerto 2. En caso no haya teléfono IP


entonces conectar un cable directamente al puerto 1 y al puerto 2.

Comprobar que se forma un bucle y que los puerto no son bloqueados por Spanning-Tree
Spanning

Switch#sh spanning-tree
tree blockedports

Name Blocked Interfaces


Interface List
-------------------- ------------------------------------

Number of blocked ports (segments) in the system : 0

Desconectar los cables. Borrar la configuración de BPDUFILTER por interface y colocar


BPDUFILTER global.

Switch(config)#int
(config)#int range f0/1 - 2
Switch(config-if)#no spanning-tree
spanning bpdufilter enable

Switch(config)#spanning tree portfast bpdufilter default


Switch(config)#spanning-tree

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

Borrar la configuración BPDUFILTER y en su lugar colocar 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

Comprobar que el puerto se coloca en “error disabled”

Desconectar los cables. Borrar la configuración de BPDUGUARD por interface y colocar


BPDUGUARD global.

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

También podría gustarte