mac-address

Function

The mac-address command configures a MAC address for an interface.

The undo mac-address command restores the default MAC address of an interface.

By default, the MAC address of the interface is the system MAC address.

Format

mac-address mac-address

undo mac-address

Parameters

Parameter Description Value
mac-address

Specifies the MAC address of the interface.

The value is in the format of H-H-H. Each H is a 4-digit hexadecimal number, such as 00e0 or fc01. If an H contains less than four bits, 0 is padded ahead. For example, if e0 is entered, it is equal to 00e0. A MAC address cannot be set to all 0s or all 1s.

Views

100ge sub-interface view, 100GE interface view, 10GE sub-interface view, 10GE interface view, 200GE sub-interface view, 25GE sub-interface view, 25GE interface view, 400GE sub-interface view, 400GE interface view, 40GE sub-interface view, 40GE interface view, 50GE sub-interface view, 50GE interface view, Eth-Trunk sub-interface view, Eth-Trunk interface view, FlexE interface view, GE optical interface view, GE sub-interface view, GE interface view, GE electrical interface view, Global VE interface view, PW-VE interface view, VBDIF interface view, VE interface view, VLANIF interface view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
interface-mgr write

Usage Guidelines

Usage Scenario

To ensure the normal transmission of service data flows, run the mac-address command to configure the MAC address of the interface based on users' requirements.

Prerequisites

Run either of the following commands to configure the Ethernet sub-interface before running the mac-address command.

  • To configure the Ethernet sub-interface as a Dot1q sub-interface, run the vlan-type dot1q command.
  • To configure the Ethernet sub-interface as a Dot1q VLAN tag termination sub-interface, run the dot1q termination vid command.
  • To configure the Ethernet sub-interface as a QinQ VLAN tag termination sub-interface, run the qinq termination pe-vid ce-vid command.

Configuration Impact

After the MAC address of an interface is changed, the device sends gratuitous ARP packets to update the mapping relationship between MAC addresses and interfaces.

Example

# Configure a MAC address for Eth-Trunk 1.
<HUAWEI> system-view
[~HUAWEI] interface eth-trunk 1
[*HUAWEI-Eth-Trunk1] mac-address 00e0-fc12-3456
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >