static-mac

Syntax

static-mac <MAC-ADDR> vlan <VLAN-ID> port <PORT-NUM> 

no static-mac <MAC-ADDR> vlan <VLAN-ID> port <PORT-NUM>

Description

Adds a static MAC address to the MAC address table and associates it with a port or existing VLAN. Static MAC addresses can only be assigned to layer 2 (non-routed) interfaces. Static MAC addresses are not affected by the MAC address aging time.

The no form of this command deletes a static MAC address.

Command context

config

Parameters

<MAC-ADDR>

Specifies a MAC address (xx:xx:xx:xx:xx:xx), where x is a hexadecimal number from 0 to F.

vlan <VLAN-ID>

Specifies number of an existing VLAN.

port <PORT-NUM>

Specifies a physical port on the switch. Format: member/slot/port.

Authority

Administrators or local user group members with execution rights for this command.

Examples

switch(config)# static-mac 00:00:00:00:00:01 vlan 1 port 1/1/1
switch(config)# no static-mac 00:00:00:00:00:01 vlan 1 port 1/1/1

switch(config)# static-mac 00:00:00:00:00:01 vlan 1 port 1/1/2
1/1/2 is not an L2 port

switch(config)# static-mac 00:00:00:00:00:01 vlan 2 port 1/1/1
VLAN 2 not found