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

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

MAC Address Table Quick Start Configuration Guide

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2022 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.

<Sysname> 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.

  • 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 Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网