Configuring MAC Address Tables: Information About MAC Addresses
Configuring MAC Address Tables: Information About MAC Addresses
SUMMARY STEPS
1. switch# configure terminal
2. switch(config) # mac address-table static mac_address vlan vlan-id {drop | interface {type slot/port}
| port-channel number}
3. (Optional) switch(config)# no mac address-table static mac_address vlan vlan-id
DETAILED STEPS
Step 2 switch(config) # mac address-table static mac_address Specifies a static address to add to the MAC address table.
vlan vlan-id {drop | interface {type slot/port} |
port-channel number}
Step 3 (Optional) switch(config)# no mac address-table static Deletes the static entry from the MAC address table.
mac_address vlan vlan-id
Use the mac address-table static command to assign a
static MAC address to a virtual interface.
Example
This example shows how to put a static entry in the MAC address table:
switch# configure terminal
switch(config) # mac address-table static 12ab.47dd.ff89 vlan 3 interface ethernet 1/4
switch(config) #
SUMMARY STEPS
1. switch# configure terminal
2. switch(config)# interface type slot/port
3. switch(config-if)# [no] switchport mac-learn disable
4. switch(config-if)# clear mac address-table dynamic interface type slot/port
DETAILED STEPS
Step 2 switch(config)# interface type slot/port Enters the interface configuration mode for the specified
interface.
Step 3 switch(config-if)# [no] switchport mac-learn disable Disables MAC address learning on Layer 2 interfaces.
Step 4 switch(config-if)# clear mac address-table dynamic Clears the MAC address table for the specified interface.
interface type slot/port
Important After disabling MAC address learning on an
interface, ensure that you clear the MAC address
table.
Example
This example shows how to disable MAC address learning on Layer 2 interfaces:
switch# configure terminal
switch(config)# interface ethernet 1/4
switch(config-if)# switchport mac-learn disable
switch(config-if)# clear mac address-table dynamic interface ethernet 1/4
This example shows how to re-enable MAC address learning on Layer 2 interfaces:
switch# configure terminal
switch(config)# interface ethernet 1/4
switch(config-if)# no switchport mac-learn disable
Note The Cisco Nexus device does not support per-VLAN CAM aging timers.
SUMMARY STEPS
1. switch# configure terminal
2. switch(config)# mac-address-table aging-time seconds
DETAILED STEPS
Example
This example shows how to set the aging time for entries in the MAC address table to 1800 seconds
(30 minutes):
switch# configure terminal
switch(config) # mac-address-table aging-time 1800
switch(config) #
Command Purpose
switch(config)# clear mac-address-table dynamic {address Clears the dynamic address entries from the
mac-addr} {interface [type slot/port | port-channel number} MAC address table.
{vlan vlan-id}
This example shows how to clear the dynamic entries in the MAC address table:
switch# clear mac-address-table dynamic
SUMMARY STEPS
1. switch# configure terminal
2. switch(config)# [no] mac address-table loop-detect port-down
3. switch(config)# mac address-table loop-detect port-down edge-port
DETAILED STEPS
Step 3 switch(config)# mac address-table loop-detect port-down Enables the err-disabled detection for the edge-port on the
edge-port MAC move loop detection.
Example
This example shows how to configure port-down as the action for MAC move loop detection.
switch# configure terminal
switch(config)# mac address-table loop-detect port-down
This example shows how to enable the err-disabled detection for the edge-port on the MAC move
loop detection.
switch# configure terminal
switch(config)# mac address-table loop-detect port-down edge-port
Note On Cisco Nexus 3000 and Cisco Nexus 3548 Series platforms, the self router MAC or HSRP VMAC are
dynamically learned by the switch under the following conditions:
• When there is a transient loop in the network due to which the switch receives its own packets.
• When there are spoofed packets where the source MAC is same as the Router MAC or HSRP MAC.
This behavior is different from other Cisco Nexus platforms. However, there is no operational impact due to
these self MAC entries that are present in the MAC table. Any packet that is destined to the router MAC or
HSRP MAC is routed. There is no Layer 2 lookup on these packets.
Command Purpose
show mac address-table aging-time Displays the MAC address aging time for all VLANs defined in the
switch.
show mac address-table Displays the contents of the MAC address table.
Note IGMP snooping learned MAC addresses are not displayed.