H3C WX3000 Series Unified Switches Switching Engine Command Reference-6W103

HomeSupportWirelessH3C WX3000 Series Unified SwitchesReference GuidesCommand ReferencesH3C WX3000 Series Unified Switches Switching Engine Command Reference-6W103
13-MAC Address Table Management Command
Title Size Download
13-MAC Address Table Management Command 45.48 KB

 

This chapter describes the management of static, dynamic, and blackhole MAC address entries. For information about the management of multicast MAC address entries, refer to Multicast Command.in H3C WX3000 Series Unified Switches Switching Engine Command Reference.

 

MAC Address Table Management Configuration Commands

display mac-address aging-time

Syntax

display mac-address aging-time

View

Any view

Parameters

None

Description

Use the display mac-address aging-time command to display the aging time of the dynamic MAC address entries in the MAC address table.

Related commands: mac-address, mac-address timer, display mac-address.

Examples

# Display the aging time of the dynamic MAC address entries.

<device> display mac-address aging-time

Mac address aging time: 300s

The output information indicates that the aging time of the dynamic MAC address entries is 300 seconds.

<device> display mac-address aging-time

Mac address aging time: no-aging

The output information indicates that dynamic MAC address entries do not age out.

display mac-address

Syntax

display mac-address [ display-option ]

View

Any view

Parameters

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 | blackhole } [ interface interface-type interface-number ] [ vlan vlan-id ] [ count ]

Displays information about dynamic, static, or blackhole MAC 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 device.

statistics

Displays statistics of the MAC address entries maintained by the device.

 

mac-address: MAC address.

static: Displays static MAC address entries. (A static MAC address entry does not age.)

dynamic: Displays dynamic MAC address entries. (A dynamic MAC address entry ages with time.)

blackhole: Displays blackhole MAC address entries. (A blackhole MAC address entry does not age.)

interface-type interface-number: Port type and port number.

vlan-id: VLAN ID, in the range 1 to 4094.

count: Displays only the total number of the MAC address entries.

statistics: Displays statistics of the MAC address entries maintained by the device.

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, whether a MAC address is within the aging time and so on.

If you specify a unit ID with unit unit-id, the information about the MAC address entries on the specified device in the fabric will be displayed.

Examples

# Display information about MAC address 000f-e20f-0101.

<device> display mac-address 000f-e20f-0101

MAC ADDR          VLAN ID STATE      PORT INDEX          AGING TIME(s)

000f-e20f-0101    1       Learned     GigabitEthernet1/0/1    AGING

# Display the MAC address entries for GigabitEthernet 1/0/4.

<device> display mac-address interface GigabitEthernet 1/0/4

MAC ADDR        VLAN ID   STATE          PORT INDEX               AGING TIME(s)

000d-88f6-44ba  1        Learned       GigabitEthernet1/0/4   AGING

000d-88f7-9f7d  1        Learned       GigabitEthernet1/0/4   AGING

000f-e200-00cc  1        Learned       GigabitEthernet1/0/4   AGING

000f-e200-2201  1        Learned       GigabitEthernet1/0/4   AGING

000f-e207-f2e0  1        Learned       GigabitEthernet1/0/4   AGING

000f-e209-ecf9  1        Learned       GigabitEthernet1/0/4   AGING

---  7 mac address(es) found on port GigabitEthernet1/0/4 ---   

# Display the total number of MAC address entries found in VLAN 2.

<device> display mac-address vlan 2 count

9 mac address(es) found in vlan 2

Table 1-2 display mac-address command 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

The state of the MAC address. The value of this field can be “Static”, “Learned”, and so on.

PORT INDEX

Port index (including port type and port number)

AGING TIME(s)

Indicates whether a MAC address entry is aging

 

mac-address

Syntax

l          In system view:

mac-address { static | dynamic | blackhole } mac-address interface interface-type interface-number vlan vlan-id

undo mac-address [ mac-address-attribute ]

l          In Ethernet port view:

mac-address { static | dynamic | blackhole } mac-address vlan vlan-id

undo mac-address { static | dynamic | blackhole } mac-address vlan vlan-id

View

System view, Ethernet port view

Parameters

static: Specifies that the MAC address entry to be added/updated is of static type.

dynamic: Specifies that the MAC address entry to be added/updated is of dynamic type.

blackhole: Specifies the MAC address entry to be added/updated is of blackhole type.

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 | blackhole } interface interface-type interface-number

Removes the static, dynamic, or blackhole MAC address entries concerning a specified port.

{ static | dynamic | blackhole } vlan vlan-id

Removes the static, dynamic, or blackhole MAC address entries concerning a specified VLAN.

{ static | dynamic | blackhole } mac-address [ interface interface-type interface-number ] vlan vlan-id

Removes a specified static, dynamic, or blackhole 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 or modify a MAC address entry.

Use the undo mac-address command to remove one or more MAC address entries.

When being executed in Ethernet port view, these two commands only apply to the current port. In this case, the interface keyword is unnecessary.

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, dynamic or static MAC address entries configured, or blackhole addresses.

Examples

# Configure a static MAC address entry with the following settings:

l          MAC address: 000f-e20f-0101

l          Outbound port: GigabitEthernet 1/0/1

l          GigabitEthernet 1/0/1 belongs to VLAN 2.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] mac-address static 000f-e20f-0101 interface GigabitEthernet 1/0/1 vlan 2

mac-address max-mac-count

Syntax

mac-address max-mac-count count

undo mac-address max-mac-count

View

Ethernet port view

Parameters

count: Maximum number of MAC addresses a port can learn. This argument ranges from 0 to 4,096. A value of 0 disables the port 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 command to cancel this limit so that the port can learn MAC addresses without the number limitation. By default, no number limitation is set to the port for MAC address learning.

Related commands: mac-address, mac-address timer.

Examples

# Set the maximum number of MAC addresses GigabitEthernet 1/0/3 can learn to 600.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] interface GigabitEthernet 1/0/3

[device-GigabitEthernet1/0/3] mac-address max-mac-count 600

mac-address max-mac-count 0

Syntax

mac-address max-mac-count 0

undo mac-address max-mac-count

View

VLAN view

Parameters

None

Description

Use the mac-address max-mac-count 0 command to disable the device from learning MAC address in a VLAN.

Use the undo mac-address max-mac-count command to enable the device to learn MAC address in a VLAN.

By default, the device can learn MAC addresses in any VLAN.

Examples

# Disable the device from learning MAC address in VLAN 3.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] vlan 3

[device-vlan3] mac-address max-mac-count 0

mac-address timer

Syntax

mac-address timer { aging age | no-aging }

undo mac-address timer aging

View

System view

Parameters

aging age: Specifies the aging time (in seconds) for dynamic MAC address entries. The age argument ranges from 10 to 630.

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.

By default, the aging time of dynamic MAC address entries is 300 seconds.

Set the aging time of dynamic MAC address entries as required but ensure that the aging time does not decrease the layer 2 packet forwarding performance of the device.

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 device broadcasts the packet through all its ports in the VLAN which the packet belongs to. This decreases the operating performance of the device.

l          If the aging time is too long, MAC address entries may still exist even if they turn invalid. This causes the device 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.

Examples

# Set the aging time of MAC address entries to 500 seconds.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] mac-address timer aging 500

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网