H3C Campus Fixed-Port Switches CLI-Based Quick Start Configuration Guide -6W102

HomeSupportQuick StartsQuick Start Configuration GuidesH3C Campus Fixed-Port Switches CLI-Based Quick Start Configuration Guide -6W102
Table of Contents
Related Documents
14-MAC Address Table Quick Start Configuration Guide

MAC Address Table Quick Start Configuration Guide

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2025 New H3C Technologies Co., Ltd. All rights reserved.



Configuring static MAC address entries

Introduction

The following information uses an example to describe the basic procedure for configuring static MAC address entries.

Network configuration

As shown in Figure 1, for secure communication between users in VLAN 100 and the server or extranet through Switch A, perform the following tasks:

·     Assign GigabitEthernet 1/0/2 and GigabitEthernet 1/0/3 to VLAN 100.

·     Add a static MAC address entry on Switch A to bind the server MAC address to GigabitEthernet 1/0/2.

Figure 1 Network diagram

Procedure

To Configure Switch A:

# Create VLAN 100.

<Switch A> system-view

[Switch A] vlan 100

[Switch A-vlan100] quit

# Assign GigabitEthernet 1/0/2 to VLAN 100.

[Switch A] interface gigabitethernet 1/0/2

[Switch A-GigabitEthernet1/0/2] port access vlan 100

[Switch A-GigabitEthernet1/0/2] quit

# Configure GigabitEthernet 1/0/3 (port facing the LAN switch) as a trunk port, and assign the port to VLAN 100.

[Switch A] interface gigabitethernet 1/0/3

[Switch A-GigabitEthernet1/0/3] port link-type trunk

[Switch A-GigabitEthernet1/0/3] port trunk permit vlan 100

[Switch A-GigabitEthernet1/0/3] quit

# Add a static entry for MAC address 0033-0033-0033 on GigabitEthernet 1/0/2 that belongs to VLAN 100.

[Switch A] mac-address static 0033-0033-0033 interface gigabitethernet 1/0/2 vlan 100

Verifying the configuration

# Use ping operations to verify that any 10.0.0.0/24 host in VLAN 100 can communicate with the server.

<Switch A> ping 10.0.0.9

Ping 10.0.0.9 (10.0.0.9): 56 data bytes, press CTRL+C to break

56 bytes from 10.0.0.9: icmp_seq=0 ttl=254 time=2.137 ms

56 bytes from 10.0.0.9: icmp_seq=1 ttl=254 time=2.051 ms

56 bytes from 10.0.0.9: icmp_seq=2 ttl=254 time=1.996 ms

56 bytes from 10.0.0.9: icmp_seq=3 ttl=254 time=1.963 ms

56 bytes from 10.0.0.9: icmp_seq=4 ttl=254 time=1.991 ms

 

--- Ping statistics for 10.0.0.9 ---

5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss

round-trip min/avg/max/std-dev = 1.963/2.028/2.137/0.062 ms

# Verify that the static MAC address entry has been added.

[Switch A] display mac-address

MAC Address      VLAN ID    State            Port/NickName            Aging

0033-0033-0033   100        Static           GE1/0/2                  N

Configuration files

#

vlan 100

#

interface GigabitEthernet1/0/2

 port access vlan 100

 mac-address static 0033-0033-0033 vlan 100

#

interface GigabitEthernet1/0/3

 port link-type trunk

 port trunk permit vlan 1 100

#

Related documentation

·     MAC address table configuration in the Layer 2—LAN switching configuration guide for the device.

·     MAC address table commands in the Layer 2—LAN switching command reference for the device.

Setting the MAC learning limit for a VLAN

Introduction

The following information uses an example to describe the basic procedure for setting the MAC learning limit for a VLAN.

Network configuration

As shown in Figure 2, User Network 1 and User Network 2 both use VLAN 100 to communicate with the external network via Switch A. A large MAC address table will degrade forwarding performance. To ensure the forwarding performance of Switch A, configure VLAN 100 on Switch A to learn a maximum of 1024 MAC address entries.

Figure 2 Network diagram

 

Procedure

To Configure Switch A:

# Create VLAN 100.

<Switch A> system-view

[Switch A] vlan 100

[Switch A-vlan100] quit

# Configure GigabitEthernet 1/0/1 as a trunk port, and assign the port to VLAN 100.

[Switch A] interface gigabitethernet 1/0/1

[Switch A-GigabitEthernet1/0/1] port link-type trunk

[Switch A-GigabitEthernet1/0/1] port trunk permit vlan 100

[Switch A-GigabitEthernet1/0/1] quit

# Configure GigabitEthernet 1/0/2 as a trunk port, and assign the port to VLAN 100.

[Switch A] interface gigabitethernet 1/0/2

[Switch A-GigabitEthernet1/0/2] port link-type trunk

[Switch A-GigabitEthernet1/0/2] port trunk permit vlan 100

[Switch A-GigabitEthernet1/0/2] quit

# Configure VLAN 100 to learn a maximum of 1024 MAC address entries.

[Switch A] vlan 100

[Switch A-vlan100] mac-address max-mac-count 1024

[Switch A-vlan100] quit

Verifying the configuration

# Execute the display this command in VLAN 100 view to see if the configuration takes effect.

[Switch A] vlan 100

[Switch A-vlan100] display this

#

mac-address max-mac-count 1024

#

Return

Configuration files

#

vlan 100

 mac-address max-mac-count 1024

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 100

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 100

#

Related documentation

·     MAC address table configuration in the Layer 2—LAN switching configuration guide for the device.

·     MAC address table commands in the Layer 2—LAN switching command reference for the device.

Setting the MAC learning limit on interfaces

Introduction

The following information uses an example to describe the basic procedure for setting the MAC learning limit on interfaces.

Network configuration

As shown in Figure 3, Switch A is the edge device of the operator's network, LAN Switch 3 is the company's access switch, and LAN Switch 1 and LAN Switch 2 are the access switches for two departments within the company. Department network 1 uses VLAN 100 and Department network 2 uses VLAN 200. The company network is connected to Switch A via LAN Switch 3 to access the external network.

A large MAC address table will degrade forwarding performance. To ensure the forwarding performance of Switch A, configure VLAN 100 on Switch A to learn a maximum of 1024 MAC address entries.

Figure 3 Network diagram

 

Procedure

To Configure Switch A:

# Create VLAN 100 and VLAN 200.

<Switch A> system-view

[Switch A] vlan 100 200

# Configure GigabitEthernet 1/0/1 as a trunk port, and assign the port to VLAN 100 and VLAN 200.

[Switch A] interface gigabitethernet 1/0/1

[Switch A-GigabitEthernet1/0/1] port link-type trunk

[Switch A-GigabitEthernet1/0/1] port trunk permit vlan 100 200

[Switch A-GigabitEthernet1/0/1] quit

# Configure VLAN 100 to learn a maximum of 1024 MAC address entries.

[Switch A] interface gigabitethernet 1/0/1

[Switch A-GigabitEthernet1/0/1]mac-address max-mac-count 1024

[Switch A-GigabitEthernet1/0/1] quit

Verifying the configuration

# Execute the display this command in VLAN 100 view to see if the configuration takes effect.

[Switch A] interface gigabitethernet 1/0/1

[Switch A-GigabitEthernet1/0/1] display this

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 100 200

 mac-address max-mac-count 1024

#

return

Configuration files

#

vlan 100

#

vlan 200

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 100 200

 mac-address max-mac-count 1024

#

Related documentation

·     MAC address table configuration in the Layer 2—LAN switching configuration guide for the device.

·     MAC address table commands in the Layer 2—LAN switching command reference for the device.

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Intelligent Storage
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
  • Technical Blogs
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
新华三官网