The display mac-address command displays the MAC address table of the switch. A MAC address entry contains the destination MAC address, VLAN ID/VSI/BD, outbound interface, and entry type.
display mac-address [ mac-address ] [ vlan vlan-id | vsi vsi-name ] [ verbose ]
display mac-address [ vlan vlan-id | interface-type interface-number ] * [ verbose ]
Parameter |
Description |
Value |
---|---|---|
mac-address |
Specifies the destination MAC address in an entry. |
The value is in H-H-H format. H is a hexadecimal number of 4 digits, for example, 00e0 and fc01. If you enter less than four digits, 0s are prefixed to the input digits. For example, if you enter e0, the system changes e0 to 00e0. The MAC address cannot be FFFF-FFFF-FFFF, 0000-0000-0000, or a multicast MAC address. |
vlan vlan-id |
Displays MAC address entries in a specified VLAN. |
The value is an integer that ranges from 1 to 4094. |
vsi vsi-name |
Displays MAC address entries in a specified VSI. NOTE:
Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731S-H, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730S-H, and S6730-H support this parameter. |
The value is a string of 1 to 31 case-sensitive characters, spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
interface-type interface-number |
Displays the MAC address entries with a specified outbound interface.
|
- |
verbose |
Displays detailed information about MAC address entries. |
- |
Usage Scenario
The MAC address table of the switch stores MAC addresses of other devices. When forwarding an Ethernet frame, the switch searches the MAC address table for the outbound interface according to the destination MAC address and VLAN ID in the Ethernet frame.
The display mac-address command displays all MAC address entries, such as dynamic MAC address entries, static MAC address entries, and blackhole MAC address entries. A MAC address entry contains the destination MAC address, VLAN ID/VSI/BD, outbound interface, and entry type.
Follow-up Procedure
If any MAC address entry in the command output is incorrect, run the undo mac-address command to delete the entry or run the mac-address static command to add a correct one.
Precautions
If you run the display mac-address command without parameters, all MAC address entries are displayed.
# Display all MAC address entries.
<HUAWEI> display mac-address ------------------------------------------------------------------------------- MAC Address VLAN/VSI/BD Learned-From Type ------------------------------------------------------------------------------- 0000-0000-0033 100/-/- GE0/0/1 dynamic 0000-0000-0001 200/-/- GE0/0/2 static ------------------------------------------------------------------------------- Total items displayed = 2
# Display detailed information about all MAC address entries in VLAN 10.
<HUAWEI> display mac-address vlan 10 verbose ------------------------------------------------------------------------------- MAC Address : 0000-0000-0001 VLAN : 10 Learned-From: GE0/0/2 Type : dynamic ------------------------------------------------------------------------------- Total items displayed = 1
Item |
Description |
---|---|
MAC Address |
Destination MAC address in a MAC address entry. |
VLAN/VSI/BD |
ID of the VLAN, or name of the VSI, or ID of the BD that a MAC address belongs to. |
Learned-From |
Interface that learns a MAC address. |
Type |
Type of a MAC address entry.
NOTE:
Among existing MAC address entries, only MAC addresses of the dynamic type can be overwritten as MAC addresses of other types. |