To add a MAC-layer station source address to the MAC address table, use the mac address-table static Global Configuration
mode command.
To delete a MAC address from the MAC address table, use the no form of this command.
Syntax
mac address-table static mac-address vlan vlan-id interfaces interface-id [delete-on-reboot | delete-on-timeout | permanent
| secure]
mac address-table static mac-address vlan vlan-id drop
no mac address-table static mac-address vlan vlan-id
Parameters
mac-address—MAC address of the interface.
vlan vlan-id—VLAN ID for the interface.
interfaces interface-id—Specifies an interface ID or a list of interface IDs. The interface can be one of these types: Ethernet port or port channel.
delete-on-reboot—(Optional) Specifies that the static MAC address is never aged out of the table and will be deleted after the switch reboots.
delete-on-timeout—(Optional) Deletes the MAC address when aging occurs.
permanent—(Optional) Specifies that the static MAC address never be aged out of the table and if it is saved to the Startup Configuration,
it is retained after rebooting. The keyword is applied by the default.
secure—(Optional) Specifies that the MAC address is secure when the interface is in classic locked mode.
drop—Drops the packets with the specified source or destination unicast MAC address.
Default Configuration
No static addresses are defined. The default mode for an added address is permanent.
Command Mode
Global Configuration mode
User Guidelines
Use the command to add a static MAC address with the given time-to-live in any mode or to add a secure MAC address in a secure
mode.
Each MAC address in the MAC address table is assigned two attributes: type and time-to-live.
The following time-to-live values are supported:
-
delete-on-reboot—A MAC address is saved until the next reboot.
-
delete-on-timeout—A MAC address that may be removed by the aging timer.
-
permanent—A MAC address is saved until it is removed manually.
The following types are supported:
-
static— MAC address is manually added by the command with the following keywords specifying its time-to-live:
-
secure—A MAC address added manually or learned in a secure mode. Use the mac address-table static command with the secure
keyword to add a secure MAC address. The MAC address cannot be relearned. A secure MAC address may be added only in a secure
port mode.
-
dynamic—A MAC address learned by the switch in nonsecure mode. A value of its time-to-live attribute is delete-on-timeout.
Examples
Example 1—The following example adds two permanent static MAC addresses:
switchxxxxxx(config)# mac address-table static 00:3f:bd:45:5a:b1 vlan 1 interfaces gi1
switchxxxxxx(config)# mac address-table static 00:3f:bd:45:5a:b2 vlan 1 interfaces gi1 permanent
Example 2—The following example adds a deleted-on-reboot static MAC address:
switchxxxxxx(config)# mac address-table static 00:3f:bd:45:5a:b2 vlan 1 interfaces gi1 delete-on-reboot
Example 3—The following example adds a deleted-on-timeout static MAC address:
switchxxxxxx(config)# mac address-table static 00:3f:bd:45:5a:b2 vlan 1 interfaces gi1 delete-on-timeout
Example 4—The following example adds a secure MAC address:
switchxxxxxx(config)# mac address-table static 00:3f:bd:45:5a:b2 vlan 1 interfaces gi1 secure