64
an entry. When you execute the command again with the same MAC address and VLAN but
with different interfaces, this command adds the specified interfaces for this entry.
A static or blackhole entry can overwrite a dynamic entry, but not vice versa.
If you execute the
undo mac-address command without specifying any parameters, this
command deletes all unicast MAC address entries and static multicast MAC address entries.
You can delete all the MAC address entries (including unicast MAC address entries and static
multicast MAC address entries) of the specified VLAN. You can also delete only one type (dynamic,
static, blackhole, or multiport unicast) of MAC address entries. You can single out an interface and
delete the corresponding unicast MAC address entries, but not the corresponding static multicast
MAC address entries.
The MAC address entry configuration cannot survive a reboot unless you save it. The dynamic MAC
address entries, however, are lost upon reboot whether or not you save the configuration.
Examples
# Add a static entry for MAC address 000f-e201-0101. Then, all frames that are destined for this
MAC address are sent out of GigabitEthernet 1/0/1, which belongs to VLAN 2.
<Sysname> system-view
[Sysname] mac-address static 000f-e201-0101 interface gigabitethernet 1/0/1 vlan 2
# Add a multiport unicast MAC address entry for MAC address 000f-e201-0101. Then, all frames that
are destined for this MAC address are sent out of GigabitEthernet 1/0/1 through GigabitEthernet
1/0/3, which belong to VLAN 2.
<Sysname> system-view
[Sysname] mac-address multiport 000f-e201-0101 interface gigabitethernet 1/0/1 to
gigabitethernet 1/0/3 vlan 2
Related commands
display mac-address
mac-address (interface view)
mac-address mac-learning enable
Use mac-address mac-learning enable to enable MAC address learning globally, on an
interface, or on a VLAN.
Use
undo mac-address mac-learning enable to disable MAC address learning globally, on
an interface, or on a VLAN.
Syntax
mac-address mac-learning enable
undo mac-address mac-learning enable
Default
MAC address learning is enabled.
Views
System view
Layer 2 Ethernet interface view
Layer 2 aggregate interface view
VLAN view