- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
04-MAC Address Table Commands | 50.39 KB |
Table of Contents
1 MAC Address Table Configuration Commands
MAC Address Table Configuration Commands
display mac-address aging-time
display mac-address mac-learning
mac-address mac-learning disable
l The models listed in this document are not applicable to all regions. Please consult your local sales office for the models applicable to your region.
l Support of the H3C WA series WLAN access points (APs) for commands may vary by AP model. For more information, see Feature Matrix.
l The interface types and the number of interfaces vary by AP model.
MAC Address Table Configuration Commands
display mac-address
Syntax
display mac-address [ mac-address [ vlan vlan-id ] | [ dynamic | static ] [ interface interface-type interface-number ] | blackhole ] [ vlan vlan-id ] [ count ] ]
View
Any view
Default Level
1: Monitor level
Parameters
blackhole: Displays blackhole MAC address entries. These entries do not age but you can add or remove them. The packets whose destination MAC addresses match blackhole MAC address entries are dropped.
vlan vlan-id: Displays MAC address entries of the specified VLAN, where vlan-id is in the range 1 to 4094.
count: Displays the number of MAC address entries specified by related parameters in the command. When this keyword is used, the command displays only the number of specified MAC address entries, rather than related information about these MAC address entries.
mac-address: Displays MAC address entries in a specified MAC address, in the format of H-H-H.
dynamic: Displays dynamic MAC address entries. Aging time is set for these entries.
static: Displays static MAC address entries. These entries do not age but you can add or remove them.
interface interface-type interface-number: Displays MAC address learning status of the specified interface. interface-type interface-number specifies an interface by its type and number.
Description
Use the display mac-address command to display information about the MAC address table.
If you execute this command without specifying any parameters, this command displays information of all MAC address entries on the AP.
If you execute this command using only the vlan keyword or the count keyword, or only these two keywords, the command output will include information of unicast MAC address entries as well as that of static multicast MAC address entries.
Related commands: mac-address and mac-address timer.
Examples
# Display the MAC address table entry for MAC address 000f-e201-0101.
<Sysname> display mac-address 000f-e201-0101
MAC ADDR VLAN ID STATE PORT INDEX AGING TIME
000f-e201-0101 1 Learned Ethernet1/0/1 AGING
--- 1 mac address(es) found ---
Table 1-1 display mac-address command output description
Field |
Description |
MAC ADDR |
MAC address |
VLAN ID |
ID of the VLAN to which the MAC address belongs |
STATE |
State of a MAC address entry, which can be one of the following: l Config static: static entry configured by the user manually l Config dynamic: dynamic entry configured by the user manually l Learned: entry learned by the AP l Blackhole: blackhole entry |
PORT INDEX |
Number of the port corresponding to the MAC address, that is, packets destined to this MAC address will be sent out from this port. (Displayed as N/A for a blackhole MAC address entry). |
AGING TIME |
Aging time, which could be: l AGING, indicates that the entry is aging. l NOAGED, indicates that the entry does not age. |
1 mac address(es) found |
One MAC address entry is found |
display mac-address aging-time
Syntax
display mac-address aging-time
View
Any view
Default Level
1: Monitor level
Parameters
None
Description
Use the display mac-address aging-time command to display the aging time of dynamic entries in the MAC address table.
Related commands: mac-address (system view), mac-address (Ethernet interface view/WLAN-BSS interface view), mac-address timer, and display mac-address.
Examples
# Display the aging time of dynamic entries in the MAC address table.
<Sysname> display mac-address aging-time
Mac address aging time: 300s
The above information indicates that the aging time of dynamic entries in the MAC address table is 300 seconds.
display mac-address mac-learning
Syntax
display mac-address mac-learning [ interface-type interface-number ]
View
Any view
Default Level
1: Monitor level
Parameters
interface-type interface-number: Specifies an interface by its type and number. Displays MAC address learning status of the specified interface.
Description
Use the display mac-address mac-learning command to display MAC address learning status of the specified or all Ethernet ports.
Examples
# Display MAC address learning status of all Ethernet ports.
<Sysname> display mac-address mac-learning
Mac address learning status of the switch: enable
PortName Learning Status
Ethernet1/0/1 enable
Ethernet1/0/2 disable
Table 1-2 display mac-address mac-learning command output description
Field |
Description |
Mac-address learning status of the switch |
Global MAC address learning status, enabled or disabled |
PortName |
Port name |
Learning Status |
MAC address learning status for a port, enabled or disabled |
mac-address (Interface view)
Syntax
mac-address { dynamic | static } mac-address vlan vlan-id
undo mac-address { dynamic | static } mac-address vlan vlan-id
View
Ethernet interface view, WLAN-BSS interface view
Default Level
2: System level
Parameters
dynamic: Dynamic MAC address entries. Aging time is set for these entries.
static: Static MAC address entries. They do not age but you can add or remove them.
mac-address: Specifies a MAC address in the format of H-H-H, where 0s at the beginning of each H (16-bit hexadecimal digit) can be omitted; for example, inputting “f-e2-1” indicates that the MAC address is “000f-00e2-0001”.
vlan vlan-id: Specifies the VLAN to which the Ethernet interface belongs, where vlan-id is the specified VLAN ID, in the range 1 to 4094. The VLAN must already exist.
Description
Use the mac-address command to add or modify a MAC address entry on a specified Ethernet port.
Use the undo mac-address command to remove a MAC address entry on the Ethernet port.
Because MAC address entry configuration cannot survive a reboot, save it after completing the configuration. The dynamic MAC address table entries however will be lost whether you save the configuration or not.
Related commands: display mac-address.
Examples
# Add a static entry for MAC address 000f-e201-0101 on Ethernet 1/0/1 which belongs to VLAN 2.
<Sysname> system-view
[Sysname] interface ethernet 1/0/1
[Sysname-Ethernet1/0/1] mac-address static 000f-e201-0101 vlan 2
mac-address (system view)
Syntax
mac-address blackhole mac-address vlan vlan-id
mac-address { dynamic | static } mac-address interface interface-type interface-number vlan vlan-id
undo mac-address [ { dynamic | static } mac-address interface interface-type interface-number vlan vlan-id ]
undo mac-address [ blackhole | dynamic | static ] [ mac-address ] vlan vlan-id
undo mac-address [ dynamic | static ] mac-address interface interface-type interface-number vlan vlan-id
undo mac-address [ dynamic | static ] interface interface-type interface-number
View
System view
Default Level
2: System level
Parameters
blackhole: Blackhole MAC address entries. These entries do not age but you can add or remove them. The packets whose destination MAC addresses match blackhole MAC address entries are dropped.
mac-address: Specifies a MAC address in the format of H-H-H, where 0s at the beginning of each H (16-bit hexadecimal digit) can be omitted; for example, inputting “f-e2-1” indicates that the MAC address is “000f-00e2-0001”.
vlan vlan-id: Specifies the VLAN to which the Ethernet interface belongs, where vlan-id is the specified VLAN ID, in the range 1 to 4094. The VLAN must already exist.
dynamic: Dynamic MAC address entries. Aging time is set for these entries.
static: Static MAC address entries. These entries do not age but you can add or remove them.
interface interface-type interface-number: Outbound interface, with interface-type interface-number representing the interface type and number.
Description
Use the mac-address command to add or modify a MAC address entry.
Use the undo mac-address command to remove one or all MAC address entries.
A static or blackhole MAC address entry will not be overwritten by a dynamic MAC address entry, but a dynamic MAC address entry can be overwritten by a static or blackhole MAC address entry.
If you execute the undo mac-address command without specifying any parameters, this command deletes all unicast MAC address entries.
You can delete all the MAC address entries of a VLAN, or you can choose to delete its dynamic, static, or blackhole MAC address entries only. You can also single out some ports and delete their unicast MAC address entries.
Because your MAC address entries configuration cannot survive a reboot, save it after completing the configuration. The dynamic entries however will be lost whether you save the configuration or not.
Related commands: display mac-address.
Examples
# Add a static entry for MAC address 000f-e201-0101. All frames destined to this MAC address are sent out of Ethernet 1/0/1, which belongs to VLAN 2.
<Sysname> system-view
[Sysname] mac-address static 000f-e201-0101 interface ethernet 1/0/1 vlan 2
mac-address mac-learning disable
Syntax
mac-address mac-learning disable
undo mac-address mac-learning disable
View
System view, Ethernet interface view, WLAN-BSS interface view
Default Level
2: System level
Parameters
None
Description
Use the mac-address mac-learning disable command to disable MAC address learning globally, on one or a group of Ethernet ports, depending on the view you entered.
Use the undo mac-address mac-learning disable command to enable MAC address learning globally, on one or a group of Ethernet ports, depending on the view you entered.
By default, MAC address learning is enabled.
You may need to disable MAC address learning sometimes to prevent the MAC address table from being saturated, for example, when your AP is being attacked by a large amount of packets with different source MAC addresses. This somewhat affects update of the MAC address table.
Because disabling MAC address learning may result in broadcast storms, you must enable broadcast storm suppression after you disable MAC address learning on a port.
Related commands: display mac-address mac-learning.
Examples
# Disable global MAC address learning.
<Sysname> system-view
[Sysname] mac-address mac-learning disable
# Disable MAC address learning on port Ethernet 1/0/1.
<Sysname> system-view
[Sysname] interface ethernet 1/0/1
[Sysname-Ethernet1/0/1] mac-address mac-learning disable
mac-address max-mac-count
Syntax
mac-address max-mac-count { count | disable-forwarding }
undo mac-address max-mac-count [ disable-forwarding ]
View
Ethernet interface view, WLAN-BSS interface view
Default Level
2: System level
Parameters
count: Maximum number of MAC addresses that can be learned on a port (that is, the MAC learning limit on a port), in the range 0 to 256. When the argument takes 0, the port is not allowed to learn MAC addresses.
disable-forwarding: Disables forwarding of frames with unknown source MAC addresses after the MAC learning limit is reached. Frames whose source MAC addresses are in the MAC address table can be forwarded normally.
Description
Use the mac-address max-mac-count count command to configure the MAC learning limit on a port.
Use the mac-address max-mac-count disable-forwarding command to configure whether forwarding frames with unknown source MAC addresses is allowed after the MAC learning limit is reached.
Use the undo mac-address max-mac-count command to restore the default MAC learning limit on a port.
Use the undo mac-address max-mac-count disable-forwarding command to allow forwarding frames received on a port with unknown source MAC addresses after the MAC learning limit is reached.
The default MAC learning limit on a port depends on your AP model. When the MAC learning limit is reached, frames received with unknown source MAC addresses on a port are forwarded by default.
Related commands: mac-address (system view), mac-address (Interface view), and mac-address timer.
Examples
# Set the MAC learning limit on Ethernet 1/0/1 to 200. After this MAC learning limit is reached, frames received with unknown source MAC addresses on the port will not be forwarded.
[Sysname] interface ethernet 1/0/1
[Sysname-Ethernet1/0/1] mac-address max-mac-count 200
[Sysname-Ethernet1/0/1] mac-address max-mac-count disable-forwarding
mac-address timer
Syntax
mac-address timer { aging seconds | no-aging }
undo mac-address timer aging
View
System view
Default Level
2: System level
Parameters
aging seconds: Sets an aging timer in seconds for dynamic MAC address entries.
no-aging: Sets dynamic MAC address entries not to age.
Description
Use the mac-address timer command to configure the aging timer for dynamic MAC address entries.
Use the undo mac-address timer command to restore the default.
By default the seconds argument ranges from 10 to 630 and defaults to 300.
Set the aging timer appropriately: a long aging interval may cause the MAC address table to retain outdated entries and fail to accommodate the latest network changes, while a short interval may result in removal of valid entries and hence unnecessary broadcasts, which may impact the performance of your AP.
Examples
# Set the aging timer for dynamic MAC address entries to 500 seconds.
<Sysname> system-view
[Sysname] mac-address timer aging 500