Descubrimiento de Dispositivos (CDP / LLDP)
Antes de diagnosticar un problema, necesitas saber qué está conectado a qué. Los protocolos de descubrimiento responden esa pregunta automáticamente.
CDP (Cisco Discovery Protocol)
Section titled “CDP (Cisco Discovery Protocol)”Protocolo propio de Cisco que funciona en capa 2. Todos los dispositivos Cisco lo envían por defecto cada 60 segundos.
Qué información envía CDP
Section titled “Qué información envía CDP”| Campo | Ejemplo |
|---|---|
| Device ID | R1.lab.local |
| Platform | Cisco ISR 4331 |
| Interface | GigabitEthernet0/0 |
| IP address | 192.168.10.1 |
| Holdtime | 180 segundos |
| Native VLAN | 1 |
| Duplex | Full |
Configuración de CDP
Section titled “Configuración de CDP”R1(config)# cdp run # Habilitar globalmente (default: ON)R1(config)# cdp timer 60 # Intervalo de envío (default: 60s)R1(config)# cdp holdtime 180 # Tiempo antes de borrar vecino (default: 180s)
R1(config)# interface GigabitEthernet0/0R1(config-if)# cdp enable # Habilitar en interfaz (default: ON)Verificación de CDP
Section titled “Verificación de CDP”R1# show cdpR1# show cdp neighborsR1# show cdp neighbors detailR1# show cdp interface GigabitEthernet0/0R1# show cdp entry R1Ejemplo de salida
Section titled “Ejemplo de salida”Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, c - CVLAN
Device-ID Local Intf Holdtme Platform CapabilitiesSW1 Gi0/0 175 2960 SSW2 Gi0/1 175 2960 SCDP solo ve dispositivos Cisco. Si hay switches HP, Juniper o APs de otro fabricante, CDP no los descubre.
LLDP (Link Layer Discovery Protocol)
Section titled “LLDP (Link Layer Discovery Protocol)”Estándar IEEE 802.1AB — funciona con cualquier fabricante. Es el equivalente multi-vendor de CDP.
Configuración de LLDP
Section titled “Configuración de LLDP”R1(config)# lldp run # Habilitar globalmenteR1(config)# lldp timer 30 # Intervalo de envío (default: 30s)R1(config)# lldp holdtime 120 # Tiempo antes de borrar (default: 120s)R1(config)# lldp reinit 2 # Retraso al reiniciar interfaz
R1(config)# interface GigabitEthernet0/0R1(config-if)# lldp enable # Habilitar en interfazVerificación de LLDP
Section titled “Verificación de LLDP”R1# show lldpR1# show lldp neighborsR1# show lldp neighbors detailR1# show lldp interface GigabitEthernet0/0Ejemplo de salida
Section titled “Ejemplo de salida”Local Intf Device ID Hold Time Capability Port IDGi0/0 SW1 120 B,R Gi0/1Gi0/1 SW2 120 B,R Gi0/1CDP vs LLDP
Section titled “CDP vs LLDP”| Característica | CDP | LLDP |
|---|---|---|
| Estándar | Propio Cisco | IEEE 802.1AB |
| Capa | 2 | 2 |
| Intervalo default | 60s | 30s |
| Holdtime default | 180s | 120s |
| Multi-vendor | No | Sí |
| Seguridad | Baja (info visible) | Baja (info visible) |
| Habilitado por defecto | Sí | No siempre |
Cuál usar
Section titled “Cuál usar”- En redes Cisco puro: CDP es suficiente y automático.
- En ambientes multi-vendor: LLDP es obligatorio.
- Producción: habilita ambos para máxima cobertura de descubrimiento.
Seguridad: deshabilitar en puertos de acceso
Section titled “Seguridad: deshabilitar en puertos de acceso”En puertos conectados a usuarios finales, CDP/LLDP revela información del dispositivo. Es recomendable deshabilitarlos en puertos de acceso:
SW1(config)# interface FastEthernet0/1SW1(config-if)# no cdp enableSW1(config-if)# no lldp enableMantener CDP/LLDP habilitado solo en troncales y puertos de enlace entre dispositivos de red.
Troubleshooting de topología
Section titled “Troubleshooting de topología”Problema común: vecino no aparece
Section titled “Problema común: vecino no aparece”- Verificar que CDP/LLDP está habilitado en ambos lados.
- Verificar que la interfaz está
up/up. - Verificar que no está bloqueado por una ACL o VLAN incorrecta.
- Usar
show cdp neighborsy comparar con la topología documentada.
Ejemplo: verificar conectividad
Section titled “Ejemplo: verificar conectividad”SW1# show cdp neighborsSW1# show ip interface briefSW1# show interfaces statusSW1# show vlan brief