display mac-address

Function

The display mac-address command displays information about MAC address entries.

Format

display mac-address { mac-address bridge-domain bd-id | bridge-domain bd-id } [ verbose ]

display mac-address blackhole bridge-domain bd-id [ verbose ]

display mac-address dynamic-blackhole bridge-domain bd-id [ verbose | last-change ]

display mac-address static { bridge-domain bd-id [ interface-type interface-number | interface-name ] | { interface-type interface-number | interface-name } bridge-domain bd-id } [ verbose ]

display mac-address dynamic [ ineffective ] { bridge-domain bd-id [ verbose | last-change ] | slot slot-id bridge-domain bd-id [ verbose | last-change ] }

display mac-address sticky [ bridge-domain bd-id ] [ verbose ]

Parameters

Parameter Description Value
interface-type

Specifies the interface type.

-

interface-number

Specifies the interface number.

-

interface-name

Specifies the interface name.

-

blackhole

Displays information about blackhole MAC address entries.

-

static

Displays information about static MAC address entries.

-

ineffective

Specifies the invalid MAC address.

-

last-change

Displays the time when dynamic MAC address entries are updated for the last time.

-

dynamic-blackhole

Displays information about dynamic blackhole MAC address entries.

-

sticky

Displays information about sticky MAC address entries.

-

mac-address

Specifies a MAC address.

The value is in the format of H-H-H. Each H is a hexadecimal number of 1 to 4 digits, such as 00e0 and fc01. If an H contains fewer than 4 digits, the left-most digits are padded with zeros. For example, e0 is displayed as 00e0. A MAC address cannot be set to all 0s or 1s.

bridge-domain bd-id

Displays MAC address entries in a bridge domain with a specified ID.

The value is an integer ranging from 1 to 16777215.

verbose

Displays detailed information about MAC address entries.

-

dynamic

Displays information about dynamic MAC address entries.

-

slot slot-id

Specifies the slot ID.

-

Views

All views

Default Level

1: Monitoring level

Task Name and Operations

Task Name Operations
mac read

Usage Guidelines

Usage Scenario

A MAC address table is a port-based Layer 2 forwarding table. It stores MAC addresses of other devices learned by a device, including MAC addresses and ports associated with the MAC addresses. When forwarding packets, the device searches the MAC address table for the outbound interface based on the destination MAC address in the packets to reduce the number of broadcast packets.

MAC address entries are classified into the following types:

  • Static MAC address entries: are manually configured. A static MAC address entry is used to forward packets with a specified destination MAC address through a specified interface, which prevents attacks using forged MAC addresses. Static MAC address entries will not be aged.
  • Dynamic MAC address entries: obtained by a device through source MAC address learning. A dynamic MAC address entry ages after a specified aging time elapses.
  • Static blackhole MAC address entries: manually configured by users. To prevent invalid MAC address entries (for example, MAC address entries of unauthorized users) from occupying the MAC address table and prevent hackers from attacking user devices or networks using MAC addresses, you can configure MAC addresses of untrusted users as static blackhole MAC addresses and discard packets destined for these MAC addresses. These address entries do not age out.
  • Dynamic blackhole MAC address entries: obtained by a device through source MAC address learning. To prevent frequent flapping of the MAC address table, you can configure the MAC address entry as a dynamic blackhole MAC address entry to block an interface and quickly eliminate loops. These address entries do not age out.

    To view information about all MAC address entries on the device, run the display mac-address command.
  • Sticky MAC address entries: are learned by a device based on source MAC addresses. Sticky MAC addresses can be aged out based on the aging time.

Example

The actual command output varies according to the device. The command output here is only an example.

# Display detailed information about MAC address entries in BD 100.
<HUAWEI> display mac-address bridge-domain 100 verbose
MAC address table of slot 9:
------------------------------------------------------------------------------------------------
MAC Address: 00e0-fc12-3456                              VLAN/BD/VSI/SI/EVPN: BD 100                    
Port       : GE0/1/1.1                                   Type               : dynamic                   
PEVLAN     : 100                                         CEVLAN             : -                         
TrustFlag  : -                                           TrustPort          : -                         
Peer IP    : -                                           VC-ID              : -                         
Aging time : 300                                         LSP/MAC_Tunnel     : 9/0                       
TimeStamp  : 5917                                      
MacAccountingEnable: Disable
MAC address used as destination:
Packet count : 1                                         Byte count : 128                                 
MAC address used as source:
Packet count : 2                                         Byte count : 256                                 
----------------------------------------------------------------------------------------------------------------------
Total matching items on slot 9 displayed = 1
# Display all MAC address entries.
<HUAWEI> display mac-address
MAC address table of slot 1:                                                                                                        
-------------------------------------------------------------------------------
MAC Address    VLAN/BD/    PEVLAN CEVLAN Port/Peerip     Type      LSP/LSR-ID
               VSI/SI/EVPN                                         MAC-Tunnel
-------------------------------------------------------------------------------
00e0-fc12-3456 6           -      -      -               blackhole -           
00e0-fc12-3457 7           -      -      -               blackhole -           
00e0-fc12-3457 8           -      -      -               blackhole -           
00e0-fc12-3457 9           -      -      -               blackhole -           
00e0-fc12-3457 10          -      -      -               blackhole -           
00e0-fc12-3457 11          -      -      -               blackhole -           
00e0-fc12-3457 12          -      -      -               blackhole -           
00e0-fc12-3457 54          -      -      GE0/1/1         static    -                                                                
00e0-fc12-3463 200         -      -      GE0/1/1         static    -                                                                
00e0-fc12-3462 v1          54     -      GE0/1/2.1       static    -                                                                
00e0-fc12-3461 vsa         3      4      GE0/1/2.1       static    -                                                                
00e0-fc12-3460 vsa         4094   4094   GE0/1/2.2       static    -                                                                
-------------------------------------------------------------------------------  
Total matching items on slot 1 displayed = 12
# Display dynamic black-hole MAC address entries.
<HUAWEI> display mac-address dynamic-blackhole bridge-domain 1
MAC address table of slot 1:
-------------------------------------------------------------------------------
MAC Address    VLAN/BD/    PEVLAN CEVLAN Port    Type           LSP/LSR-ID
               VSI/SI/EVPN                                      MAC-Tunnel
-------------------------------------------------------------------------------
00e0-fc12-3456 1           -      -      -       dyn-blackhole       -
-------------------------------------------------------------------------------
Total matching items on slot 1 displayed = 1
# Display sticky MAC address entries.
<HUAWEI> display mac-address sticky
MAC address table of slot 9:
----------------------------------------------------------------------------------------------------------------------
MAC Address    VLAN/BD/                        PEVLAN CEVLAN Port/Peerip                        Type      LSP/LSR-ID
               VSI/SI/EVPN                                                                                MAC-Tunnel
----------------------------------------------------------------------------------------------------------------------
00e0-fc12-3456 BD 10                           -      -      Eth-Trunk10.10                     sticky        9/16385     
00e0-fc12-3457 BD 10                           -      -      10.1.1.1                           sticky/static 9/-         
00e0-fc12-3456 BD 20                           20     -      Eth-Trunk10.20                     sticky        9/-         
00e0-fc12-3457 BD 20                           20     -      Eth-Trunk10.20                     sticky        9/-         
00e0-fc12-3460 BD 20                           20     -      Eth-Trunk10.20                     sticky        9/-         
00e0-fc12-3461 BD 20                           20     -      Eth-Trunk10.20                     sticky        9/-         
00e0-fc12-3462 BD 20                           20     -      Eth-Trunk10.20                     sticky        9/-         
----------------------------------------------------------------------------------------------------------------------
Total matching items on slot 9 displayed = 7
Table 1 Description of the display mac-address command output
Item Description
MAC address table of slot

Slot ID of the interface board that dynamically learns MAC addresses.

MAC Address

Learned MAC addresses.

MAC address used as destination/source

Traffic statistics are collected based on the destination or source MAC address.

Port

Outbound interface which sends packets to the MAC address.

Type

Type of the MAC address.

  • dyn-blackhole: indicates a dynamic blackhole MAC address.
  • static: indicates a static MAC address entry. MAC address entries are manually configured and will not be aged out. A blackhole MAC entry remains after the system is reset or a board is hot swapped.
  • blackhole: indicates a static blackhole MAC address entry, which is manually configured and will not be aged out. A blackhole MAC entry remains after the system is reset or a board is hot swapped.
  • dynamic: indicates a dynamic MAC address entry. A device learns source MAC addresses and ages out dynamic MAC address entries based on the aging time. A dynamic MAC entry is lost after the system is reset or a board is hot swapped.
  • sticky: indicates a dynamic MAC address entry with the sticky attribute. The device learns source MAC addresses and ages out the MAC address entry when the aging time expires. A dynamic MAC entry is lost after the system is reset or a board is hot swapped.
  • sticky/static: indicates the learned dynamic or static MAC address entries with the sticky attribute on the remote end.
PEVLAN

Single VLAN tag or outer VLAN tag. This field is meaningless on an EVPN and is always displayed as a hyphen (-).

CEVLAN

Inner VLAN tag carried in the packets received by the interface. On an EVPN, this item has no meaning and therefore is always displayed as a hyphen (-).

TrustFlag

Trust flag.

Peer IP

Peer IP address.

VC-ID

VC ID.

Aging time

Aging time of the MAC address entries.

LSP/MAC_Tunnel

-LSP: indicates the information about the board to which the MAC address belongs.

For example, 1 indicates that the MAC address is learned by the board in slot 1.

-MAC-Tunnel: indicates the name of a tunnel. This field exists in a MAC address entry for a specific SI.

Packet count

Number of packets received by an interface.

Byte count

Number of bytes received by the interface.

Byte count

Number of bytes received by the interface.

Total matching items on slot ID

Total number of MAC address entries that match specific rules.

Port/Peerip

Outbound interface or peer IP address mapped to a learned MAC address.

VLAN/BD/VSI/SI/EVPN

VLAN/BD/VSI/SI/EVPN to which the outbound interface belongs.

  • VLAN: ID of the VLAN to which the outbound interface belongs.
  • BD: ID of a BD to which an outbound interface belongs.
  • VSI: indicates the VSI to which the outbound interface belongs.
  • SI: indicates the SI to which the outbound interface belongs. EVPN: EVPN to which the outbound interface belongs.
LSP/LSR-ID/MAC-Tunnel
  • LSP: indicates the board to which the MAC address belongs.
  • LSR-ID: indicates the learning information allocated by the MAC address.

    For example, 1/- indicates that the MAC address belongs to the board in slot 1 and the allocated learning information is null.

  • MAC-Tunnel: indicates a tunnel name. This field exists in a MAC address entry for a specific SI.

    On an EVPN, this item has no meaning and therefore is always displayed as a hyphen (-).

MacAccountingEnable

Whether MAC accounting is enabled.

Last Change

Date and time when a dynamic MAC address entry was last updated.

Trustport

Trusted interface.

Timestamp

Timestamp.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >