VLAN learning

VLAN learning

VLAN is a virtual local area network, which is used to solve the broadcast storm formed when multiple switches are connected and divide the broadcast domain. There are two partitioning methods, one is static VLAN, which is based on port division, which is physical division, and the other is dynamic VLAN, which is based on MAC address division, which is logical division.

Advantages of VLAN :

Divide the broadcast domain

Easy to manage

Safety

Range of VLAN :

Our available VLAN range is 1-4094

 

VLAN commands in the switch :

View vlan

[ sw1]dis vlan

Add to

[sw1]vlan 10[ sw1-vlan10]q batch add

[ sw1]vlan batch 20 30 40

delete

[ Sw1 ] undo vlan 10

#####Add port to VLAN, Access port can only belong to 1 VLAN, generally used to connect to computer port. [Huawei]int e0/07o (enter interface mode)

[Huawei-Ethernet0/0/0]port link-type access

(Define Layer 2 Port Mode>

[Huawei-Ethernet0/0/0] port default vlan 10

(Add the port to the vlan)

[Huawei-Etherneto/0/0]undo shutdown

Remove port from vlan

[Huawei-Ethernet0/0/0]undo port default vlan[Huawei-Ethernet0/0/0]port iink-type hybrid

(Restore the port type to the default hybrid)

View current port mode and status

[Huawei-Ethernet0/0/0]dis this

Interface mode :

The switch selects different interface modes according to the connection object

1.Access: access mode, one interface can only be divided into one LAN

[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type access
[Huawei-Ethernet0/0/1]port default vlan 10
[Huawei-Ethernet0/0/1]undo shutdown

 

2.Trunk: trunk link mode, generally used for switches and switch-related ports

[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all vlan can be followed by vlan allowed to pass, here all Allow all vlan to pass

3. Hybrid: Hybrid mode, unique to Huawei. Huawei switch interface defaults to Hybrid mode;
it can realize the function of Access interface and Trunk interface
; it can realize cross-VLAN communication and access control without the help of three-layer equipment;
it has higher performance than Access interface and Trunk interface. Flexibility and controllability.

Hybrid can join a VLAN or multiple VLANs in tagged or untagged mode as required.

Hybrid mental formula:
Data frame export inspection: check the untag table, if there is a standard, off the standard; when there is no standard, check the tag table, if there is one, let it go, if not, then discard it.
Data frame import inspection: first check whether there is a label, if there is a label, check the tag table, if there is a mark, let it go, if there is no mark, it will be discarded; if there is no mark, after the PVID is marked, let it go

 

Guess you like

Origin blog.csdn.net/Alen686/article/details/112168548