H3C S7500 Series Operation Manual(Release 3100 Series)-(V1.04)

HomeSupportSwitchesH3C S7500 Switch SeriesConfigure & DeployConfiguration GuidesH3C S7500 Series Operation Manual(Release 3100 Series)-(V1.04)
14-MAC Address Table Configuration
Title Size Download
14-MAC Address Table Configuration 90 KB

Chapter 1  MAC Address Table Management

When configuring MAC address table management, go to these sections for information you are interested in:

l           Overview

l           Configuring MAC Address Table Management

l           Displaying MAC Address Configuration

l           Configuration Example

 

&  Note:

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  Operation Manual.

 

1.1  Overview

1.1.1  Introduction to MAC Address Learning

An Ethernet switch maintains a MAC address table to forward packets quickly. A MAC address table is a port-based Layer 2 address table. It is the base for Ethernet switch to perform Layer 2 packet forwarding. Each entry in a MAC address table contains the following fields:

l           Destination MAC address

l           ID of the VLAN which a port belongs to

l           Forwarding port number

Upon receiving a packet, a switch queries its MAC address table for the forwarding port number according to the destination MAC address carried in the packet and then forwards the packet through the port.

The dynamic address entries (not configured manually) in the MAC address table are learned by the Ethernet switch. When an Ethernet switch learns a MAC address, the following occurs:

When a switch receives a packet from one of its ports (referred to as Port 1), the switch extracts the source MAC address (referred to as MAC-SOURCE) of the packet and considers that the packets destined for MAC-SOURCE can be forwarded through Port 1.

l           If the MAC address table already contains MAC-SOURCE, the switch updates the corresponding MAC address entry.

l           If MAC-SOURCE does not exist in the MAC address table, the switch adds MAC-SOURCE and Port 1 as a new MAC address entry to the MAC address table.

Figure 1-1 Packets forwarded by using a MAC address table

After learning the source address of the packet, the switch searches the MAC address table for the destination MAC address of the received packet:

l           If it finds a match, it directly forwards the packet.

l           If it finds no match, it forwards the packet to all ports, except the receiving port, within the VLAN to which the receiving port belongs. Normally, this is referred to as broadcasting the packet.

After broadcasting the packet, the switch will do one of the following based on whether it receives a response packet:

l           If the network device returns a packet to the switch, this indicates the packet has been sent to the destination device. The MAC address of the device is carried in the packet. The switch adds the new MAC address to the MAC address table through address learning. After that, the switch can directly forward other packets destined for the same network device by using the newly added MAC address entry.

l           If the destination device does not respond to the packet, this indicates that the destination device is unreachable or that the destination device receives the packet but gives no response. In this case, the switch still cannot learn the MAC address of the destination device. Therefore, the switch will still broadcast any other packet with this destination MAC address.

To fully utilize a MAC address table, which has a limited capacity, the switch uses an aging mechanism for updating the table. That is, the switch removes the MAC address entries related to a network device if no packet is received from the device within the aging time. Aging time only applies to dynamic MAC address entries.

You can manually configure (add or modify) a static or dynamic MAC address entry based on the actual network environment.

 

&  Note:

The switch learns only unicast addresses by using the MAC address learning mechanism but directly drops any packet with a broadcast source MAC address.

 

1.1.2  Entries in a MAC Address Table

Entries in a MAC address table fall into the following two categories according to their characteristics and configuration methods:

l           Static MAC address entry: Also known as permanent MAC address entry. This type of MAC address entries are added/removed manually and can not age out by themselves. Using static MAC address entries can reduce broadcast packets remarkably and are suitable for networks where network devices seldom change.

l           Dynamic MAC address entry: This type of MAC address entries ages out after the configured aging time. They are generated by the MAC address learning mechanism or configured manually.

Table 1-1 lists the different types of MAC address entries and their characteristics.

Table 1-1 Characteristics of different types of MAC address entries

MAC address entry

Configuration method

Aging time

Reserved or not at reboot (if the configuration is saved)

Static MAC address entry

Manually configured

Unavailable

Yes

Dynamic MAC address entry

Manually configured or generated by MAC address learning mechanism

Available

No

 

1.2  Configuring MAC Address Table Management

1.2.1  MAC Address Table Configuration Task List

Complete the following tasks to configure MAC address table:

Task

Remarks

Configuring a MAC Address Entry

Required

Setting the Aging Time for MAC Address Entries

Optional

Setting the Maximum Number of MAC Addresses a Port can Learn

Optional

Disabling MAC Address Learning

Optional

Configuring MAC Address Learning Synchronization Between Board Chips

Optional

Setting the Processing Method for Specific Packets

Optional

 

1.2.2  Configuring a MAC Address Entry

You can add, modify, or remove one MAC address entry, remove all the MAC address entries (unicast MAC addresses only) concerning a specific port, or remove a specific type of MAC address entries (dynamic or static).

Follow these steps to add a MAC address entry:

To do…

Use the command…

Remarks

Enter system view

system-view

Add a MAC address entry

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

Required

 

  Caution:

For a MAC address entry to be added, the port specified by the interface keyword must belong to the VLAN specified by the vlan keyword in the command. Otherwise, the entry cannot be added.

 

1.2.3  Setting the Aging Time for MAC Address Entries

Setting aging time properly helps implement effective MAC address aging. The aging time that is too long or too short results in a large amount of broadcast packets wandering across the network and decreases the performance of the switch.

l           If the aging time is too long, excessive invalid MAC address entries maintained by the switch may fill up the MAC address table. This prevents the MAC address table from varying with network changes in time.

l           If the aging time is too short, the switch may remove valid MAC address entries. This decreases the forwarding performance of the switch.

Follow these steps to set aging time for MAC address entries:

To do…

Use the command…

Remarks

Enter system view

system-view

Set the aging time of MAC address entries

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

Required

The default aging time is 300 seconds.

 

This command is used in system view and applies to all ports. Aging applies to only dynamic MAC addresses that are learnt or configured to age out.

Normally, you are recommended to use the default aging time, namely, 300 seconds. The no-aging keyword specifies that MAC address entries do not age out.

1.2.4  Setting the Maximum Number of MAC Addresses a Port can Learn

The MAC address learning mechanism enables an Ethernet switch to acquire the MAC addresses of the network devices on the segment connected to the ports of the switch. The switch directly forwards the packets destined for these MAC addresses. An oversized MAC address table may decrease the forwarding performance of the switch.

By setting the maximum number of MAC addresses that can be learnt from individual ports, you can control the number of the MAC address entries the MAC address table can dynamically maintains. If you have set the maximum number of MAC addresses that a port can learn to count, the port stops learning MAC addresses when the number of MAC addresses learned by the port reaches count.

Follow these steps to set the maximum number of MAC addresses a port can learn:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter Ethernet port view

interface interface-type interface-number

Set the maximum number of MAC addresses the port can learn

mac-address max-mac-count count

Required

By default, the number of the MAC addresses a port can learn is not limited.

 

1.2.5  Disabling MAC Address Learning

To gain better control over network security, you can use the following commands to disable the current port from learning MAC addresses.

Follow these steps to disable the current port from learning MAC addresses:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter Ethernet port view

interface interface-type interface-number

Disable the current port from learning MAC addresses

mac-address mac-learning disable

Required

By default, the port is enabled to learn MAC addresses.

 

&  Note:

l      Do not use the mac-address mac-learning disable command together with related 802.1x commands in Ethernet port view.

l      Do not use the mac-address mac-learning disable command together with the mac-address max-mac-count command.

 

1.2.6  Configuring MAC Address Learning Synchronization Between Board Chips

If there are multiple chips on a board, each chip can learn only the MAC addresses of the data flow it handles. If a chip receives a packet whose MAC address entry is stored in another chip, it broadcasts the packet.

You can configure MAC address learning synchronization between board chips to synchronize MAC address entries between chips. This reduces broadcasting of unknown packets, lowers switch processing load, and improves network utilization.

Follow these steps to configure MAC address learning synchronization between board chips:

To do…

Use the command…

Remarks

Enter system view

system-view

Enable MAC address learning synchronization between board chips

mac-address learning synchronization

Optional

By default, MAC address learning synchronization between board chips is disabled.

 

1.2.7  Setting the Processing Method for Specific Packets

Follow these steps to set the packet processing method of a switch when it receives a packet whose destination MAC address is the bridge MAC address of the switch:

To do…

Use the command…

Remarks

Enter system view

system-view

Enable the switch to pass the packet whose destination MAC address is the bridge MAC address of the switch to the CPU for processing

bridgemactocpu enable

Optional

By default, packets with the destination MAC address being the bridge MAC address of the switch are not passed to the CPU for processing.

Disable the switch from passing the packet whose destination MAC address is the bridge MAC address of the switch to the CPU for processing

bridgemactocpu disable

Optional

 

1.3  Displaying MAC Address Configuration

To do…

Use the command…

Remarks

Display information about the MAC address table

display mac-address [ display-option ]

Available in any view.

Display the aging time of the dynamic MAC address entries in the MAC address table

display mac-address aging-time

 

1.4  Configuration Example

1.4.1  Network Requirements

l           Log into the switch through the console port and enable address table configuration.

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

l           Add a static MAC address entry 000f-e235-dc71 for port Ethernet 2/0/2 (assuming that the port belongs to VLAN 1).

1.4.2  Configuration Procedure

# Enter system view.

<H3C> system-view

[H3C]

# Add a MAC address, with the VLAN, ports, and states specified.

[H3C] mac-address static 000f-e235-dc71 interface Ethernet 2/0/2 vlan 1

# Set the aging time of dynamic MAC addresses to 500 seconds.

[H3C] mac-address timer aging 500

# Display the information about the MAC address entries in system view.

[H3C] display mac-address interface Ethernet 2/0/2

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

000f-e235-dc71     1       Config static    Ethernet2/0/2          NOAGED

000f-e200-5503     1       Learned          Ethernet2/0/2          AGING

000f-e200-5548     1       Learned          Ethernet2/0/2          AGING

---  3 mac address(es) found on port Ethernet2/0/2 ---

 

  • 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
新华三官网