Previous Topic

Next Topic

Book Contents

Port Security Commands

This section describes the command you use to configure Port Security on the switch. Port security, which is also known as port MAC locking, allows you to secure the network by locking allowable MAC addresses on a given port. Packets with a matching source MAC address are forwarded normally, and all other packets are discarded.

Note: To enable the SNMP trap specific to port security, see "snmp-server enable traps violation" on page 139.

port-security

This command enables port locking on an interface, a range of interfaces, or at the system level.

no port-security

This command disables port locking for one (Interface Config) or all (Global Config) ports.

port-security max-dynamic

This command sets the maximum number of dynamically locked MAC addresses allowed on a specific port.

no port-security max-dynamic

This command resets the maximum number of dynamically locked MAC addresses allowed on a specific port to its default value.

port-security max-static

This command sets the maximum number of statically locked MAC addresses allowed on a port.

no port-security max-static

This command sets maximum number of statically locked MAC addresses to the default value.

port-security mac-address

This command adds a MAC address to the list of statically locked MAC addresses for an interface or range of interfaces. The vid is the VLAN ID.

no port-security mac-address

This command removes a MAC address from the list of statically locked MAC addresses.

port-security mac-address move

This command converts dynamically locked MAC addresses to statically locked addresses for an interface or range of interfaces.

port-security mac-address sticky

This command enables sticky mode Port MAC Locking on a port. If accompanied by a MAC address and a VLAN id (for interface config mode only), it adds a sticky MAC address to the list of statically locked MAC addresses. These sticky addresses are converted back to dynamically locked addresses if sticky mode is disabled on the port. The <vid> is the VLAN ID. The Global command applies the "sticky" mode to all valid interfaces (physical and LAG). There is no global sticky mode as such.

Sticky addresses that are dynamically learned will appear in show running config as "port-security mac-address sticky <mac> <vid>" entries. This distinguishes them from static entries.

no port-security mac-address sticky

The no form removes the sticky mode. The sticky MAC address can be deleted by using the command "no port- security mac-address <mac-address> <vid>".

show port-security

This command displays the port-security settings for the port(s). If you do not use a parameter, the command displays the Port Security Administrative mode. Use the optional parameters to display the settings on a specific interface or on all interfaces.

The display parameters for above command are:

For each interface, or for the interface you specify, the following information appears:

show port-security dynamic

This command displays the dynamically locked MAC addresses for the port.

The display parameters for above command are:

show port-security static

This command displays the statically locked MAC addresses for port.

The display parameters for above command are:

show port-security violation

This command displays the source MAC address of the last packet discarded on a locked port.

The display parameters for above command are:

port-security violation

This command will set the action to be taken on PML security violation. Violation occurs when number of dynamically learnt entry on some interface crosses the max-dynamic limit configured on that interface. Action can be restrict or shutdown. When it is set to restrict then the packet is dropped and when it is set to shutdown then the interface is moved to admin disable. Default action is shutdown.

no port-security violation

This command set the violation action to default value, shutdown.

show port-security violation

This command displays the violation settings for the interface to restrict or shutdown. It also displays the source MAC address of the last packet discarded on a locked port.

See also

Switching Commands

Port Configuration Commands

Spanning Tree Protocol (STP) Commands

VLAN Commands

Private VLAN Commands

Ethernet Ring Protection Commands

Double VLAN Commands

Voice VLAN Commands

Provider Bridge Commands

802.1AS Timesync Commands

Provisioning (IEEE 802.1p) Commands

Protected Ports Commands

GARP Commands

GVRP Commands

GMRP Commands

Port-Based Network Access Control Commands

Switch Port Auto-recovery (SPAR) Commands

802.1X Supplicant Commands

Storm-Control Commands

Link Local Protocol Filtering Commands

MMRP Commands

MSRP Commands

MVRP Commands

Port-Channel/LAG (802.3ad) Commands

Port Mirroring

Static MAC Filtering

DHCP L2 Relay Agent Comamnds

DHCP Client Commands

DHCP Snooping Configuration Commands

Dynamic ARP Inspection Commands

IGMP Snooping Configuration Commands

IGMP Snooping Querier Commands

MLD Snooping Commands

MLD Snooping Querier Commands

LLDP (802.1AB) Commands

LLDP-MED Commands

Denial of Service Commands

MAC Database Commands

ISDP Commands

Ethernet in the First Mile Operations and Maintenance Commands

Connectivity Fault Management Commands