![H3C S5120-SI Series Operation Manual Download Page 647](http://html2.mh-extra.com/html/h3c/s5120-si-series/s5120-si-series_operation-manual_3711174647.webp)
1-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
] ] [
vlan
vlan-id
] [
count
] ]
Display the aging timer for
dynamic MAC address entries
display mac-address
aging-time
Display MAC address statistics
display mac-address
statistics
Available in any view
MAC Address Table Configuration Example
Network requirements
z
A host with MAC address 000f-e235-dc71 and belonging to VLAN 1 is connected to
GigabitEthernet1/0/1 of the device. To prevent MAC address spoofing, add a static entry into the
MAC address table of the device for the host.
z
Another host with MAC address 000f-e235-abcd and belongs to VLAN 1. For security sake, add a
destination blackhole MAC address entry on the device to prevent the host from receiving packets.
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 igabitethernet1/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 GigabitEthernet1/0/1.
[Sysname] display mac-address interface igabitethernet1/0/1
MAC ADDR VLAN ID STATE PORT INDEX AGING TIME
000f-e235-dc71 1 Config static GigabitEthernet1/0/1 NOAGED
--- 1 mac address(es) found ---
# 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