switchport port-security sticky

Enables sticky MAC learning on the port to convert the dynamically learned MAC addresses to sticky secure MAC addresses.

Syntax

switchport port-security sticky [ mac-address address vlan vlan_id ]
no switchport port-security sticky [ mac-address address vlan vlan_id ]

Command Default

Sticky MAC learning on the port is not enabled.

Parameters

mac-address address
Specifies the MAC address-based VLAN classifier rule used to map to a specific VLAN.
vlan vlan_id
Specifies a VLAN.

Modes

Interface configuration mode

Usage Guidelines

When sticky MAC learning is enabled on a secured port, the interface converts all the dynamic secure MAC addresses, including those that were dynamically learned before sticky learning was enabled, to sticky secure MAC addresses. All the subsequent sets of dynamically learned MAC addresses will also be converted to sticky secure MAC addresses.

The no switchport port-security sticky disables sticky MAC learning on a secure port, and all the sticky MAC addresses will be converted back to dynamically learned MAC addresses.

Sticky MAC addresses persist even if the port goes down or if the device reboots.

Examples

The following example enables sticky MAC learning on the port and configures port security with sticky MAC address:

device(config)# interface Ethernet 3/2
device(conf-if-eth-3/2)# switchport
device(conf-if-eth-3/2)# switchport port-security sticky
device(conf-if-eth-3/2)# switchport port-security sticky mac-address 0000.0018.747C vlan 5