The mac-address static vlan command configures a static MAC address entry.
The undo mac-address static vlan command deletes a static MAC address entry.
By default, no static MAC address entry is configured.
mac-address static mac-address interface-type interface-number vlan vlan-id
undo mac-address static [ interface-type interface-number | vlan vlan-id ] *
undo mac-address static mac-address interface-type interface-number vlan vlan-id
For details on how to configure a VSI-based static MAC address entry, see mac-address static vlanif and mac-address static vsi.
Parameter |
Description |
Value |
---|---|---|
mac-address |
Specifies the MAC address in a static 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. |
interface-type interface-number |
Specifies the outbound interface in a static MAC address entry. |
- |
vlan vlan-id |
Specifies the ID of the VLAN that the outbound interface belongs to. |
The value is an integer that ranges from 1 to 4094. |
Usage Scenario
Precautions
# Add a static MAC address entry to the MAC address table. In the MAC address entry, the destination MAC address is 0003-0003-0003, the VLAN ID is 4, and the outbound interface is gigabitethernet0/0/2. That is, the device forwards packets with the destination MAC address of 0003-0003-0003 from VLAN 4 through gigabitethernet0/0/2.
<HUAWEI> system-view [HUAWEI] vlan 4 [HUAWEI-vlan4] quit [HUAWEI] interface gigabitethernet 0/0/2 [HUAWEI-GigabitEthernet0/0/2] port link-type access [HUAWEI-GigabitEthernet0/0/2] port default vlan 4 [HUAWEI-GigabitEthernet0/0/2] quit [HUAWEI] mac-address static 0003-0003-0003 gigabitethernet 0/0/2 vlan 4