6-6
Displaying and Maintaining MAC Address Tables
To do…
Use the command…
Remarks
Display MAC address table
information
display mac-address
[
mac
-
address
[
vlan
vlan-id
] | [ [
dynamic
|
static
] [
interface
interface-type interface-number
] |
blackhole
] [
vlan
vlan-id
] [
count
] ]
Available in any view
Display the aging timer for
dynamic MAC address entries
display mac-address aging-time
Available in any view
Display the system or interface
MAC address learning state
display mac-address mac-learning
[
interface
-
type interface
-
number
]
Available in any view
MAC Address Table Configuration Example
Network requirements
z
The MAC address of one host is 000f-e235-dc71 and belongs to VLAN 1. It is connected to
Ethernet 1/0/1 of the AP. To prevent MAC address spoofing, add a static entry into the MAC
address table of the AP for the host.
z
The MAC address of another host is 000f-e235-abcd and belongs to VLAN 1. Because this host
once behaved suspiciously on the network, you can add a destination blackhole MAC address
entry for the MAC address to drop all packets destined for the host for security sake.
z
Set the aging timer for dynamic MAC address entries to 500 seconds.
Configuration procedure
# Add a static MAC address entry.
<Sysname> system-view
[Sysname] mac-address static 000f-e235-dc71 interface ethernet 1/0/1 vlan 1
# Add a destination blackhole MAC address entry.
[Sysname] mac-address blackhole 000f-e235-abcd vlan 1
# Set the aging timer for dynamic MAC address entries to 500 seconds.
[Sysname] mac-address timer aging 500
# Display the MAC address entry for port Ethernet 1/0/1.
[Sysname] display mac-address interface ethernet 1/0/1
MAC ADDR VLAN ID STATE PORT INDEX AGING TIME
000f-e235-DC71 1 Config static Ethernet 1/0/1 NOAGED
# Display information about the destination blackhole MAC address table.
[Sysname] display mac-address blackhole
MAC ADDR VLAN ID STATE PORT INDEX AGING TIME
000f-e235-abcd 1 Blackhole N/A NOAGED
--- 1 mac address(es) found ---
# View the aging time of dynamic MAC address entries.
[Sysname] display mac-address aging-time
Mac address aging time: 500s