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 MAC Address Limiting on an Interface

Example for Configuring MAC Address Limiting on an Interface

Overview

The switch limits the number of MAC address entries based on VLANs or interfaces. In offices where clients seldom change, you can configure MAC address limiting to control user access. This can protect against certain attacks. For example, if an attacker forges a large number of packets with different source MAC addresses and sends the packets to the device, finite MAC address entries in the MAC address table of the device may be exhausted. When the MAC address table is full, the device cannot learn source MAC addresses of valid packets. As a result, the device broadcasts the valid packets, wasting bandwidth resources.

MAC address limiting on an interface can be used in scenarios where users connected to an interface in small and medium-sized enterprises are fixed and seldom change.

Configuration Notes

  • After port-security enable is configured on an interface, MAC address limiting cannot be configured on the interface.
  • This example applies to all versions of all S series switches.

Networking Requirements

In Figure 7-4, user network 1 and user network 2 connect to the switch through the LSW, and GE1/0/1 of the switch connects to the LSW. User network 1 and user network 2 belong to VLAN 10 and VLAN 20 respectively. On the switch, MAC address limiting can be configured on GE1/0/1 to control the number of access users.

Figure 7-4  Networking of MAC address limiting on an interface

Configuration Roadmap

The configuration roadmap is as follows:

  1. Create VLANs and add interfaces to the VLANs to implement Layer 2 forwarding.

  2. Configure MAC address limiting on an interface to control the number of access users.

Procedure

  1. Create VLAN 10 and VLAN 20 and add GE1/0/1 to VLAN 10 and VLAN 20.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch
    [Switch] vlan batch 10 20   //Create VLAN 10 and VLAN 20.
    [Switch] interface gigabitethernet 1/0/1
    [Switch-GigabitEthernet1/0/1] port link-type trunk   //Configure the link type of the interface as trunk.
    [Switch-GigabitEthernet1/0/1] port trunk allow-pass vlan 10 20   //Add GE1/0/1 to VLAN 10 and VLAN 20.
    [Switch-GigabitEthernet1/0/1] quit
    

  2. Configure the switch to learn a maximum of 100 MAC address entries on GE1/0/1. When the number of learned MAC address entries reaches the limit, the switch discards the packets with new source MAC address entries and generates an alarm.

    [Switch] interface gigabitethernet 1/0/1
    [Switch-GigabitEthernet1/0/1] mac-limit maximum 100 action discard   //The default action taken for packets in different versions is different. You are advised to manually specify the action. The alarm function is enabled by default, so you do not need to specify it manually.
    [Switch-GigabitEthernet1/0/1] quit

  3. Verify the configuration.

    # Run the display mac-limit command in any view to check whether the MAC address limiting rule is successfully configured.

    [Switch] display mac-limit
    MAC limit is enabled                                                            
    Total MAC limit rule count : 1                                                  
                                                                                    
    PORT                 VLAN/VSI         SLOT Maximum Rate(ms) Action  Alarm       
    ----------------------------------------------------------------------------    
    GE1/0/1              -                -    100     -        discard enable      
    

Configuration Files

Switch configuration file

#
sysname Switch
#
vlan batch 10 20
#
interface GigabitEthernet1/0/1
 port link-type trunk                                                           
 port trunk allow-pass vlan 10 20
 mac-limit maximum 100
#
return
Download
Updated: 2019-04-20

Document ID: EDOC1000069520

Views: 662743

Downloads: 29849

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