- Preface
- New and Changed Information
- Overview
- Configuring Ethernet Interfaces
- Configuring VLANs
- Configuring Private VLANs
- Configuring Access and Trunk Interfaces
- Configuring Port Channels
- Configuring Virtual Port Channels
- Configuring Enhanced Virtual Port Channels
- Configuring Rapid PVST+
- Configuring Multiple Spanning Tree
- Configuring STP Extensions
- Configuring Flex Links
- Configuring LLDP
- Configuring MAC Address Tables
- Configuring IGMP Snooping
- Configuring MVR
- Configuring Traffic Storm Control
- Configuring the Fabric Extender
- Index
Configuring MAC Address Tables
This chapter contains the following sections:
Information About MAC Addresses
To switch frames between LAN ports, the switch maintains an address table. When the switch receives a frame, it associates the media access control (MAC) address of the sending network device with the LAN port on which it was received.
The switch dynamically builds the address table by using the MAC source address of the frames received. When the switch receives a frame for a MAC destination address not listed in its address table, it floods the frame to all LAN ports of the same VLAN except the port that received the frame. When the destination station replies, the switch adds its relevant MAC source address and port ID to the address table. The switch then forwards subsequent frames to a single LAN port without flooding all LAN ports.
You can also enter a MAC address, which is termed a static MAC address, into the table. These static MAC entries are retained across a reboot of the switch.
Configuring MAC Addresses
Configuring Static MAC Addresses
You can configure static MAC addresses for the switch. These addresses can be configured in interface configuration mode or in VLAN configuration mode.
1. switch# configure terminal
2. switch(config) # mac-address-table static mac_address vlan vlan-id {drop | interface {type slot/port} | port-channel number} [auto-learn]
3. (Optional) switch(config)# no mac address-table static mac_address vlan vlan-id
DETAILED STEPS
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) #
Configuring the Aging Time for the MAC Table
You can configure the amount of time that an entry (the packet source MAC address and port that packet ingresses) remains in the MAC table. MAC aging time can be configured in either interface configuration mode or in VLAN configuration mode.
1. switch# configure terminal
2. switch(config)# mac-address-table aging-time seconds [vlan vlan_id]
DETAILED STEPS
This example shows how to set the aging time for entries in the MAC address table to 300 seconds:
switch# configure terminal switch(config) # mac-address-table aging-time 300 switch(config) #
Clearing Dynamic Addresses from the MAC Table
1. switch# configure terminal
2. switch(config)# clear mac-address-table dynamic {address mac-addr} {interface [type slot/port | port-channel number} {vlan vlan-id}
DETAILED STEPS
Command or Action | Purpose |
---|
Verifying the MAC Address Configuration
Use one of the following commands to verify the configuration:
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.
|
||
show mac address-table loop-detect |
Displays the currently configured action. |
This example shows how to display the MAC address table:
switch# show mac-address-table VLAN MAC Address Type Age Port ---------+-----------------+-------+---------+------------------------------ 1 0018.b967.3cd0 dynamic 10 Eth1/3 1 001c.b05a.5380 dynamic 200 Eth1/3 Total MAC Addresses: 2
This example shows how to display the current aging time:
switch# show mac-address-table aging-time Vlan Aging Time ----- ---------- 1 300 13 300 42 300
This example shows how to display the currently configured action:
switch# configure terminal switch(config)# show mac address-table loop-detect Port Down Action Mac Loop Detect : enabled
switch# configure terminal switch(config)# no mac address-table loop-detect port-down switch(config)# show mac address-table loop-detect Port Down Action Mac Loop Detect : disabled