VLAN and Trunk configuration of switch
For the purpose of configuring switches vlan and Trunk to achieve communication between different switches with the same vlan use ensp to build an experimental environment, as shown in the figure step 1) configure the first switch
01 [SW1] vlan5 create vlan5
02 [SW1] vlan10 create vlan10
03 [SW1] interface Ethernet0/0/1
04 [SW1-Ethernet0/0/1] port link-type access port mode is access mode
05 [SW1-Ethernet0/0/1] port default vlan5 port belongs to vlan5
06 SW1] interface Ethernet0/0/2
07 [SW1-Ethernet0/0/2] port link-type access
08 [SW1-Ethernet0/0/2] port default vlan 10
09 [SW1] interface Ethernet0/0/24
10 [SW1-Ethernet0/0/24] port link-type trunk port is set to trunk mode
11 [SW1-Ethernet0/0/24] port trunk allow-pass vlan5 10 port allows vlan5 and vlan10 to pass through
2) configure the second switch
01 [SW2] vlan 5
02 [SW2] vlan 10
03 [SW2] interfae Ethernet0/0/3
04 [SW2-Ethernet0/0/3] port link-type access
05 [SW2-Ethernet0/0/3] port default vlan 5
06 [SW2] interface Ethernet0/0/4
07 [SW2-Ethernet0/0/4] port link-type access
08 [SW2-Ethernet0/0/4] port default vlan 10
09 [SW2] interface Ethernet0/0/24
10 [SW2-Ethernet0/0/24] port link-type trunk
11 [SW2-Ethernet0/0/24] port trunk allow-pass vlan 5 10
3) Test
The vlan5 of different switches can ping, and the vlan10 of different switches can ping.
Vlan5 and vlan10 cannot communicate with each other