MAC Address Configuration Commands I Table of Contents Table of Contents Chapter 1 MAC Address Configuration Commands..................................................................................1 1.1 MAC Address Configuration Commands......................................................................................1 1.1.1 mac address-table static......................................................................................................1 1.1.2 mac address-table aging-time............................................................................................ 1 1.1.3 mac address-table blackhole.............................................................................................. 2 1.1.4 show mac address-table......................................................................................................3 1.1.5 clear mac address-table...................................................................................................... 4 II MAC Address Configuration Commands Chapter 1 MAC Address Configuration Commands 1.1 MAC Address Configuration Commands 1.1.1 mac address-table static Syntax To add a static MAC address, run mac address-table static mac-addr vlan vlan-id interface interface-id. To cancel the static MAC address, run no mac address-table static mac-addr vlan vlan-id interface interface-id. mac address-table static mac-addr vlan vlan-id interface interface-id [no] mac address-table static mac-addr vlan vlan-id interface interface-id Parameters Parameter Description mac-addr MAC address Value range: H.H.H vlan-id A VLAN that the MAC address belongs to Value range: 1-4094 interface-id Physical port that the MAC address belongs to. Default Value None Usage Guidelines This command is configured in global configuration mode. Example The following example shows how to bind MAC address 0004.5600.67ab to port g0/2 of VLAN1. Switch_config# mac address-table static 0004.5600.67ab vlan 1 interface g0/2 1.1.2 mac address-table aging-time Syntax To configure the aging time of the MAC address table, run the following command. 1 MAC Address Configuration Commands mac address-table aging-time [0 | 10-1000000] Parameters Parameters Description 0 Means that the MAC address never ages. 10-1000000 Aging time of the MAC address whose unit is second Default Value 300s Usage Guidelines This command is configured in global configuration mode. Example The following example shows how to set the aging time of the MAC address to 100 seconds. Switch_config# mac address-table aging-time 100 1.1.3 mac address-table blackhole Syntax To add or delete a black hole MAC address, run the following command. [no] mac address-table blackholemac-addr vlan vlan-id Parameters Parameters Description mac-addr MAC address Value range: H.H.H vlan-id A VLAN that the MAC address belongs to Value range: 1-4094 Default Value None Usage Guidelines This command is configured in global configuration mode. 2 MAC Address Configuration Commands Example The following example shows how to configure the address 0004.5600.67ab to the black hole mac on VLAN1. Switch_config# mac address-table blackhole 0004.5600.67ab vlan 1 1.1.4 show mac address-table Syntax To display the MAC address table of the switch, run the following command. show mac address-table [dynamic [interface interface-id | vlan vlan-id] | static | brief | multicast | interface interface-id | vlan vlan-id | H.H.H | blackhole] Parameters Parameters Description dynamic Dynamically-learned MAC address table interface-id Name of an interface vlan-id VLAN ID Value range: 1-4094 static Static MAC address table brief Brief information about the MAC address multicast Multicast MAC address table Interface Interface’s MAC address table Vlan Vlan mac address table H.H.H Specific address Blackhole Blackhole MAC address; Default Value None Usage Guidelines This command is used to display the MAC address table. Example The following example shows how to display all dynamic MAC address tables. Switch_config#show mac address-table Mac Address Table (Total 2) 3 MAC Address Configuration Commands ------------------------------------------ Vlan Mac Address Type Ports ---- ----------- ---- ----- 1 0026.5a7c.fad3 DYNAMIC g0/2 1 0000.0000.0004 DYNAMIC g0/2 1.1.5 clear mac address-table Syntax To delete the dynamic MAC address, run the following command. clear mac address-table dynamic [address mac-addr | interface interface-id | vlan vlan-id] Parameters Parameters Description mac-addr MAC address Value range: H.H.H interface-id Means a name of a L2 interface. vlan-id VLAN ID Value range: 1-4094 Default Value None Usage Guidelines This command is used in EXEC mode. Example The following example shows how to clear all dynamically-learned MAC addresses on interface g0/2. Switch# clear mac address-table dynamic interface g0/2 4