No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

S2700, S3700, S5700, S6700, S7700, and S9700 Series Switches Typical Configuration Examples

This document provides examples for configuring features in typical usage scenarios.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Example for Configuring Static MAC Address Entries

Example for Configuring Static MAC Address Entries

Overview

MAC address entries are automatically generated when the switch learns the source MAC addresses of packets. Static MAC address entries are manually configured.

A network administrator manually adds MAC address entries of authorized users into the MAC address table. The static MAC address entries are often used to prevent unauthorized users from intercepting data of authorized users.

If a large number of static MAC address entries are manually configured, network maintenance can be difficult. You can enable port security to dynamically bind MAC addresses to interfaces.

Configuration Notes

This example applies to all versions of all S series switches.

Networking Requirements

In Figure 7-1, the server connects to the switch through GE1/0/2. To prevent the switch from broadcasting packets destined for the server, the static MAC address entry of the server needs to be configured on the switch. This ensures that the switch unicasts packets destined for the server through GE1/0/2. The MAC address of the PC is statically bound to GE1/0/1 to ensure secure communication between the PC and server.

Figure 7-1  Networking for configuring static MAC address entries

Configuration Roadmap

The configuration roadmap is as follows:

  1. Create a VLAN on the switch and add an interface to the VLAN to implement Layer 2 forwarding.

  2. Configure the static MAC address entry of the server on the switch.

  3. Configure the static MAC address entry of the PC on the switch.

Procedure

  1. Create VLAN 2 on the switch and add GE1/0/1 and GE1/0/2to VLAN 2.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch
    [Switch] vlan batch 2   //Create VLAN 2.
    [Switch] interface gigabitethernet 1/0/1
    [Switch-GigabitEthernet1/0/1] port link-type access   //The interface connected to the PC must be the access interface. The default link type of an interface is not access, so you need to manually configure the access interface.
    [Switch-GigabitEthernet1/0/1] port default vlan 2   //Add GE1/0/1 to VLAN 2.
    [Switch-GigabitEthernet1/0/1] quit
    [Switch] interface gigabitethernet 1/0/2   //The configuration of GE1/0/2 is similar to that of GE1/0/1.
    [Switch-GigabitEthernet1/0/2] port link-type access 
    [Switch-GigabitEthernet1/0/2] port default vlan 2
    [Switch-GigabitEthernet1/0/2] quit
    

  2. Configure the static MAC address entry of the server on the switch.

    [Switch] mac-address static 4-4-4 gigabitethernet 1/0/2 vlan 2
    

  3. Configure the static MAC address entry of the PC on the switch.

    [Switch] mac-address static 2-2-2 gigabitethernet 1/0/1 vlan 2
    

  4. Verify the configuration.

    # Run the display mac-address static vlan 2 command in any view to check whether static MAC address entries were successfully added to the MAC address table.

    [Switch] display mac-address static vlan 2
    ------------------------------------------------------------------------------- 
    MAC Address          VLAN/VSI                    Learned-From        Type       
    -------------------------------------------------------------------------------
    0002-0002-0002       2/-                         GE1/0/1             static
    0004-0004-0004       2/-                         GE1/0/2             static
    
    -------------------------------------------------------------------------------
    Total items displayed  = 2
    
    

Configuration Files

Switch configuration file

#
sysname Switch
#
vlan batch 2
#
interface GigabitEthernet1/0/1
 port link-type access
 port default vlan 2
#
interface GigabitEthernet1/0/2
 port link-type access
 port default vlan 2
#
mac-address static 0002-0002-0002 GigabitEthernet1/0/1 vlan 2
mac-address static 0004-0004-0004 GigabitEthernet1/0/2 vlan 2
#
return
Download
Updated: 2019-04-20

Document ID: EDOC1000069520

Views: 661733

Downloads: 29838

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next