display mac-address

Syntax

display mac-address [ mac-address [ vlan vlan-id ] | [ [ dynamic | static ] [ interface interface-type interface-number ] | blackhole ] [ vlan vlan-id ] [ count ] ] [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

blackhole: Displays blackhole MAC address entries, which do not age and can be added and deleted. Packets with a matching destination MAC address are discarded.

vlan vlan-id: Displays MAC address entries of the specified VLAN, where vlan-id is in the range of 1 to 4094.

count: Displays the number of MAC address entries specified by related parameters in the command. When this keyword is used, the command displays only the number of specified MAC address entries, rather than related information about these MAC address entries.

mac-address: Displays MAC address entries of a specified MAC address, in the format of H-H-H.

dynamic: Displays dynamic MAC address entries, which can be aged.

static: Displays static MAC address entries, which do not age.

interface interface-type interface-number: Displays the MAC address learning status of the specified interface. interface-type interface-number specifies an interface by its type and number.

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use display mac-address to display information about the MAC address table.

If you execute this command without specifying any parameters, it displays information of all MAC address entries on the device, including unicast MAC address entries and static multicast MAC address entries.

If you execute this command using only the vlan keyword or the count keyword, or only these two keywords, it displays information of unicast MAC address entries and static multicast MAC address entries.

Related commands: mac-address (system view), mac-address (interface view), and mac-address timer; display mac-address multicast and display mac-address multicast count (IP Multicast Command Reference).

Examples

# Display the MAC address table entry for MAC address 000f-e201-0101.

<Sysname> display mac-address 000f-e201-0101
MAC ADDR        VLAN ID    STATE            PORT INDEX       AGING TIME(s)
000f-e201-0101  1          Learned          Ethernet1/0/1    AGING

  ---  1 mac address(es) found  ---  

Table 11: Command output

Field

Description

MAC ADDR

MAC address.

VLAN ID

ID of the VLAN to which the MAC address belongs.

STATE

State of a MAC address entry:

  • Config static—The static entry manually configured by the user.

  • Config dynamic—The dynamic entry manually configured by the user.

  • Learned—The entry learned by the device.

  • Blackhole—The blackhole entry.

  • Multicast—The static multicast MAC address entry manually configured by the user. For more information about static multicast MAC address entries, see IP Multicast Configuration Guide.

PORT INDEX

Number of the port corresponding to the MAC address. Packets destined to this MAC address are sent out of this port. (Displayed as N/A for a blackhole MAC address entry).

AGING TIME(s)

Aging time:

  • AGING—The entry is aging.

  • NOAGED—The entry does not age.

1 mac address(es) found

One MAC address entry is found.