This chapter
describes the management of static and dynamic MAC address entries. For
information on the management of multicast MAC address entries, refer to the
section related to multicast protocol in H3C S7500 Series Ethernet Switches
Command Manual.
Syntax
bridgemactocpu { enable | disable }
View
System view
Parameter
enable:
Enables the packets to be passed to the CPU for processing.
disable:
Disables the packets from being passed to the CPU for processing.
Description
Use the bridgemactocpu command to
set whether the packets with destination MAC address as the bridge MAC address
of the switch will be passed to the CPU for processing.
By default, the packets with destination
MAC address as the bridge MAC address of the switch are not passed to the CPU
for processing.
Example
# Enable the packets with destination MAC
address as the bridge MAC address of the switch to be passed to the CPU for
processing.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] bridgemactocpu enable
Syntax
display mac-address aging-time
View
Any view
Parameter
None
Description
Use the display mac-address aging-time
command to display the aging time for the dynamic MAC address entries in the
MAC address table.
Related command: mac-address,
mac-address timer, display mac-address.
Example
# Display the aging time for the dynamic
MAC address entries.
<H3C> display mac-address
aging-time
Mac address aging time: 300s
The output information indicates that the
aging time for the dynamic MAC address entries is 300 seconds.
<H3C> display mac-address aging-time
Mac address aging time: no-aging
The output information indicates that
dynamic MAC address entries do not age out.
Syntax
display mac-address [ display-option ]
View
Any view
Parameter
display-option: Option used to display specific MAC address table information, as
described in Table 1-1.
Table 1-1 Description on the display-option
argument
|
Value
|
Description
|
|
mac-address [ vlan vlan-id ]
|
Displays information about a specified
MAC address entry.
|
|
{ static | dynamic } [ interface
interface-type interface-number ] [ vlan vlan-id ] [ count
]
|
Displays information about dynamic or
static address entries.
|
|
interface interface-type
interface-number [ vlan vlan-id ] [ count ]
|
Displays information about the MAC
address entries concerning a specified port.
|
|
vlan vlan-id
[ count ]
|
Displays information about the MAC
address entries concerning a specified VLAN.
|
|
count
|
Displays the total number of the MAC
address entries maintained by the switch.
|
mac-address:
MAC address.
static:
Displays static MAC address entries. (A static MAC address entry does not age
out.)
dynamic:
Displays dynamic MAC address entries. (A dynamic MAC address entry ages with
time.)
interface-type:
Port type.
interface-number: Port number.
vlan-id:
VLAN ID. This argument ranges from 1 to 4,094.
count:
Displays only the total number of the MAC address entries.
Description
Use the display mac-address
command to display information about MAC address entries in a MAC address
table, including: MAC address, VLAN and port corresponding to the MAC address,
the type (static or dynamic) of a MAC address entry, and aging time.
Example
# Display the information about the MAC
address 00e0-fc01-0101.
<H3C> display mac-address
00e0-fc01-0101
MAC ADDR VLAN ID
STATE PORT INDEX AGING TIME(s)
0014-222c-9d6a 1
Learned Ethernet3/0/11 267
# Display the MAC address entries for the
port Ethernet1/0/4.
<H3C> display mac-address
interface Ethernet 1/0/4
MAC ADDR VLAN ID
STATE PORT INDEX AGING TIME(s)
00e0-0112-9a86 2 Config
static Ethernet3/0/11 NOAGED
000c-760a-172d 1
Learned Ethernet1/0/4 240
000d-88f6-44c1 1
Learned Ethernet1/0/4 278
000d-88f7-9f7d 1
Learned Ethernet1/0/4 278
000d-88f7-b090 1
Learned Ethernet1/0/4 128
000d-88f7-b094 1
Learned Ethernet1/0/4 278
000d-88f8-4e88 1
Learned Ethernet1/0/4 203
--- 7 mac address(es) found on port
Ethernet1/0/4 ---
# Display the total number of MAC address
entries found in VLAN 2.
<H3C> display mac-address vlan
2 count
9 mac address(es) found in vlan 2
Table 1-2 Description
on the fields of the display mac-address command
|
Field
|
Description
|
|
MAC ADDR
|
MAC address
|
|
VLAN ID
|
ID of the VLAN to which the network
device identified by the MAC address belongs
|
|
STATE
|
The state of the MAC address. The value
of this field can be “Static”, “Learned”, and so on.
|
|
PORT INDEX
|
Port index
|
|
AGING TIME(s)
|
Indicates whether a MAC address entry is
aging
|
Syntax
mac-address {
static | dynamic } mac-address interface
interface-type interface-number vlan vlan-id
undo mac-address [ mac-address-attribute ]
View
System view, port view
Parameter
static:
Specifies that the MAC address entry to be added/updated is static.
dynamic:
Specifies that the MAC address entry to be added/updated is dynamic.
mac-address:
MAC address.
interface-type:
Port type.
interface-number: Port number.
vlan-id:
VLAN ID. This argument ranges from 1 to 4,094.
mac-address-attribute: String used to specify the MAC address entries to be removed, as
described in Table 1-3.
Table 1-3 Description on the mac-address-attribute
argument
|
Value
|
Description
|
|
{ static | dynamic }
interface interface-type interface-number
|
Removes the static or dynamic MAC address
entries concerning a specified port.
|
|
{ static | dynamic }
vlan vlan-id
|
Removes the static or dynamic MAC address
entries concerning a specified VLAN.
|
|
{ static | dynamic } mac-address
[ interface interface-type interface-number ] vlan vlan-id
|
Removes a specified static or dynamic MAC
address entry.
|
|
interface interface-type
interface-number
|
Removes all the MAC address entries
concerning a specified port.
|
|
vlan vlan-id
|
Removes all the MAC address entries
concerning a specified VLAN.
|
|
mac-address [ interface interface-type interface-number ] vlan
vlan-id
|
Removes a specified MAC address entry.
|
Description
Use the mac-address command to
add/modify a MAC address entry.
Use the undo mac-address command to
remove one or more MAC address entries.
If the MAC address you input in the mac-address
command already exists in the MAC address table, the system will modify the
attributes of the corresponding MAC address entry according to your settings in
the command.
You can remove all MAC address entries
(unicast MAC addresses only) concerning a specific port, or remove a specific
type of MAC address entries, such as the addresses learnt by the system and
dynamic or static MAC address entries configured.
Example
# Configure a static MAC address entry with
the following settings:
l
MAC address: 00e0-fc01-0101
l
Outbound port: Ethernet1/0/1
l
Ethernet1/0/1 belongs to VLAN 2.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] mac-address static
00e0-fc01-0101 interface Ethernet 1/0/1 vlan 2
Syntax
mac-address learning synchronization
undo mac-address learning
synchronization
View
System view
Parameter
None
Description
Use the mac-address learning
synchronization command to enable MAC address learning synchronization
between board chips.
Use the undo mac-address mac-learning
disable command to disable MAC address learning synchronization between
board chips.
By default, MAC address learning
synchronization between board chips is disabled.
Example
# Enable MAC address learning
synchronization between board chips.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] mac-address learning
synchronization
Syntax
mac-address mac-learning disable
undo mac-address mac-learning disable
View
Ethernet port view
Parameter
None
Description
Use the mac-address mac-learning disable
command to disable the current port from learning MAC addresses.
Use the undo mac-address mac-learning
disable command to re-enable the current port to learn MAC addresses.
By default, the port is enabled to learn
MAC addresses.
l
Do not use the mac-address mac-learning
disable command together with any 802.1x-related command in Ethernet port
view.
l
Do not use the mac-address mac-learning
disable command together with the mac-address max-mac-count command.
Example
# Disable the port Ethernet1/0/1 from
learning MAC addresses.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] interface Ethernet 1/0/1
[H3C-Ethernet1/0/1] mac-address
mac-learning disable
Syntax
mac-address max-mac-count count
undo mac-address max-mac-count
View
Ethernet port view
Parameter
count:
Maximum number of MAC addresses a port can learn. This argument ranges from 0
to 16,384. The value 0 means that the port is disabled from learning MAC
addresses.
Description
Use the mac-address max-mac-count
command to set the maximum number of MAC addresses an Ethernet port can learn.
Use the undo mac-address max-mac-count
command to cancel the limitation on the number of MAC addresses an Ethernet
port can learn.
By default, the number of MAC addresses an
Ethernet port can learn is unlimited.
When you use the mac-address
max-mac-count command, the port stops learning MAC addresses after the
number of MAC addresses it learned reaches the value of the count
argument you provided. You can use the undo mac-address max-mac-count command
to cancel this limit so that the port can learn up to 16,384 MAC addresses. By
default, the port learns up to 16384 MAC addresses.
Related command: mac-address, mac-address
timer.
Example
# Set the maximum number of MAC addresses
Ethernet1/0/3 can learn to 600.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] interface Ethernet 1/0/3
[H3C-Ethernet1/0/3] mac-address
max-mac-count 600
1.1.8 mac-address timer
Syntax
mac-address timer { aging age | no-aging }
undo mac-address timer aging
View
System view
Parameter
aging age: Specifies the aging time (in seconds) for layer-2 dynamic MAC
address entries. The age argument ranges from 10 to 1,000,000 and
defaults to 300.
no-aging:
Specifies not to age dynamic MAC address entries.
Description
Use the mac-address timer command to
set the aging time for dynamic MAC address entries.
Use the undo mac-address timer
command to restore the default aging time.
Set the aging time for dynamic MAC address
entries as required but ensure that the aging time does not decrease the
layer-2 packet forwarding performance of the switch.
l
If the aging time is too short, the MAC address
entries that are still valid may be removed. Upon receiving a packet destined
for a MAC address that is already removed, the switch broadcasts the packet
through all its ports in the VLAN which the packet belongs to. This decreases
the operating performance of the switch.
l
If the aging time is too long, MAC address
entries may still exist even if they turn invalid. This causes the switch to be
unable to update its MAC address table in time. In this case, the MAC address
table cannot reflect the position changes of network devices in time.
Example
# Set the aging time for MAC address
entries to 500 seconds.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] mac-address timer aging 500