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

AR500, AR510, and AR530 V200R007 CLI-based Configuration Guide - Ethernet Switching

This document describes the configuration of Ethernet services, including configuring transparent bridge, MAC table, link aggregation, VLANs, STP/RSTP/MSTP, and so on.The document provides the configuration procedures and configuration examples to illustrate the service configuration methods and application scenario.
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 the MAC Address Table

Example for Configuring the MAC Address Table

Networking Requirements

As shown in Figure 1-7, the MAC address of PC1 is 0002-0002-0002, and the MAC address of PC2 is 0003-0003-0003. The LSW connects the PCs to the Router. The LSW is connected to Ethernet2/0/1 of the Router, which belongs to VLAN 2. The MAC address of the server is 0004-0004-0004. The server is connected to Ethernet2/0/2 of the Router, which belongs to VLAN 2. The network requires the following configurations:

  • To prevent hackers from using MAC addresses to attack the network, configure a static MAC address entry for each user host on the Router. Set the aging time for the dynamic MAC address entries to 500 seconds.

  • To prevent hackers from stealing user information by forging the MAC address of the server, configure a static MAC address entry on the Router for the server.

Figure 1-7  Network diagram

Configuration Roadmap

The configuration roadmap is as follows:

  1. Create VLANs on the Router and add the interfaces to the VLANs.

  2. Configure static MAC address entries.

  3. Set the aging time for the dynamic MAC address entries.

Procedure

  1. Add static MAC address entries.

    # Create VLAN 2 and add Ethernet2/0/1 and Ethernet2/0/2 to VLAN 2.

    <Huawei> system-view
    [Huawei] sysname Router
    [Router] vlan 2
    [Router-vlan2] quit
    [Router] interface ethernet 2/0/1
    [Router-Ethernet2/0/1] port hybrid tagged vlan 2
    [Router-Ethernet2/0/1] quit
    [Router] interface ethernet 2/0/2
    [Router-Ethernet2/0/2] port hybrid pvid vlan 2
    [Router-Ethernet2/0/2] port hybrid untagged vlan 2
    [Router-Ethernet2/0/2] quit
    

    # Configure static MAC address entries.

    [Router] mac-address static 0002-0002-0002 ethernet 2/0/1 vlan 2
    [Router] mac-address static 0003-0003-0003 ethernet 2/0/1 vlan 2
    [Router] mac-address static 0004-0004-0004 ethernet 2/0/2 vlan 2

  2. Set the aging time for the dynamic MAC address entries.

    [Router] mac-address aging-time 500

  3. Verify the configuration.

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

    [Router] display mac-address static vlan 2
    -------------------------------------------------------------------------------
    MAC Address       VLAN/Bridge             Learned-From               Type
    -------------------------------------------------------------------------------
    0002-0002-0002       2/-                  Eth2/0/1                   static
    0003-0003-0003       2/-                  Eth2/0/1                   static
    0004-0004-0004       2/-                  Eth2/0/2                   static
    
    -------------------------------------------------------------------------------
    Total items displayed = 3
    

    # Run the display mac-address aging-time command to check whether the aging time for dynamic entries is set successfully.

    [Router] display mac-address aging-time
      Aging time: 500 second(s)

Configuration Files

Router configuration file

#
 sysname Router
#
vlan batch 2
#
 mac-address aging-time 500
#
interface Ethernet2/0/1
 port hybrid tagged vlan 2
#
interface Ethernet2/0/2
 port hybrid pvid vlan 2
 port hybrid untagged vlan 2
#
 mac-address static 0002-0002-0002 Ethernet2/0/1 vlan 2
 mac-address static 0003-0003-0003 Ethernet2/0/1 vlan 2
 mac-address static 0004-0004-0004 Ethernet2/0/2 vlan 2
#
return
Translation
Download
Updated: 2019-05-25

Document ID: EDOC1000097279

Views: 16681

Downloads: 63

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