User Tools

Site Tools


huawei:switch:s5735:configuration_guide_ethernet_switching

Configuration Guide - Ethernet Switching

S2720, S5700, and S6700 V200R019C00

This document describes the configuration of Ethernet services, including configuring MAC address table, link aggregation, VLANs, VLAN aggregation, MUX VLAN, VLAN termination, Voice VLAN, VLAN mapping, QinQ, GVRP, VCMP, STP/RSTP/MSTP, VBST, SEP, RRPP, ERPS, LBDT, and Layer 2 protocol transparent transmission.

In Figure 4-23, interfaces connecting to PC1 and PC3 are assigned to VLAN 10, and the interface connecting to PC2 is assigned to VLAN 20. PC2 cannot directly communicate with PC1 and PC3 at Layer 2, but PC1 and PC3 can directly communicate with each other.

Figure 4-23 Networking of interface-based VLAN assignment

<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 10 20
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type access
[Switch-GigabitEthernet0/0/1] port default vlan 10
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] port link-type access
[Switch-GigabitEthernet0/0/2] port default vlan 20
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet 0/0/3
[Switch-GigabitEthernet0/0/3] port link-type access
[Switch-GigabitEthernet0/0/3] port default vlan 10
[Switch-GigabitEthernet0/0/3] quit
[Switch] interface gigabitethernet 0/0/4
[Switch-GigabitEthernet0/0/4] port link-type hybrid
[Switch-GigabitEthernet0/0/4] port hybrid tagged vlan 10 20

Add PC1 and PC3 to the same IP address segment, for example, 192.168.100.0/24; add PC2 to another IP address segment, for example, 192.168.200.0/24. PC1 and PC3 can ping each other but cannot ping PC2.

Configuration Tips

Configuring a name for a VLAN

When multiple VLANs are created on the device, you can configure names for the VLANs to facilitate management. After a name is configured for a VLAN, you can directly enter the VLAN view using the name.

# Set the name of VLAN 10 to huawei.

<HUAWEI> system-view
[HUAWEI] vlan 10
[HUAWEI-vlan10] name huawei
[HUAWEI-vlan10] quit

# After a name is configured for a VLAN, you can directly enter the VLAN view using the name.

[HUAWEI] vlan vlan-name huawei
[HUAWEI-vlan10] quit

Adding interfaces to a VLAN in a batch

Use a port group to perform the same VLAN configuration for multiple Ethernet interfaces. To add access interfaces to a VLAN in a batch, you can also run the port interface-type { interface-number1 [ to interface-number2 ] }&<1-10> command in the VLAN view. The following uses the access interface as an example.

# Add interfaces to a VLAN in a batch using a port group.

<HUAWEI> system-view
[HUAWEI] port-group pg1
[HUAWEI-port-group-pg1] group-member gigabitethernet0/0/1 to gigabitethernet0/0/5
[HUAWEI-port-group-pg1] port link-type access
[HUAWEI-port-group-pg1] port default vlan 10

# Add interfaces to a VLAN in a batch in the VLAN view.

<HUAWEI> system-view
[HUAWEI] vlan 10
[HUAWEI-vlan10] port gigabitethernet 0/0/1 to 0/0/5

Restoring the default VLAN configuration of an interface

If the VLAN planning of an interface is changed, you need to delete the original VLAN configuration of the interface. If many non-contiguous VLANs are configured on the interface, you need to perform the delete operation multiple times. To reduce the workload, you can restore the default VLAN configuration of the interface. For details, see Restoring the Default VLAN Configuration of an Interface.

Changing the interface type

When the interface planning changes or the current interface type is different from the configured one, the interface type needs to be changed. For details, see How Do I Change the Link Type of an Interface?.

Deleting a VLAN

If a VLAN is not in use, you are advised to delete it to save VLAN resources and reduce packets on a network. For details, see Deleting a VLAN.

Verifying the Configuration

1. Run the display port vlan [ interface-type interface-number | active ] * command in any view to check information about interfaces of the VLAN. 2. Run the display vlan command in any view to check information about VLANs.


In Figure 4-24, to simplify configurations, switches are connected through the trunk link, and switches and user terminals are connected through access links and added to VLANs. By default, LNP is enabled globally and on all interfaces.

Figure 4-24 Networking of interface-based VLAN assignment (LNP dynamically negotiates the link type)

Configure Switch3.

<HUAWEI> system-view
[HUAWEI] sysname Switch3
[Switch3] vlan batch 10 20
[Switch3] interface GigabitEthernet 0/0/1
[Switch3-GigabitEthernet0/0/1] port trunk allow-pass only-vlan 10 20
[Switch3-GigabitEthernet0/0/1] quit
[Switch3] interface GigabitEthernet 0/0/2
[Switch3-GigabitEthernet0/0/2] port trunk allow-pass only-vlan 10 20
[Switch3-GigabitEthernet0/0/2] quit

Configure Switch1. The configurations of Switch2 are similar to the configuration of Switch1, and are not mentioned here.

<HUAWEI> system-view
[HUAWEI] sysname Switch1
[Switch1] vlan batch 10 20
[Switch1] interface GigabitEthernet 0/0/1
[Switch1-GigabitEthernet0/0/1] port default vlan 10
[Switch1-GigabitEthernet0/0/1] quit
[Switch1] interface GigabitEthernet 0/0/2
[Switch1-GigabitEthernet0/0/2] port trunk allow-pass only-vlan 10 20
[Switch1-GigabitEthernet0/0/2] quit
[Switch1] interface GigabitEthernet 0/0/3
[Switch1-GigabitEthernet0/0/3] port default vlan 20
[Switch1-GigabitEthernet0/0/3] quit

Verifying the Configuration

Run the display lnp { interface interface-type interface-number | summary } command in any view to check LNP negotiation information on a Layer 2 Ethernet interface.


Configuration Example (a Switch Connects to Downstream Terminals)

In Figure 4-25, the MAC addresses of PC1, PC2, and PC3 are bound to VLAN 10.

Figure 4-25 Networking of MAC address-based VLAN assignment (a switch connects to downstream terminals)

<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 10
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type hybrid
[Switch-GigabitEthernet0/0/1] port hybrid tagged vlan 10
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] port link-type hybrid  
[Switch-GigabitEthernet0/0/2] port hybrid untagged vlan 10
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet 0/0/3
[Switch-GigabitEthernet0/0/3] port link-type hybrid
[Switch-GigabitEthernet0/0/3] port hybrid untagged vlan 10
[Switch-GigabitEthernet0/0/3] quit
[Switch] interface gigabitethernet 0/0/4
[Switch-GigabitEthernet0/0/4] port link-type hybrid
[Switch-GigabitEthernet0/0/4] port hybrid untagged vlan 10
[Switch-GigabitEthernet0/0/4] quit
[Switch] vlan 10
[Switch-vlan10] mac-vlan mac-address 22-22-22
[Switch-vlan10] mac-vlan mac-address 33-33-33
[Switch-vlan10] mac-vlan mac-address 44-44-44
[Switch-vlan10] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] mac-vlan enable
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet 0/0/3
[Switch-GigabitEthernet0/0/3] mac-vlan enable
[Switch-GigabitEthernet0/0/3] quit
[Switch] interface gigabitethernet 0/0/4 
[Switch-GigabitEthernet0/0/4] mac-vlan enable
[Switch-GigabitEthernet0/0/4] quit

Configuration Example (a Switch Connects to Downstream Layer 2 Switches)

In Figure 4-26, Switch1 connects to a Layer 2 switch. On Switch1, associate MAC addresses of PC1 and PC2 with VLAN 10 and MAC addresses of PC3 and PC4 with VLAN 20.

Figure 4-26 Networking of MAC address-based VLAN assignment (a switch connects to downstream Layer 2 switches)

<HUAWEI> system-view
[HUAWEI] sysname Switch1
[Switch1] vlan batch 10 20
[Switch1] vlan 10
[Switch1-vlan10] mac-vlan mac-address 11-11-11
[Switch1-vlan10] mac-vlan mac-address 22-22-22
[Switch1-vlan10] quit
[Switch1] vlan 20
[Switch1-vlan20] mac-vlan mac-address 33-33-33
[Switch1-vlan20] mac-vlan mac-address 44-44-44
[Switch1-vlan20] quit
[Switch1] interface gigabitethernet 0/0/1
[Switch1-GigabitEthernet0/0/1] mac-vlan enable
[Switch1-GigabitEthernet0/0/1] quit
[Switch1] interface gigabitethernet 0/0/1 
[Switch1-GigabitEthernet0/0/1] port link-type hybrid
[Switch1-GigabitEthernet0/0/1] port hybrid untagged vlan 10 20
[Switch1-GigabitEthernet0/0/1] quit
[Switch1] interface gigabitethernet 0/0/2
[Switch1-GigabitEthernet0/0/2] port link-type trunk
[Switch1-GigabitEthernet0/0/2] port trunk allow-pass vlan 10 20
[Switch1-GigabitEthernet0/0/2] quit

In Figure 4-27, PC1, PC2, and PC3 are located on different network segments and are added to VLAN 100, VLAN 200, and VLAN 300, respectively.

Figure 4-27 Networking of IP subnet-based VLAN assignment

<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 100 200 300
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type hybrid
[Switch-GigabitEthernet0/0/1] port hybrid untagged vlan 100 200 300
[Switch-GigabitEthernet0/0/1] ip-subnet-vlan enable
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] port link-type trunk
[Switch-GigabitEthernet0/0/2] port trunk allow-pass vlan 100 200 300
[Switch-GigabitEthernet0/0/2] quit
[Switch] vlan 100
[Switch-vlan100] ip-subnet-vlan 1 ip 192.168.1.2 24 priority 2
[Switch-vlan100] quit
[Switch] vlan 200
[Switch-vlan200] ip-subnet-vlan 1 ip 192.168.2.2 24 priority 3
[Switch-vlan200] quit
[Switch] vlan 300
[Switch-vlan300] ip-subnet-vlan 1 ip 192.168.3.2 24 priority 4
[Switch-vlan300] quit

In Figure 4-28, users in VLAN 10 use IPv4 to communicate with remote users, and users in VLAN 20 use IPv6 to communicate with remote servers. To implement this, you need to use protocol-based VLAN assignment.

Figure 4-28 Networking of protocol-based VLAN assignment

<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 10 20
[Switch] vlan 10
[Switch-vlan10] protocol-vlan ipv4
[Switch-vlan10] quit
[Switch] vlan 20
[Switch-vlan20] protocol-vlan ipv6
[Switch-vlan20] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] protocol-vlan vlan 10 all priority 5
[Switch-GigabitEthernet0/0/2] port link-type hybrid
[Switch-GigabitEthernet0/0/2] port hybrid untagged vlan 10
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet 0/0/3
[Switch-GigabitEthernet0/0/3] protocol-vlan vlan 20 all priority 6
[Switch-GigabitEthernet0/0/3] port link-type hybrid
[Switch-GigabitEthernet0/0/3] port hybrid untagged vlan 20
[Switch-GigabitEthernet0/0/3] quit
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type trunk
[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 20
[Switch-GigabitEthernet0/0/1] quit
huawei/switch/s5735/configuration_guide_ethernet_switching.txt · Last modified: 2021/08/27 16:50 by aperez

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki