H3C S9500 Command Manual-Release2132[V2.03]-08 System Volume

HomeSupportSwitchesH3C S9500 Series SwitchesReference GuidesCommand ReferencesH3C S9500 Command Manual-Release2132[V2.03]-08 System Volume
15-MAC Address Table Management Commands
Title Size Download
15-MAC Address Table Management Commands 49.86 KB

Chapter 1  MAC Address Table Management Configuration Commands

1.1  MAC Address Table Management Configuration Commands

1.1.1  display mac-address

Syntax

display mac-address [ mac-address [ vlan vlan-id ] | [ dynamic | static ] [ interface interface-type interface-number ] [ vlan vlan-id ] [ count ] ]

display mac-address blackhole [ vlan vlan-id ] [ count ]

View

Any view

Default Level

1: Monitor level

Parameters

mac-address: Specifies a MAC address in the format of H-H-H.

static: Displays static MAC address entries, which do not age.

dynamic: Displays dynamic MAC address entries, which age.

blackhole: Displays blackhole MAC address entries. The attribute of the blackhole MAC address entries is the same as that of the static MAC address entries. The packets whose destination MAC addresses match blackhole MAC address entries are discarded..

interface-type interface-number: Displays MAC address learning status of the ports with the specified type and number.

vlan vlan-id: Displays MAC address entries of the specified VLAN.

count: Displays the total number of MAC addresses in the MAC address table.

Description

Use the display mac-address command to display information about the MAC address table.

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

Examples

# Display information about the MAC address table entries of VLAN 4093.

<Sysname> display mac-address vlan 4093

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

3333-0254-0250  4093     Learned        N/A                     N/A

000d-88f5-7707  4093     Learned        GigabitEthernet4/1/1    AGING

 

  ---  2 mac address(es) found  ---

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

PORT INDEX

Port number. The multicast MAC address entries without egress port and blackhole MAC addresses are displayed as “N/A”.

AGING TIME(s)

Aging time, which could be:

l      AGING, indicates that the entry is aging.

l      NOAGED, indicates that the entry does not age.

l      Multicast MAC address entries are not involved with aging, and displayed as N/A.

 

1.1.2  display mac-address aging-time

Syntax

display mac-address aging-time

View

Any view

Default Level

1: Monitor level

Parameters

None

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, mac-address timer, 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 above information indicates that the aging time of dynamic entries in the MAC address table is 300 seconds.

1.1.3  display mac-address mac-learning

Syntax

display mac-address mac-learning [ interface-type interface-number ]

View

Any view

Default Level

1: Monitor level

Parameters

interface-type interface-number: Specifies the interface type and number. The MAC address learning status of the port with the specified type and number will be displayed.

Description

Use the display mac-address mac-learning command to display MAC address learning status of the specified or all Ethernet ports.

Examples

# Display MAC address learning status of all Ethernet ports.

<Sysname> display mac-address mac-learning

Mac address learning status of the switch: enable

 

PortName              Learning Status

GigabitEthernet1/1/1      enable

GigabitEthernet1/2/1      enable

GigabitEthernet1/3/1      enable

GigabitEthernet1/4/1      enable

GigabitEthernet2/1/1      enable

GigabitEthernet2/2/1      enable

GigabitEthernet2/3/1      enable

GigabitEthernet2/4/1      enable

......

Table 1-2 display mac-address mac-learning command output description

Field

Description

Mac address learning status of the switch

Global MAC address learning status, enabled or disabled.

PortName

Port name

Learning Status

Port MAC address learning status, enabled or disabled

 

1.1.4  mac-address (Ethernet interface view)

Syntax

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

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

View

Ethernet interface view

Default Level

2: System level

Parameters

dynamic: Dynamic MAC address entries.

static: Static MAC address entries.

mac-address: Specifies a MAC address in the format of H-H-H.

vlan vlan-id: Specifies the VLAN to which the port belongs. The vlan-id argument ranges from 1 to 4094.

Description

Use the mac-address command to add or modify a MAC address entry on a specified Ethernet port.

Use the undo mac-address command to remove a MAC address entry on the Ethernet port.

As your MAC address entries configuration cannot survive a reboot, save it after completing the configuration. The dynamic MAC address table entries however will be lost whether you save the configuration or not.

Before using this command, you must add the port to the specified VLAN.

Do not configure dynamic or static MAC addresses on an aggregation port.

Related commands: display mac-address.

Examples

# Add a static entry for MAC address 000F-E201-0608 on GigabitEthernet 1/1/1, which belongs to VLAN 2.

<Sysname> system-view

[Sysname] interface gigabitEthernet 1/1/1

[Sysname-GigabitEthernet1/1/1] mac-address static 000f-e201-0608 vlan 2

1.1.5  mac-address (system view)

Syntax

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

mac-address blackhole mac-address vlan vlan-id

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

undo mac-address [ static | dynamic | blackhole ] [ mac-address ] vlan vlan-id

undo mac-address [ static | dynamic ] mac-address interface interface-type interface-number vlan vlan-id

undo mac-address [ static | dynamic ] interface interface-type interface-number

View

System view

Default Level

2: System level

Parameters

static: Static MAC address entries.

dynamic: Dynamic MAC address entries.

blackhole: Blackhole MAC address entries. These entries do not age but you can add or remove them. The packets whose destination MAC addresses match blackhole MAC address entries are discarded.

mac-address: Specifies a MAC address in the format of H-H-H.

interface interface-type interface-number: Specifies an egress port by its type and number.

vlan vlan-id: Specifies a VLAN to which the egress port belongs. The vlan-id argument ranges from 1 to 4094.

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.

Note that:

l           If the existing MAC address is a dynamic address, you can modify it as a static or blackhole address, and if the existing MAC address is a static address or blackhole address, you will be prompted that this MAC address already exists, and modification is not necessary.

l           You can delete all the MAC address entries on a port or a VLAN, or you can delete the dynamic MAC address entry, the static MAC address entry or the blackhole MAC address entry.

l           As your MAC address entries configuration cannot survive a reboot, save it after completing the configuration. The dynamic entries however will be lost whether you save the configuration or not.

l           Before using this command, you must add the port to the specified VLAN.

Do not configure a dynamic, static or blackhole MAC address on an aggregation port.

Related commands: display mac-address.

Examples

# Add a static entry for MAC address 000F-E201-0608. All frames destined for this MAC address are sent out of port Ethernet 1/1/1 which belongs to VLAN 2.

<Sysname> system-view

[Sysname] mac-address static 000f-e201-0608 interface ethernet 1/1/1 vlan 2

1.1.6  mac-address mac-learning disable

Syntax

mac-address mac-learning disable

undo mac-address mac-learning disable

View

System view/Ethernet interface view/port group view

Default Level

2: System level

Parameters

None

Description

Use the mac-address mac-learning disable command to disable MAC address learning globally or specify the MAC address learning function of the Ethernet port.

Use the undo mac-address mac-learning disable command to enable MAC address learning globally, or specify the MAC address learning function of the Ethernet port.

By default, MAC address learning is enabled globally.

Note that you need to disable MAC address learning sometimes to prevent the MAC address table from being saturated, for example, when your device is being attacked by a great deal of frames with different source MAC addresses. This somewhat affects update of the MAC address table.

Related commands: display mac-address mac-learning.

Examples

# Disable global MAC address learning.

<Sysname> system-view

[Sysname] mac-address mac-learning disable

# Disable MAC address learning on port Ethernet 1/1/1.

<Sysname> system-view

[Sysname] interface ethernet 1/1/1

[Sysname-Ethernet1/1/1] mac-address mac-learning disable

1.1.7  mac-address max-mac-count (Ethernet interface view/port group view)

Syntax

mac-address max-mac-count { count | disable-forwarding }

undo mac-address max-mac-count [ disable-forwarding ]

View

Ethernet interface view/port group view

Default Level

2: System level

Parameters

count: Maximum number of MAC addresses that can be learned on a port, in the range 0 to 14336. When the argument takes 0, the port is not allowed to learn MAC addresses.

disable-forwarding: Disables forwarding of the frames with unknown destination MAC addresses after the number of learned MAC addresses reaches the upper limit. Frames with the destination MAC addresses listed in the MAC address table will be forwarded normally.

Description

Use the mac-address max-mac-count count command to configure the maximum number of MAC addresses that can be learned on an Ethernet port.

Use the mac-address max-mac-count disable-forwarding command to configure not to forward frames with unknown destination MAC addresses after the number of learned MAC addresses reaches the upper limit.

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.

Use the undo mac-address max-mac-count disable-forwarding command to allow forwarding of the frames received on an Ethernet port with unknown destination MAC addresses after the number of learned MAC addresses reaches the upper limit.

The default maximum number of MAC addresses that can be learned on an Ethernet port is 14336. When the upper limit is reached, frames received with unknown destination MAC addresses on a port are forwarded by default. Frames with the destination MAC addresses listed in the MAC address table will be forwarded normally.

Executed in Ethernet interface view, this command takes effect only for the current port; executed in port group view, this command takes effect on all the ports under the port group.

Related commands: mac-address (system view), mac-address (Ethernet interface view), mac-address timer.

Examples

# Set the maximum number of MAC addresses that can be learned on port Ethernet 1/1/1 to 600. After this upper limit is reached, frames received with unknown destination MAC addresses on the port will not be forwarded.

<Sysname> system-view

[Sysname] interface ethernet 1/1/1

[Sysname-Ethernet1/1/1] mac-address max-mac-count 600

[Sysname-Ethernet1/1/1] mac-address max-mac-count disable-forwarding

1.1.8  mac-address max-mac-count (VLAN view)

Syntax

mac-address max-mac-count count

undo mac-address max-mac-count

View

VLAN view

Default Level

2: System level

Parameters

count: Maximum number of MAC addresses that can be learned on a VLAN, in the range 0 to 172032, with 0 meaning that MAC address learning of this VLAN is not allowed.

Description

Use the mac-address max-mac-count count command to configure the maximum number of MAC addresses that can be learned on a VLAN.

Use the undo mac-address max-mac-count command to restore the default maximum number of MAC addresses that can be learned on a VLAN.

A VLAN can learn up to 172032 MAC addresses by default.

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

 

&  Note:

There are no actual Layer 2 physical interfaces on the Super VLAN, and the number of the learned MAC addresses is always 0, so configuring the number of MAC addresses under Super VLAN is meaningless.

 

Examples

# Set the maximum number of MAC addresses that can be learned on VLAN 10 to 600.

<Sysname> system-view

[Sysname] vlan 10

[Sysname-vlan10] mac-address max-mac-count 600

1.1.9  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 time in seconds for dynamic MAC address entries.

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 time for the MAC address dynamic entry is 300 seconds.

Set the aging timer appropriately: a short interval may result in removal of valid entries and hence unnecessary broadcasts which may affect device performance; a long aging interval may cause the MAC address table to retain outdated entries and fail to accommodate latest network changes. In this case, delay may result when a workstation is moved from one port to another.

Examples

# Set the aging timer for dynamic MAC address entries to 500 seconds.

<Sysname> system-view

[Sysname] 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
新华三官网