Día 1 Laboratorio

Laboratorio Práctico - Día 1

Configuración completa de red LAN con VLANs y switch management

Duración: 90 minutos | Práctica Hands-On

Escenario del Laboratorio

Trabajas para una empresa mediana que necesita implementar una red LAN segmentada. La empresa tiene tres departamentos y requiere:

  • VLAN 10 - Ventas: 50 usuarios
  • VLAN 20 - Contabilidad: 25 usuarios
  • VLAN 30 - IT: 15 usuarios
  • VLAN 99 - Gestión: Administración del switch
Objetivos del Lab:
  1. Configurar hostname y contraseñas del switch
  2. Crear y configurar VLANs
  3. Asignar puertos a VLANs
  4. Configurar puerto trunk
  5. Implementar port security
  6. Configurar gestión remota

Topología de Red

Diagrama de Red

Router
192.168.1.1

Switch
192.168.1.10
VLAN 10 - Ventas
VLAN 20 - Contabilidad
VLAN 30 - IT
Asignación de Puertos:
  • Fa0/1-10: VLAN 10 (Ventas)
  • Fa0/11-20: VLAN 20 (Contabilidad)
  • Fa0/21-23: VLAN 30 (IT)
  • Fa0/24: Trunk al Router

Configuración Paso a Paso

1Configuración Básica del Switch
! Entrar en modo de configuración
Switch> enable
Switch# configure terminal

! Configurar hostname
Switch(config)# hostname SW-EMPRESA

! Configurar contraseña de enable
SW-EMPRESA(config)# enable secret AdminPass123

! Configurar banner de mensaje
SW-EMPRESA(config)# banner motd "Acceso autorizado solamente"

! Configurar consola
SW-EMPRESA(config)# line console 0
SW-EMPRESA(config-line)# password ConsolePass123
SW-EMPRESA(config-line)# login
SW-EMPRESA(config-line)# logging synchronous
SW-EMPRESA(config-line)# exit
2Crear VLANs
! Crear VLAN 10
SW-EMPRESA(config)# vlan 10
SW-EMPRESA(config-vlan)# name VENTAS
SW-EMPRESA(config-vlan)# exit

! Crear VLAN 20
SW-EMPRESA(config)# vlan 20
SW-EMPRESA(config-vlan)# name CONTABILIDAD
SW-EMPRESA(config-vlan)# exit

! Crear VLAN 30
SW-EMPRESA(config)# vlan 30
SW-EMPRESA(config-vlan)# name IT
SW-EMPRESA(config-vlan)# exit

! Crear VLAN de gestión
SW-EMPRESA(config)# vlan 99
SW-EMPRESA(config-vlan)# name GESTION
SW-EMPRESA(config-vlan)# exit
3Asignar Puertos a VLANs
! Configurar puertos de VENTAS
SW-EMPRESA(config)# interface range fastethernet 0/1-10
SW-EMPRESA(config-if-range)# switchport mode access
SW-EMPRESA(config-if-range)# switchport access vlan 10
SW-EMPRESA(config-if-range)# spanning-tree portfast
SW-EMPRESA(config-if-range)# exit

! Configurar puertos de CONTABILIDAD
SW-EMPRESA(config)# interface range fastethernet 0/11-20
SW-EMPRESA(config-if-range)# switchport mode access
SW-EMPRESA(config-if-range)# switchport access vlan 20
SW-EMPRESA(config-if-range)# spanning-tree portfast
SW-EMPRESA(config-if-range)# exit

! Configurar puertos de IT
SW-EMPRESA(config)# interface range fastethernet 0/21-23
SW-EMPRESA(config-if-range)# switchport mode access
SW-EMPRESA(config-if-range)# switchport access vlan 30
SW-EMPRESA(config-if-range)# spanning-tree portfast
SW-EMPRESA(config-if-range)# exit
4Configurar Puerto Trunk
! Configurar puerto trunk al router
SW-EMPRESA(config)# interface fastethernet 0/24
SW-EMPRESA(config-if)# switchport mode trunk
SW-EMPRESA(config-if)# switchport trunk native vlan 99
SW-EMPRESA(config-if)# switchport trunk allowed vlan 10,20,30,99
SW-EMPRESA(config-if)# exit
5Configurar Port Security
! Port security en puertos de VENTAS
SW-EMPRESA(config)# interface range fastethernet 0/1-10
SW-EMPRESA(config-if-range)# switchport port-security
SW-EMPRESA(config-if-range)# switchport port-security maximum 2
SW-EMPRESA(config-if-range)# switchport port-security mac-address sticky
SW-EMPRESA(config-if-range)# switchport port-security violation restrict
SW-EMPRESA(config-if-range)# exit

! Port security en puertos de CONTABILIDAD (más restrictivo)
SW-EMPRESA(config)# interface range fastethernet 0/11-20
SW-EMPRESA(config-if-range)# switchport port-security
SW-EMPRESA(config-if-range)# switchport port-security maximum 1
SW-EMPRESA(config-if-range)# switchport port-security mac-address sticky
SW-EMPRESA(config-if-range)# switchport port-security violation shutdown
SW-EMPRESA(config-if-range)# exit
6Configurar Gestión Remota
! Configurar IP de gestión
SW-EMPRESA(config)# interface vlan 99
SW-EMPRESA(config-if)# ip address 192.168.1.10 255.255.255.0
SW-EMPRESA(config-if)# no shutdown
SW-EMPRESA(config-if)# exit

! Gateway por defecto
SW-EMPRESA(config)# ip default-gateway 192.168.1.1

! Configurar acceso SSH
SW-EMPRESA(config)# ip domain-name empresa.local
SW-EMPRESA(config)# crypto key generate rsa general-keys modulus 1024
SW-EMPRESA(config)# username admin privilege 15 secret AdminSSH123

SW-EMPRESA(config)# line vty 0 15
SW-EMPRESA(config-line)# transport input ssh
SW-EMPRESA(config-line)# login local
SW-EMPRESA(config-line)# exit

! Guardar configuración
SW-EMPRESA(config)# exit
SW-EMPRESA# write memory

Comandos de Verificación

Utiliza estos comandos para verificar que la configuración sea correcta:

Comando Qué Verificar
show vlan brief VLANs creadas y puertos asignados
show interfaces status Estado de puertos y VLAN asignada
show interfaces trunk Configuración de puerto trunk
show port-security Estado de seguridad de puertos
show ip interface brief IP de gestión configurada
show running-config Configuración completa actual

Resolución de Problemas

Problemas Comunes:
  • Puerto en estado err-disabled: Verificar port security
  • No conectividad entre VLANs: Verificar configuración trunk
  • No acceso SSH: Verificar dominio y llaves RSA
  • VLAN no aparece: Verificar que esté creada y guardada
Comandos de Troubleshooting:
! Resetear puerto en err-disabled
SW-EMPRESA(config)# interface fastethernet 0/X
SW-EMPRESA(config-if)# shutdown
SW-EMPRESA(config-if)# no shutdown

! Ver detalles de port security
SW-EMPRESA# show port-security interface fastethernet 0/X

! Ver tabla de MACs
SW-EMPRESA# show mac address-table dynamic

! Limpiar tabla de MACs
SW-EMPRESA# clear mac address-table dynamic

Lista de Verificación

Marca cada elemento como completado:

Progreso del Lab
0% completado
Pasos del Laboratorio

Tip:

Guarda la configuración frecuentemente con write memory