static-mac

Syntax

static-mac <mac-address> vlan <VLAN-ID> port <PORT-NUM> 

no static-mac <mac-address> 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.

mac-address

Specifies the static MAC address.

vlan <VLAN-ID>

Specifies number of an existing VLAN. Range: 1 - 4040.

port <PORT-NUM>

Specifies a physical port on the switch. Some switches (such as the Aruba 8400 Switch Series), use the format member/slot/port (for example, 1/1/1). Other switches use slot/port (for example, 1/1).

Authority

Administrators

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
MAC address cannot be added on a route-only port 1/1/2

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