The maximum number of virtual local area network vlan_The standard of virtual local area network is

Hello everyone, meet again, I am your friend Quanzhanjun.

The role and working principle of VLAN

1. The role of vlan

VLANs can logically divide a physical local area network into multiple broadcast domains. Hosts between different VLANs do not belong to the same broadcast domain and cannot communicate directly. They need to pass through Layer 3 devices to communicate.

2. Working principle of vlan

The VLAN division is actually the division of the mac address table. Each vlan corresponds to a mac address table. By dividing the physical ports into different VLANs, the isolation of the broadcast domain (mac address table) is realized. By default, all ports of the switch belong to vlan1.

VLAN link and port type

There are two types of vlan links: Access Link (access link), Trunk Link (trunk link)

Access Link: There is an access link between the host and the switch, and the data frames forwarded by it do not carry labels.

Trunk Link: The link between switches uses a trunk link, and the trunk link generally transmits tagged data frames (PVID VLAN does not carry tags)

1.Access port

in the incoming direction of the traffic

①When the Access port receives an unlabeled data frame (original data frame), it will mark the data frame with a PVID label.

② When the Access port receives a tagged data frame, it will check whether the VLAN ID in the tag of the data frame is consistent with the PVID of the Access port. If they are consistent, the data frame will be received, and if not, the data frame will be discarded.

in the outbound direction

When an Access port sends a tagged data frame, it will first strip the VLAN tag in the data frame and restore it to the original data frame before sending.

2.Trunk port

in the incoming direction of traffic

①When the Trunk port receives an untagged data frame, it will mark the data frame with the VLAN tag of the port PVID. ② When the Trunk port receives a tagged data frame, it compares the VLAN ID in the tag with the VLAN list (ie Tagged List) that the Trunk port allows to pass through. If it is allowed to pass through, the data frame is received, otherwise the data frame is discarded.

in the outbound direction

① When a Trunk port forwards a tagged data frame, it will compare the VLAN ID in the tag with the VLAN list allowed by the Trunk port (ie Tagged List). ② If the data frame sent from the Trunk port has a tag (Tag), and the tag (Tag) is the same as the PVID, the device will strip the tag in the data frame. Only in this case, the Trunk port sends the frame untagged.

3.Hybrid port

in the incoming direction

① When the Hybrid port receives an untagged data frame, it will add the VLAN tag of the port PVID to the data frame. (2) When the Hybrid port receives a tagged data frame, the VLAN ID in the tag is compared with the Tagged List and Untagged List of the Hybrid port. If the VLAN ID exists in the list, the data frame is received, otherwise the Data Frame is discarded.

in the outbound direction

① When the Hybrid port sends a tagged data frame, if the VLAN ID in the tag is in the Untagged List of the Hybrid port, the tag will be stripped and the data frame will be restored to a normal data frame before forwarding. ② When the Hybrid port sends a tagged data frame, if the VLAN ID in the tag is in the Hybrid port Tagged List, the data frame will be forwarded.

1.VLAN division example

[Huawei]interface Ethernet 0/0/1
[Huawei-Ethernet0/0/1]port link-type access 
[Huawei-Ethernet0/0/1]port default vlan 10
[Huawei]interface Ethernet 0/0/2
[Huawei-Ethernet0/0/2]port link-type access 
[Huawei-Ethernet0/0/2]port default vlan 10
[Huawei]interface Ethernet0/0/3
[Huawei-Ethernet0/0/3]port link-type access 
[Huawei-Ethernet0/0/3]port default vlan 10
[Huawei]dis vlan    //view vlan
--------------------------------------------------------------------------------

VID  Type    Ports                                                          
--------------------------------------------------------------------------------
1    common  UT:Eth0/0/4(D)     Eth0/0/5(D)     Eth0/0/6(D)     Eth0/0/7(D)     
                Eth0/0/8(D)     Eth0/0/9(D)     Eth0/0/10(D)    Eth0/0/11(D)    
                Eth0/0/12(D)    Eth0/0/13(D)    Eth0/0/14(D)    Eth0/0/15(D)    
                Eth0/0/16(D)    Eth0/0/17(D)    Eth0/0/18(D)    Eth0/0/19(D)    
                Eth0/0/20(D)    Eth0/0/21(D)    Eth0/0/22(D)    GE0/0/1(D)      
                GE0/0/2(D)                                                      

10   common  UT:Eth0/0/1(U)     Eth0/0/2(U)     Eth0/0/3(U)                     

VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------
1    enable  default       enable  disable    VLAN 0001                         
10   enable  default       enable  disable    VLAN 0010    
copy

2.Access port and Trunk port experiment (use ping to verify the success of the experiment)

Configuration of sw1 (use dis vlan to view the configuration)

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan batch 10 20	    //create vlan 10 20
[Huawei]interface Ethernet 0/0/1
[Huawei-Ethernet0/0/1]port link-type access 	//switch to access mode
[Huawei-Ethernet0/0/1]port default vlan 10	    //join to vlan10
[Huawei]interface Ethernet 0/0/2
[Huawei-Ethernet0/0/2]port link-type access 
[Huawei-Ethernet0/0/2]port default vlan 20
[Huawei-Ethernet0/0/2]int g 0/0/1	
[Huawei-GigabitEthernet0/0/1]port link-type trunk     //Switch to trunk mode
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20    //join to vlan10 20
copy

SW2 configuration

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]interface Ethernet 0/0/1
[Huawei-Ethernet0/0/1]port link-type access 
[Huawei-Ethernet0/0/1]port default vlan 20
[Huawei-Ethernet0/0/1]qu
[Huawei]interface Ethernet 0/0/2
[Huawei-Ethernet0/0/2]port link-type access 
[Huawei-Ethernet0/0/2]port default vlan 10
[Huawei-Ethernet0/0/2]qu
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk 
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20
copy

Hybrid experiment

sw1 configuration

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan batch 10 20 100
[Huawei]interface Ethernet 0/0/1
[Huawei-Ethernet0/0/1]port hybrid untagged vlan 10 100	
[Huawei-Ethernet0/0/1]port hybrid pvid vlan 10	
[Huawei]interface Ethernet 0/0/2
[Huawei-Ethernet0/0/2]port hybrid untagged vlan 20 100
[Huawei-Ethernet0/0/2]port hybrid pvid vlan 20
[Huawei-Ethernet0/0/2]qu
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]port hybrid tagged vlan 10 20 100
[Huawei-GigabitEthernet0/0/1]display vlan
The total number of vlans is : 4
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------

VID  Type    Ports                                                          
--------------------------------------------------------------------------------
1    common  UT:Eth0/0/1(U)     Eth0/0/2(U)     Eth0/0/3(D)     Eth0/0/4(D)     
                Eth0/0/5(D)     Eth0/0/6(D)     Eth0/0/7(D)     Eth0/0/8(D)     
                Eth0/0/9(D)     Eth0/0/10(D)    Eth0/0/11(D)    Eth0/0/12(D)    
                Eth0/0/13(D)    Eth0/0/14(D)    Eth0/0/15(D)    Eth0/0/16(D)    
                Eth0/0/17(D)    Eth0/0/18(D)    Eth0/0/19(D)    Eth0/0/20(D)    
                Eth0/0/21(D)    Eth0/0/22(D)    GE0/0/1(U)      GE0/0/2(D)      

10   common  UT:Eth0/0/1(U)                                                     
             TG:GE0/0/1(U)                                                      
20   common  UT:Eth0/0/2(U)                                                     
             TG:GE0/0/1(U)                                                      

100  common  UT:Eth0/0/1(U)     Eth0/0/2(U)                                     
             TG:GE0/0/1(U)                                                      


VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------
1    enable  default       enable  disable    VLAN 0001                         
10   enable  default       enable  disable    VLAN 0010                         
20   enable  default       enable  disable    VLAN 0020                         
100  enable  default       enable  disable    VLAN 0100     
copy

sw2 configuration

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan batch 10 20 100
Info: This operation may take a few seconds. Please wait for a moment...done.	
[Huawei]interface Ethernet 0/0/1	
[Huawei-Ethernet0/0/1]port hybrid untagged vlan 10 20 100	
[Huawei-Ethernet0/0/1]port hybrid pvid vlan 100
[Huawei-Ethernet0/0/1]qu
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]port hybrid tagged vlan 10 20 100
[Huawei-GigabitEthernet0/0/1]dis vlan
The total number of vlans is : 4
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------

VID  Type    Ports                                                          
--------------------------------------------------------------------------------
1    common  UT:Eth0/0/1(U)     Eth0/0/2(D)     Eth0/0/3(D)     Eth0/0/4(D)     
                Eth0/0/5(D)     Eth0/0/6(D)     Eth0/0/7(D)     Eth0/0/8(D)     
                Eth0/0/9(D)     Eth0/0/10(D)    Eth0/0/11(D)    Eth0/0/12(D)    
                Eth0/0/13(D)    Eth0/0/14(D)    Eth0/0/15(D)    Eth0/0/16(D)    
                Eth0/0/17(D)    Eth0/0/18(D)    Eth0/0/19(D)    Eth0/0/20(D)    
                Eth0/0/21(D)    Eth0/0/22(D)    GE0/0/1(U)      GE0/0/2(D)      

10   common  UT:Eth0/0/1(U)                                                     
             TG:GE0/0/1(U)                                                      
20   common  UT:Eth0/0/1(U)                                                     
             TG:GE0/0/1(U)                                                      

100  common  UT:Eth0/0/1(U)                                                     
             TG:GE0/0/1(U)                                                      


VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------
1    enable  default       enable  disable    VLAN 0001                         
10   enable  default       enable  disable    VLAN 0010                         
20   enable  default       enable  disable    VLAN 0020                         
100  enable  default       enable  disable    VLAN 0100                         
[Huawei-GigabitEthernet0/0/1]
copy

Publisher: Full stack programmer, please indicate the source: https://javaforall.cn/169387.html Original link: https://javaforall.cn

Tags: access

Posted by daredevil88 on Thu, 22 Sep 2022 21:25:29 +0300