Article Directory
1. Vlan benefits/functions
●Dividing broadcast domains
●Easy to manage
●Safe
1.1 Three elements of MAC address table:
●VlanID
●MAC address
●port number
The number of VLANs supported by Huawei is 1-4094
vlan: virtual local area network
untagged: A table from which the switch will release the specified label.
tagged: A list that is unconditionally released when certain specified VLANs (with tags) pass through the switch.
pvid: tag
2. The switch has different interface modes according to the connection object
1. Access access mode-computer: an interface can only be divided into one Vlan.
2. Trunk trunk link mode-switch: By default, only Vlan is allowed to pass other Vlan traffic and needs to be manually released.
3.hybrid mixed mode-computer/switch
2.1 Access:
Features: There is and can only belong to one Vlan.
交换机WS1:
[ws1]vlan bat 2 3
[ws1]int e0/0/1
[ws1-Ethernet0/0/1]port link-type access
[ws1-Ethernet0/0/1]port default vlan 2
[ws1]int e0/0/2
[ws1-Ethernet0/0/2]port link-type access
[ws1-Ethernet0/0/2]port default vlan 3
2.2 Trunk:
Features: It can carry the traffic of multiple VLANs.
Topology
Configuration file:
SW1:
[sw1]vlan batch 10 20
[sw1]interface Ethernet0/0/1
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/1]port default vlan 10
[sw1]interface Ethernet0/0/2
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/2]port default vlan 20
[sw1]interface Ethernet0/0/3
[sw1-Ethernet0/0/3]port link-type trunk
[sw1-Ethernet0/0/3]port trunk allow-pass vlan 10 20
SW2 :
[sw2]vlan batch 10 20
[sw2]interface Ethernet0/0/1
[sw2-Ethernet0/0/1]port link-type access
[sw2-Ethernet0/0/1]port default vlan 10
[sw2]interface Ethernet0/0/2
[sw2-Ethernet0/0/2]port link-type access
[sw2-Ethernet0/0/2]port default vlan 20
[sw2]interface Ethernet0/0/3
[sw2-Ethernet0/0/3]port link-type trunk
[sw2-Ethernet0/0/3]port trunk allow-pass vlan 10 20
Use PC1 to ping PC3
2.3 hybrid
Features: Mixed interface, you can choose to work with access or trunk interface attributes
Topology:
Configuration file:
SW1
sysname sw1
vlan batch 10 20 100
interface Ethernet0/0/1
port hybrid pvid vlan 10
port hybrid untagged vlan 10 100
interface Ethernet0/0/2
port hybrid pvid vlan 20
port hybrid untagged vlan 20 100
interface GigabitEthernet0/0/1
port hybrid tagged vlan 10 20 100
SW2
sysname sw2
vlan batch 10 20 100
interface Ethernet0/0/1
port hybrid pvid vlan 10
port hybrid untagged vlan 10 100
interface Ethernet0/0/2
port hybrid pvid vlan 20
port hybrid untagged vlan 20 100
interface GigabitEthernet0/0/1
port hybrid tagged vlan 10 20 100
interface Ethernet0/0/3
port hybrid pvid vlan 100
port hybrid untagged vlan 10 20 100
PC1去ping一下Server1
Client access Server1