Port Security
El comando Port security aplica seguridad a los puertos de los switches.
La seguridad en ese puerto define desde la MAC del dispositivo conectado si puede enviar
tráfico a través del switch. Puede ser una MAC de un listado una única MAC asociada con
ese puerto.
Si una MAC diferente a las permitidas o un puerto detecta una MAC diferente a la
asociada a ese puerto, se denegará el tráfico por ese puerto.
Sticky MAC Addresses
Mediante sticky MAC Adress, el switch o router aprende dinámicamente las MACS de los
equipos conectados implementandoles las seguridad.
Esta información es almacenada en memoria al hace un write o copy running config startup
config
Configuración por defecto
La seguridad esta deshabilitada, el número máximo de MACS aceptada es 1 y el modo de
reacción en caso de violación de seguridad es deshabilitar el puerto cuando se llega al
máximo de MACS permitidas y enviar un trap SNMP
Como habilitar nuevamente el puerto deshabilitado
errdisable recovery cause psecure-violation
no shut down
Como borrar información almacenada acerca las MACS permitidas
clear port-security dynamic
Como ver lospuertos con seguridad
show mac-address-table
Reacciones permitidas ate una violación de seguridad
protect— Descarta los paquetes con direcciones de origen MAC desconocidas
hasta eliminar un número suficiente de direcciones MAC seguras sea por debajo del
valor máximo.
restrict—Descarta los paquetes con direcciones de origen MAC desconocidas hasta
que elimine un número suficiente de direcciones MAC seguras para que caiga por
debajo del valor máximo y haga que el contador SecurityViolation aumente.
shutdown— Pone la interfaz en el estado deshabilitado por error inmediatamente y
envía una notificación de captura SNMP.
Configuracion de port security en un puerto trunk
Command Purpose
Step 1 Router(config)# interface Selects the LAN port to
type1 slot/port configure.
Step 2 Router(config-if)# Configures the port as a Layer
switchport 2 port.
Step 3 Router(config-if)# Configures the encapsulation,
switchport trunk which configures the Layer 2
encapsulation {isl | dot1q} switching port as either an ISL
or 802.1Q trunk.
Step 4 Router(config-if)# Configures the port to trunk
switchport mode trunk unconditionally.
Step 5 Router(config-if)# Configures the trunk not to
switchport nonegotiate use DTP.
Step 6 Router(config-if)# Enables port security on the
switchport port-security trunk.
Step 7 Router(config-if)# do show Verifies the configuration.
port-securityinterface
type1 slot/port | include Port
Security
Habilitando seguridad en un puerto de acceso
Command Purpose
Step 1 Router(config)# Selects the LAN port to [Link]
interface The port can be a tunnel port or a
type1 slot/port PVLAN port.
Step 2 Router(config-if)# Configures the port as a Layer 2 port.
switchport
Step 3 Router(config-if)# Configures the port as a Layer 2 access
switchport mode [Link] A port in the default mode
access (dynamic desirable) cannot be
configured as a secure port.
Step 4 Router(config-if)# Enables port security on the port.
switchport port-
security
Step 5 Router(config-if)# do Verifies the configuration.
show port-security
interface
type1 slot/port |
include Port Security
Configurar la acción a realizar en un puerto
Command Purpose
Step 1 Router(config)# interface Selects the LAN port to
type1 slot/port configure.
Step 2 (Optional) Sets the
violation mode and the
Router(config-if)# switchport action to be taken when a
port-security violation {protect security violation is
| restrict | shutdown} detected.
Step 3 Router(config-if)# do show port- Verifies the
securityinterface type1 slot/port | configuration.
includeviolation_mode2
Configurar el límite de conexiones en un puerto
Command Purpose
Step 1 Router(config)# interface Selects the LAN port to
type1 slot/port configure.
Step 2 Router(config-if)# switchport Sets the maximum number
port-security maximum of secure MAC addresses
number_of_addresses vlan for the port (default is
{vlan_ID | vlan_range} 1).Note Per-VLAN
configuration is supported
only on trunks.
Step 3 Router(config-if)# do show Verifies the configuration.
port-securityinterface
type1 slot/port | include
Maximum
Seguridad con Sticky MAC
Command Purpose
Step 1 Router(config)# interface Selects the LAN port to
type1 slot/port configure.
Step 2 Router(config-if)# switchport Enables port security with
port-security mac-address sticky MAC addresses on
sticky a port.
Permitir acceso a una unica MAC
Command Purpose
Step 1 Router(config)# interface Selects the LAN port to
type1 slot/port configure.
Step 2 Router(config-if)# Configures a static MAC
switchport port-security address as secure on the
mac-address [sticky] [Link] Per-VLAN
mac_address [vlan vlan_ID] configuration is supported
only on trunks.
Step 3 Router(config-if)# end Exits configuration mode.
Step 4 Router# show port-security Verifies the configuration.
address