- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
03-MAC Address Table Commands | 101.90 KB |
MAC address table configuration commands
display mac-address aging-time
display mac-address statistics
mac-address max-mac-count (interface view)
The term "switch" or "device" in this document refers to the switching engine on a WX3000E wireless switch.
The WX3000E series comprises WX3024E and WX3010E wireless switches.
The port numbers in this document are for illustration only.
The MAC address table can contain only Layer 2 Ethernet ports, and Layer 2 aggregate interfaces.
display mac-address
Syntax
display mac-address [ mac-address [ vlan vlan-id ] | [ [ dynamic | static ] [ interface interface-type interface-number ] | blackhole ] [ vlan vlan-id ] [ count ] ] [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
blackhole: Displays destination blackhole MAC address entries. These entries do not age, but you can add or remove them. Packets whose destination MAC addresses match destination blackhole MAC address entries are dropped.
vlan vlan-id: Displays MAC address entries of the specified VLAN, where vlan-id ranges from 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 of 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. Similar to blackhole MAC address entries, these entries do not age, but you can add or remove them.
interface interface-type interface-number: Displays the MAC address learning status of the specified interface. interface-type interface-number specifies an interface by its type and number.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see the Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, which is a case sensitive string of 1 to 256 characters.
Description
Use the display mac-address command to display information about the MAC address table.
If you execute this command without specifying any parameters, it displays information of all MAC address entries on the device, including unicast MAC address entries and static multicast MAC address entries.
If you execute this command using only the vlan keyword or the count keyword, or only these two keywords, it displays information of unicast MAC address entries and static multicast MAC address entries.
Related commands: mac-address (system view), mac-address (interface view), 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 GigabitEthernet1/0/1 AGING
--- 1 mac address(es) found ---
Table 1 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: · Config static—The static entry manually configured by the user. · Config dynamic—The dynamic entry manually configured by the user. · Learned—The entry learned by the device. · Blackhole—The destination blackhole entry. |
PORT INDEX |
Number of the port corresponding to the MAC address. Packets destined to this MAC address are sent out this port. (Displayed as N/A for a blackhole MAC address entry). |
AGING TIME(s) |
Aging time: · AGING—The entry is aging. · NOAGED—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 [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular expressions, see the Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, which is a case sensitive string of 1 to 256 characters.
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 (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 output indicates that the aging time of dynamic entries in the MAC address table is 300 seconds.
display mac-address multicast
Syntax
display mac-address [ mac-address [ vlan vlan-id ] | [ multicast ] [ vlan vlan-id ] [ count ] ] [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
mac-address: Displays the multicast MAC address entry for the specified MAC address. The MAC address can be any legal multicast MAC address except 0100-5Exx-xxxx and 3333-xxxx-xxxx, where x represents an arbitrary hexadecimal number from 0 to F.
vlan vlan-id: Displays multicast MAC address entries for the specified VLAN, where vlan-id is in the range of 1 to 4094. If you do not specify a VLAN, this command will display the static multicast MAC address entries for all VLANs.
multicast: Displays static multicast MAC address entries.
count: Displays the number of matched static multicast MAC address entries. With this argument specified, the number of matched static multicast MAC address entries is displayed, without displaying any content of the matched entries.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see the Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, which is a case-sensitive string of 1 to 256 characters.
Description
Use the display mac-address multicast command to display the static multicast MAC address entries.
With no parameters specified or with only vlan, count, or both of them specified, this command displays all MAC address table entries, including static multicast MAC address entries and unicast MAC address entries.
Related commands: mac-address multicast; display mac-address.
Examples
# Display the static multicast MAC address entries for VLAN 2.
<Sysname> display mac-address multicast vlan 2
MAC ADDR VLAN ID STATE PORT INDEX AGING TIME(s)
0100-0001-0001 2 Multicast GigabitEthernet1/0/1 NOAGED
GigabitEthernet1/0/2
GigabitEthernet1/0/3
GigabitEthernet1/0/4
--- 1 mac address(es) found ---
Table 2 Output description
Field |
Description |
MAC ADDR |
MAC address |
VLAN ID |
ID of the VLAN to which the network device identified by the MAC address belongs |
STATE |
Status of the MAC address; multicast indicates a static multicast MAC address entry |
PORT INDEX |
Outgoing ports of the multicast MAC address entry |
AGING TIME(s) |
State of the aging timer. The aging timer for static multicast MAC addresses has only one state NOAGED, which indicates that this entry never expires |
1 mac address(es) found |
One static multicast MAC address entry is found. |
display mac-address statistics
Syntax
display mac-address statistics [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular expressions, see the Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, which is a case sensitive string of 1 to 256 characters.
Description
Use the display mac-address statistics command to display the statistics of the MAC address table.
Examples
# Display the statistics of the MAC address table.
<Sysname> display mac-address statistics
MAC TYPE LEARNED USER-DEFINED SYSTEM-DEFINED IN-USE AVAILABLE
Dynamic Unicast 27 0 0 27
Static Unicast 0 0 0 0 1024
Total Unicast 27 8192
Dynamic Multicast 0 0 0 0
Static Multicast 0 0 0 0 12
Total Multicast 0 0
Table 3 Output description
Field |
Description |
MAC TYPE |
MAC address type: · Dynamic Unicast · Static Unicast · Total Unicast · Dynamic Multicast · Static Multicast · Total Multicast |
LEARNED |
Dynamically learned MAC addresses |
USER-DEFINED |
User defined MAC addresses (dynamic and static) |
SYSTEM-DEFINED |
MAC addresses generated by the system (for example, 802.1x and MAC authentication) |
IN-USE |
Number of existing MAC addresses of a specific type |
AVAILABLE |
Maximum number of MAC addresses supported by the system |
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
Layer 2 Ethernet interface view, Layer 2 aggregate interface view
Default level
2: System level
Parameters
dynamic: Specifies dynamic MAC address entries. These entries can age.
static: Specifies 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 an existing VLAN to which the Ethernet interface belongs, where vlan-id is the specified VLAN ID, ranging from 1 to 4094.
Description
Use the mac-address command to add or modify a MAC address entry on a specified interface.
Use the undo mac-address command to remove a MAC address entry on the interface.
The MAC address entries configuration cannot survive a reboot unless you save it. The dynamic MAC address table entries, however, are lost at next reboot whether or not you save the configuration.
Related commands: display mac-address.
Examples
# Add a static entry for MAC address 000f-e201-0101 on port GigabitEthernet 1/0/1 that belongs to VLAN 2.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] mac-address static 000f-e201-0101 vlan 2
# Add a static entry for MAC address 000f-e201-0102 on port Bridge-Aggregation 1 that belongs to VLAN 1.
<Sysname> system-view
[Sysname] interface bridge-aggregation 1
[Sysname-Bridge-Aggregation1] mac-address static 000f-e201-0102 vlan 1
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: Specifies destination blackhole MAC address entries. These entries do not age, but you can add or remove them. The packets whose destination MAC addresses match destination 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 an existing VLAN to which the Ethernet interface belongs, where vlan-id is the specified VLAN ID, ranging from 1 to 4094.
dynamic: Specifies dynamic MAC address entries. These entries can age.
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.
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. 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 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 a VLAN, or you can choose to delete a specific type (dynamic, static, or blackhole) of MAC address entries only. You can single out certain ports and delete the corresponding unicast MAC address entries, but not the corresponding static multicast MAC address entries.
The MAC address entries configuration cannot survive a reboot unless you save it. The dynamic MAC address table entries, however, are lost at next reboot whether or not you save the configuration.
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 port 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
mac-address max-mac-count (interface view)
Syntax
mac-address max-mac-count count
undo mac-address max-mac-count
View
Layer 2 Ethernet interface view, port group view, Layer 2 aggregate interface view
Default level
2: System level
Parameters
count: Specifies the maximum number of MAC addresses that can be learned on a port, ranges from 0 to 8192. When the argument takes 0, the VLAN is not allowed to learn MAC addresses.
Description
Use the mac-address max-mac-count count command to configure the maximum number of MAC addresses that can be learned on a port.
Use the undo mac-address max-mac-count command to restore the default maximum number of MAC addresses that can be learned on an Ethernet port.
By default, no MAC learning limit is configured for an Ethernet port or port group.
If the command is executed in interface view, the configuration takes effect on the interface. If the command is executed in port group view, the configuration takes effect on all ports belonging to the port group.
Related commands: mac-address and mac-address timer.
Examples
# Set the maximum number of MAC addresses that can be learned on port GigabitEthernet 1/0/1 to 600.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] mac-address max-mac-count 600
mac-address multicast
Syntax
In system view:
mac-address multicast mac-address interface interface-list vlan vlan-id
undo mac-address [ multicast ] [ [ mac-address [ interface interface-list ] ] vlan vlan-id ]
In Ethernet interface view or Layer 2 aggregate interface view:
mac-address multicast mac-address vlan vlan-id
undo mac-address [ multicast ] mac-address vlan vlan-id
In port group view:
mac-address multicast mac-address vlan vlan-id
undo mac-address multicast mac-address vlan vlan-id
View
System view, Ethernet interface view, Layer 2 aggregate interface view, port group view
Default level
2: System level
Parameters
mac-address: Static multicast MAC address, which can be any legal multicast MAC address except 0100-5Exx-xxxx and 3333-xxxx-xxxx, where x represents an arbitrary hexadecimal number from 0 to F. Multicast MAC addresses are the MAC addresses whose the least signification bit of the most significant octet is 1. The system will give a prompt if the configured static multicast MAC address conflicts with the MAC address of other protocols.
interface-list: Specifies a list of interfaces. You can specify up to 4 single interfaces, interface ranges, or combinations of both for the list. A single interface takes the form of interface-type interface-number. An interface range takes the form of interface-type interface-number to interface-type interface-number, where the end interface number must be greater than the start interface number.
vlan vlan-id: Specifies the VLAN to which the interface belongs. vlan-id is in the range of 1 to 4094. The specified VLAN must exist and the system gives a prompt if the specified interface does not belong to the VLAN.
Description
Use the mac-address multicast command to configure a static multicast MAC address entry.
Use the undo mac-address multicast command to delete a static multicast MAC address entry.
By default, no static multicast MAC address entry is configured.
If multicast is not specified when using the undo mac-address multicast command, all MAC address entries including static multicast MAC address entries and unicast MAC address entries will be deleted.
Related commands: display mac-address multicast; mac-address.
Examples
# Configure a static multicast MAC address entry with the MAC address of 0100-0001-0001 and outgoing interfaces GigabitEthernet 1/0/1 through GigabitEthernet 1/0/5 in VLAN 2.
<Sysname> system-view
[Sysname] mac-address multicast 0100-0001-0001 interface gigabitethernet 1/0/1 to gigabitethernet 1/0/5 vlan 2
# Configure a static multicast MAC address entry with the MAC address of 0100-0001-0001 in interface view of GigabitEthernet 1/0/1 in VLAN 2.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] mac-address multicast 0100-0001-0001 vlan 2
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, where seconds ranges from 10 to 630.
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 aging timer is 300 seconds.
Follow these guidelines to 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.
· A short aging interval may result in removal of valid entries and unnecessary broadcasts that may affect device performance.
Examples
# Set the aging timer for dynamic MAC address entries to 500 seconds.
<Sysname> system-view
[Sysname] mac-address timer aging 500