The mac-address blackhole command configures a blackhole MAC address entry.
The undo mac-address blackhole command deletes a blackhole MAC address entry.
By default, no blackhole MAC address entry is configured.
mac-address blackhole mac-address [ vlan vlan-id | vsi vsi-name ]
undo mac-address blackhole [ mac-address ] [ vlan vlan-id | vsi vsi-name ]
Parameter |
Description |
Value |
---|---|---|
mac-address |
Specifies the MAC address in a blackhole MAC address entry. |
The value is in H-H-H format. An H is a hexadecimal number of 1 to 4 digits. The MAC address cannot be FFFF-FFFF-FFFF, 0000-0000-0000, or a multicast MAC address. |
vlan vlan-id |
Specifies the VLAN ID in a blackhole MAC address entry. |
The value is an integer that ranges from 1 to 4094. |
vsi vsi-name |
Specifies the name of a VSI in a blackhole MAC address entry. The VSI must have been created. 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. |
- |
Usage Scenario
To protect a device or network against MAC address attacks, configure MAC addresses of untrusted users as blackhole MAC addresses. The device then directly discards the received packets of which the source or destination MAC addresses match the blackhole MAC address entries.
Prerequisites
The network administrator is familiar with the MAC addresses of all devices on the network. If the MAC address of an authorized user is configured as a blackhole MAC address, the user's communications will be interrupted.
Configuration Impact
If the source or destination MAC address of a packet matches a blackhole MAC address entry, the packet will be discarded. After being configured and saved, blackhole MAC address entries are not lost after the system reset.
Precautions
Unlike configuring a static MAC entry, you can configure a blackhole MAC entry without specifying an outbound interface.
If the specified VLAN is the control VLAN for Rapid Ring Protection Protocol (RRPP), the mac-address blackhole command cannot be run.
# Add a blackhole MAC address entry to the MAC address table. In the blackhole MAC address entry, the MAC address is 0004-0004-0004 and the VLAN ID is VLAN 5.
<HUAWEI> system-view [HUAWEI] vlan 5 [HUAWEI-vlan5] quit [HUAWEI] mac-address blackhole 0004-0004-0004 vlan 5
# Configure a global blackhole MAC address entry in which the MAC address is 0005-0005-0005.
<HUAWEI> system-view [HUAWEI] mac-address blackhole 0005-0005-0005
# Add a blackhole MAC address entry in which the MAC address is 0011-2233-4455 to VSI a2. The device directly discards the received frame in which the source or destination MAC address is 0011-2233-4455 and the VSI name is a2.
<HUAWEI> system-view [HUAWEI] mac-address blackhole 0011-2233-4455 vsi a2