Configuración básica de VLAN
Para la configuración básica de VLAN vamos a usar el siguiente diagrama topológico
Tabla de direccionamiento IP
Paso 1: Habilitación de puertos de usuario en S2 Y S3
Switch>
Switch>ena
Switch#
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S2
S2(config)#interface range f0/6, f0/11, f0/18
S2(config-if-range)#switchport mode access
S2(config-if-range)#no shutdown
S2(config-if-range)# ^Z
S2#
%SYS-5-CONFIG_I: Configured from console by console
S2#
**********************
Switch>
Switch>ena
Switch#
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S3
S3(config)#interface range f0/6, f0/11, f0/18
S3(config-if-range)#switchport mode access
S3(config-if-range)#no shutdown
S3(config-if-range)#^Z
S3#
%SYS-5-CONFIG_I: Configured from console by console
S3#
Paso 2: Configuración de VLAN en S1
Switch>
Switch>ena
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S1
S1(config)#vlan 10
S1(config-vlan)#name Ingenieria
S1(config-vlan)#vlan 20
S1(config-vlan)#name Gerencia
S1(config-vlan)#vlan 30
S1(config-vlan)#name Contabilidad
S1(config-vlan)#vlan 99
S1(config-vlan)#name Management
S1(config-vlan)#end
S1#
%SYS-5-CONFIG_I: Configured from console by console
S1#
Paso 3: Verificamos que las VLAN están creadas en S1, por medio del comando “show vlan brief”
Paso 4: Configuración de VLAN en S2 y S3
S2>ena
S2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
S2(config)#vlan 10
S2(config-vlan)#name Ingenieria
S2(config-vlan)#vlan 20
S2(config-vlan)#name Gerencia
S2(config-vlan)#vlan 30
S2(config-vlan)#name Contabilidad
S2(config-vlan)#vlan 99
S2(config-vlan)#name Management
S2(config-vlan)#end
S2#
%SYS-5-CONFIG_I: Configured from console by console
S2#
**********************
S3>ena
S3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
S3(config)#vlan 10
S3(config-vlan)#name Ingenieria
S3(config-vlan)#vlan 20
S3(config-vlan)#name Gerencia
S3(config-vlan)#vlan 30
S3(config-vlan)#name Contabilidad
S3(config-vlan)#vlan 99
S3(config-vlan)#name Management
S3(config-vlan)#end
S3#
%SYS-5-CONFIG_I: Configured from console by console
S3#
Paso 5: Verificamos que las VLAN están creadas en S2 y S3, por medio del comando “show vlan brief”
Paso 6: Asignar puertos de switch a las VLAN en S2 y S3
S2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
S2(config)#interface range f0/6-10
S2(config-if-range)#switchport access vlan 30
S2(config)#interface range f0/11-17
S2(config-if-range)#switchport access vlan 10
S2(config-if-range)#interface range f0/18-24
S2(config-if-range)#switchport access vlan 20
S2(config-if-range)#end
S2#
%SYS-5-CONFIG_I: Configured from console by console
S2#copy running-config startup-config
Destination filename [startup-config]?
Building configuration…
[OK]
S2#
S3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
S3(config)#interface range f0/6-10
S3(config-if-range)#switchport access vlan 30
S3(config-if-range)#interface range f0/11-17
S3(config-if-range)#switchport access vlan 10
S3(config-if-range)#interface range f0/18-24
S3(config-if-range)#switchport access vlan 20
S3(config-if-range)#end
S3#
%SYS-5-CONFIG_I: Configured from console by console
S3#copy running-config startup-config
Destination filename [startup-config]?
Building configuration…
[OK]
S3#
Paso 7: Asignar la VLAN de administración
Una VLAN de administración es cualquier VLAN que se configura para acceder a las capacidades administrativas de un switch.
La VLAN 1 funciona como VLAN de administración si no ha definido específicamente otra VLAN. Se asigna a la VLAN de administración una dirección IP y máscara de subred.
Un switch puede administrarse mediante HTTP, Telnet, SSH o SNMP. Debido a que la configuración no convencional de un switch Cisco cuenta con la VLAN 1 como VLAN predeterminada, la misma es una mala elección como VLAN de administración.
Anteriormente, en este laboratorio, se configuró la VLAN 99 como VLAN de administración. Desde el modo de configuración de interfaz, utilicemos el comando ip address para asignar la dirección IP de administración a los switches.
S1>ena
S1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
S1(config)#interface vlan 99
S1(config-if)#ip address 172.17.99.11 255.255.255.0
S1(config-if)#no shutdown
S1(config-if)#end
S1#
%SYS-5-CONFIG_I: Configured from console by console
S1#
**********************
S2>ena
S2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
S2(config)#interface vlan 99
S2(config-if)#
%LINK-5-CHANGED: Interface Vlan99, changed state to up
S2(config-if)#ip address 172.17.99.12 255.255.255.0
S2(config-if)#no shutdown
S2(config-if)#end
S2#
%SYS-5-CONFIG_I: Configured from console by console
S2#
**********************
S3>ena
S3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
S3(config)#int vlan 99
S3(config-if)#
%LINK-5-CHANGED: Interface Vlan99, changed state to up
S3(config-if)#ip address 172.17.99.13 255.255.255.0
S3(config-if)#no shutdown
S3(config-if)#end
S3#
%SYS-5-CONFIG_I: Configured from console by console
S3#
La asignación de una dirección de administración permite la comunicación IP entre switches y permite también que cualquier host conectado a un puerto asignado a la VLAN 99 se conecte a los switches. Debido a que la VLAN 99 se encuentra configurada como la VLAN de administración, cualquier puerto asignado a esta VLAN se considera puerto de administración y debe contar con seguridad para controlar qué dispositivos pueden conectarse a estos puertos.
Paso 8: Configuración de enlaces troncales y la VLAN Nativa para los puertos de enlaces troncales en todos los switches
S1#
S1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
S1(config)#interface range f0/1-2
S1(config-if-range)#switchport mode trunk
S1(config-if-range)#switchport trunk native vlan 99
S1(config-if-range)#no shutdown
S1(config-if-range)#end
S1#
%SYS-5-CONFIG_I: Configured from console by console
S1#
**********************
S2#
S2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
S2(config)#int f0/1
S2(config-if)#switchport mode trunk
S2(config-if)#switchport trunk native vlan 99
S2(config-if)#no shutdown
S2(config-if)#end
S2#
%SYS-5-CONFIG_I: Configured from console by console
S2#
**********************
S3#
S3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
S3(config)#int f0/2
S3(config-if)#switchport mode trunk
S3(config-if)#switchport trunk native vlan 99
S3(config-if)#no shutdown
S3(config-if)#end
S3#
%SYS-5-CONFIG_I: Configured from console by console
S3#
Podemos verificar la configuración por medio del comando show interface trunk“
Paso 9: Verificar que los switches se pueden comunicar
Desde S1, haga ping a la dirección de administración en S2 y S3.
S1#ping 172.17.99.12
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.17.99.12, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms
S1#ping 172.17.99.13
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.17.99.13, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/1/7 ms
Paso 10: Verificar que los PC de la misma VLAN se pueden comunicar
Los PCs deben ser configurados con sus respectivas direcciones IP para realizar esta prueba
Desde PC1 a PC4
C:\>ping 172.17.10.24
Pinging 172.17.10.24 with 32 bytes of data:
Reply from 172.17.10.24: bytes=32 time=5ms TTL=128
Reply from 172.17.10.24: bytes=32 time<1ms TTL=128
Reply from 172.17.10.24: bytes=32 time<1ms TTL=128
Reply from 172.17.10.24: bytes=32 time<1ms TTL=128
Ping statistics for 172.17.10.24:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 5ms, Average = 1ms
C:\>
Desde PC4 a PC1
C:\>ping 172.17.10.21
Pinging 172.17.10.21 with 32 bytes of data:
Reply from 172.17.10.21: bytes=32 time<1ms TTL=128
Reply from 172.17.10.21: bytes=32 time<1ms TTL=128
Reply from 172.17.10.21: bytes=32 time=1ms TTL=128
Reply from 172.17.10.21: bytes=32 time<1ms TTL=128
Ping statistics for 172.17.10.21:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms
C:\>
Pregunta, ¿funciona el ping entre PC1 y PC2?, ¿por qué?