< Home

undo mac-address

Function

The undo mac-address command deletes one or more MAC address entries.

Format

undo mac-address [ all | dynamic ] [ interface-type interface-number | vlan vlan-id ] *

undo mac-address { all | dynamic } [ vsi vsi-name ]

undo mac-address mac-address [ vlan vlan-id | vsi vsi-name ]

Parameters

Parameter

Description

Value

mac-address

Specifies the MAC address in a MAC address entry to be deleted.

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 interface in a MAC address entry to be deleted.

-

vlan vlan-id

Specifies the VLAN ID in a MAC address entry to be deleted.

The value is an integer that ranges from 1 to 4094.

all

Specifies that all MAC address entries excluding DHCP sticky MAC address entries and NAC MAC address entries are deleted.

-

vsi vsi-name

Specifies the name of a VSI. 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.

-

dynamic

Deletes dynamic MAC address entries, that is, MAC address entries learned by an interface.

-

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

A MAC address table saves a limited number of MAC addresses. If the MAC address table is full, the device cannot learn new MAC address entries until old MAC addresses are aged out. Packets matching no MAC address entry are broadcast, wasting bandwidth resources. This command can delete useless MAC address entries to release the MAC address table space.

You can delete some of MAC address entries as required. For example:
  • If you do not specify interface-type interface-number, the command deletes MAC address entries of the specified type on all interfaces.
  • If you do not specify vlan vlan-id, the command deletes MAC address entries of the specified type in all VLANs.

Precautions

If port security and NAC authentication are enabled on an interface and a user is successfully authenticated on the interface and connects to the network, the undo mac-address command cannot delete MAC address entries of the user. For the S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-HI, S6730-H, S6730S-H, S6730-S, and S6730S-S, if authentication mode is used to set the user access mode to multi-share, the undo mac-address command can delete MAC address entries of the user.

Example

# Delete all MAC address entries.

<HUAWEI> system-view
[HUAWEI] undo mac-address all

# Delete all dynamic MAC address entries.

<HUAWEI> system-view
[HUAWEI] undo mac-address dynamic

# Delete all MAC address entries on gigabitethernet0/0/1.

<HUAWEI> system-view
[HUAWEI] undo mac-address gigabitethernet 0/0/1

# Delete all MAC address entries in VLAN 5.

<HUAWEI> system-view
[HUAWEI] undo mac-address vlan 5

# Delete all dynamic MAC address entries in the VSI a2.

<HUAWEI> system-view
[HUAWEI] undo mac-address dynamic vsi a2

# Delete all MAC address entries in which the MAC address is 0004-0004-0004.

<HUAWEI> system-view
[HUAWEI] undo mac-address 0004-0004-0004
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >