[Cisco Packet Tracer| 3. Single switch VLAN division]

1. Experimental principle

image-20230420204409375

Principle: A single switch connects 4 hosts and divides them into two VLANs. Two hosts in the same VLAN can communicate with each other.

2. Connection experimental topology diagram

1. Connect the host and switch

image-20230420205247287image-20230420205256399

image-20230420205132204

2. Set IP addresses for four hosts

image-20230420204814403

3. Check whether the 4 hosts can ping each other without dividing into VLANs.

Principle: Check whether 4 hosts can ping each other without dividing into VLANs.

image-20230420205712520

ps:

After pinging, we can rename the switch in global mode, or make modifications directly on the topology map

4. Create and divide VLANs

1.Create VLAN

In the global mode of the switch, create and enter VLAN2, then return to the global mode, repeat the above operations, and complete the creation of the VLAN.

image-20230420210457860

image-20230420210655487

2. Divide VLANs

Principle: As shown in show vlan, by default all ports of the switch are classified into VLAN1, so we need to reclassify VLAN. According to our previous topology diagram, we need to divide F0/1 and F0/2 here. All ports are reclassified to VLAN2, and F0/3 and F0/4 are reclassified to VLAN3.

Let’s review the mode switching diagram again:

image-20230416220005597

Operation steps: So we need to enter the interface configuration mode, and then divide the entered port into VLAN2 or VLAN3 according to the topology map

Switch(config)#vlan 3   #创建vlan
Switch(config-vlan)#exit  # 退出全局模式
Switch(config)#interface f0/2  #进入接口配置模式
Switch(config-if)#switchport access vlan 3 #将所在接口划分到vlan3

image-20230420212504925

The final topology map after the division is completed

image-20230420232532808

5. After dividing the VLAN, check whether the 4 hosts can ping successfully.

Expected results: After dividing the VLAN, since the switch ports of PC0 and PC1 are in the same VLAN, they should be able to ping each other. Similarly, PC2 and PC3 can also ping each other; but between PC0 and PC2 It's impossible to ping

image-20230420232010175

Guess you like

Origin blog.csdn.net/qq_64428099/article/details/130278096