10-MAC Address Table Configuration Commands
10-MAC Address Table Configuration Commands
Configuration Commands
Table of Contents
Table of Contents
Chapter 1 MAC Address Table Characteristics Configuration Commands .......................................................................... 1
1.1 MAC Address Table Characteristic Configuration Commands .............................................................................. 1
1.1.1 mac address-table static ........................................................................................................................... 1
1.1.2 mac address-table aging-time................................................................................................................... 1
1.1.3 switchport shared-learning ........................................................................................................................ 2
1.1.4 show mac address-table ........................................................................................................................... 2
1.1.5 clear mac address-table............................................................................................................................ 3
-I-
description
To add/delete a static MAC address, use the mac address-table static command.
[no] mac address-table static mac-addr vlan vlan-id interface interface-id
parameter
parameter
description
mac-addr
vlan-id
interface-id
Default
none
command mode
global configuration
example
The following example binds the MAC address 0004.5600.67ab to the interface g0/2 of
VLAN 1:
Switch(config)# mac address-table static 0004.5600.67ab vlan 1 interface g0/2
1.1.2
description
To configure the maximum aging time for MAC address table, use the
mac-address-table aging-time command in global configuration mode.
mac address-table aging-time [0 | 10-1000000]
parameter
parameter
description
10-1000000
The aging time for MAC address table. Valid values are from 10
-1-
Default
none
command mode
global configuration mode
example
The following example configures the aging time for MAC address table to 100
seconds:
Switch(config)# mac address-table aging-time 100
1.1.3
switchport shared-learning
description
To configure VLAN to share MAC address, use the switch shared-learing command.
switchport shared-learning
parameter
none
default
disabled
command mode
interface configuration mode
example
The following example cofigures all Vlans to share MAC address on interface f0/1:
Switch_config_f0/1#switchport shared-learning
1.1.4
description
To display the content of the switch MAC address table, use the show mac
address-table command.
show mac address-table {dynamic [interface interface-id | vlan vlan-id] | static}
parameter
paramenter
description
-2-
dynamic
interface-id
Interface name
vlan-id
static
default
none
instruction
Use this command to display MAC address table.
example
The following example displays all static MAC address tables:
Switch# show mac address-table static
Mac Address Table
-----------------------------------------Vlan Mac Address Type Ports
---- ----------- ---- ----All 0000.0000.0001 STATIC CPU
All 0000.0000.0002 STATIC CPU
All 0000.0000.0003 STATIC CPU
All 0000.0000.0009 STATIC CPU
All 0000.0000.0012 STATIC CPU
All 0180.c200.000b STATIC CPU
All 0180.c200.000c STATIC CPU
All 0180.c200.000d STATIC CPU
All 0180.c200.0010 STATIC CPU
1.1.5
description
To delete a dynamic MAC address, use the clear mac address-table
clear mac address-table dynamic [address mac-addr | interface interface-id | vlan
vlan-id]
parameter
parameter
description
dynamic
address mac-addr
interface-id
vlan-id
-3-
default
none
command mode
EXEC
example
The following example deletes all MAC addresses that acquire dynamically on interface
f0/2:
Switch# clear mac address-table dynamic interface f0/2
-4-