64
vlan
vlan
-
id
: Specifies an existing VLAN to which the Ethernet interface belongs, in the range of 1 to
4094.
dynamic
: Specifies dynamic MAC address entries, which can be aged.
static
: Specifies static MAC address entries. These entries do not age, but you can add or remove them.
interface
interface
-
type interface
-
number
: Specifies an outbound interface by its type and number.
Usage guidelines
A static or destination blackhole MAC address entry will not be overwritten by a dynamic MAC address
entry. A dynamic MAC address entry can be overwritten by a static or destination blackhole MAC
address entry.
If you execute the
undo mac-address
command without specifying any parameters, this command
deletes all MAC address entries.
You can delete all the MAC address entries of a VLAN. Also, you can choose to delete a specific type
(dynamic, static, or destination blackhole) of MAC address entries only.
The MAC address entries configuration cannot survive a reboot unless you save it. However, the dynamic
MAC address entries are lost at next reboot regardless of whether you save the configuration or not.
Examples
# Add a static entry for MAC address 000f-e201-0101. All frames destined to this MAC address are sent
out of Ten-GigabitEthernet 1/0/1 that belongs to VLAN 2.
<Sysname> system-view
[Sysname] mac-address static 000f-e201-0101 interface Ten-GigabitEthernet 1/0/1 vlan 2
Related commands
display mac-address
mac-address mac-learning disable
Use
mac-address mac-learning disable
to disable MAC address learning globally or on a Layer 2
Ethernet interface.
Use
undo mac-address mac-learning disable
to enable MAC address learning globally or on a Layer 2
Ethernet interface.
Syntax
mac-address mac-learning disable
undo mac-address mac-learning disable
Default
MAC address learning is enabled.
Views
System view, Layer 2 Ethernet interface view, port group view, Layer 2 aggregate interface view
Default command level
2: System level
Usage guidelines
Follow these guidelines when you configure MAC address learning: