The mac-address static command configures static MAC address entries for a VLAN to direct data forwarding.
The undo mac-address command deletes static MAC address entries for a VLAN.
The mac-address blackhole command configures a static blackhole MAC address entry.
The undo mac-address blackhole command deletes a static blackhole MAC address entry.
By default, no static MAC address entry for a VLAN is configured for the system, no blackhole MAC address entry is configured for the system.
mac-address static mac-address { interface-type interface-number | interface-name } { { vsi vsi-name [ pe-vid pe-vid [ ce-vid { ce-vid | any } ] ] } | { interface-type interface-number | interface-name } vsi vsi-name }
mac-address blackhole mac-address vsi vsi-name
mac-address blackhole mac-address vsi vsi-name vlan vlan-id
mac-address static mac-address { interface-type interface-number | interface-name } vsi vsi-name vlan vlan-id
mac-address static mac-address peer ip-address [ pw-id pw-id ] vsi vsi-name [ vlan vlan-id ]
undo mac-address [ static ] vsi vsi-name
undo mac-address mac-address vsi vsi-name
undo mac-address blackhole [ mac-address ] vsi vsi-name
undo mac-address static mac-address { interface-type interface-number | interface-name } { { vsi vsi-name [ pe-vid pe-vid [ ce-vid { ce-vid | any } ] ] } | { interface-type interface-number | interface-name } vsi vsi-name }
undo mac-address blackhole [ mac-address ] vsi vsi-name vlan vlan-id
undo mac-address [ static [ mac-address { interface-type interface-number | interface-name } ] | mac-address ] vsi vsi-name vlan vlan-id
undo mac-address static mac-address peer ip-address [ pw-id pw-id ] vsi vsi-name [ vlan vlan-id ]
Parameter | Description | Value |
---|---|---|
mac-address |
Specifies a destination MAC address. |
The value is a 12-digit hexadecimal number, in the format of H-H-H. Each H is 4 digits. 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 FFFF-FFFF-FFFF or a broadcast MAC. |
interface-type |
Specifies the type of a VLANIF interface. |
- |
interface-type |
Specifies the interface type. |
- |
interface-number |
Specifies the number of a VLANIF interface. |
- |
interface-number |
Specifies the interface number. |
- |
interface-name |
Specifies the name of a VLANIF interface. |
- |
interface-name |
Specifies the interface name. |
- |
vsi vsi-name |
Specifies static MAC address entries of a Virtual Switching Instance (VSI). |
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. |
pe-vid pe-vid |
Specifies the outer VLAN tag. |
The value is a decimal integer ranging from 1 to 4094. |
ce-vid ce-vid |
Specifies an inner VLAN tag. If pe-vid peVlan or ce-vid cevid is configured, the interface must be a sub-interface that is bound to the VSI and configured with QinQ termination. |
The value is a decimal integer ranging from 1 to 4094. |
any |
Specifies any VLAN. |
- |
vlan vlan-id |
Specifies a VLAN ID. |
The value is a decimal integer ranging from 1 to 4094. |
static |
Specifies the static MAC address entries. |
- |
peer ip-address |
Specifies an IP address for a remote VTEP. |
The value is in dotted decimal notation. |
pw-id pw-id |
Specifies the PW ID of the device on the other end of the PW that corresponds to the static MAC address. Virtual Private LAN Service (VPLS) is a point-to-multipoint L2VPN technology. A VPLS network consists of multiple VSIs connecting PEs. VSIs can map the physical links on a VPLS network to PWs. To correctly delete the MAC addresses learned on a VPLS network, you need to specify peer peer-ip and pw-id pwidNum. |
The value is a decimal integer ranging from 1 to 4294967295. |
Usage Scenario
Configuration Impact
After static MAC address entries are configured, when receiving a frame with a specific MAC address, a device directly forwards the frame through the corresponding outbound interface. Static MAC address entries will not be aged and they will not be lost after the system resets or the interface board is hot-swapped.
Precautions
Manually configured MAC address entries take precedence over automatically generated entries. Static and static blackhole MAC address entries that are configured by users will not be overwritten by dynamic MAC address entries. Dynamic MAC address entries, however, can be overwritten by static and blackhole MAC address entries.
The network administrator is familiar with the MAC addresses of the network devices that need to use static MAC address entries for communication; otherwise, the configuration will interrupt authorized users' communication.<HUAWEI> system-view [~HUAWEI] vlan 40 [*HUAWEI-vlan40] quit [*HUAWEI] interface GigabitEthernet 0/1/1 [*HUAWEI-GigabitEthernet0/1/1] portswitch [*HUAWEI-GigabitEthernet0/1/1] port trunk allow-pass vlan 40 [*HUAWEI-GigabitEthernet0/1/1] quit [*HUAWEI] mac-address static 1-1-1 GigabitEthernet 0/1/1 vlan 40
<HUAWEI> system-view [~HUAWEI] vlan 10 [*HUAWEI-vlan10] quit [*HUAWEI] vlan 20 [*HUAWEI-vlan20] quit [*HUAWEI] interface GigabitEthernet 0/1/3 [*HUAWEI-GigabitEthernet0/1/3] portswitch [*HUAWEI-GigabitEthernet0/1/3] port default vlan 10 [*HUAWEI-GigabitEthernet0/1/3] quit [*HUAWEI] interface GigabitEthernet 0/1/1 [*HUAWEI-GigabitEthernet0/1/1] portswitch [*HUAWEI-GigabitEthernet0/1/1] port trunk allow-pass vlan 20 [*HUAWEI-GigabitEthernet0/1/1] quit [*HUAWEI] mac-address static 00e0-fc12-3457 GigabitEthernet 0/1/3 vlan 10 [*HUAWEI] mac-address static 00e0-fc12-3456 GigabitEthernet 0/1/1 vlan 20