[Cisco Packet Tracer| 4. Cross-switch VLAN experiment]

1. Connect to the experimental topology map and set the host IP address

image-20230421000313914

Analog instrument: two switches, four hosts, the four hosts are located in the same network segment, among which PC0 and PC2 are in VLAN2, and PC1 and PC3 are in VLAN3

Connecting cable: Direct-connected twisted pair cables are used between the host and the switch, and crossed twisted pair cables are used between the switches.

Steps to connect the experimental topology diagram:

  1. Connection experiment topology diagram
  2. Set host IP address

1. Connection experimental topology diagram

Between host and switch:

image-20230421000944029

Switch to switch:

image-20230421001153235

2. Set the IP address of the host

image-20230421001338194

2. Test whether ping is successful before dividing VLAN

Principle: Since the four hosts are in the same network segment and are not divided into VLANs, the four hosts should be able to ping each other.

The necessity of testing connectivity before dividing VLANs: After dividing VLANs, they are originally on the same network segment, but there is no communication in different VLANs.

Here we select PC0 as the source host, and pingPC1 and PC2 as tests.

image-20230421001624979

Test result:successful

3. Divide VLANs

1. Assign VLANs to hosts

The setting method here is the same as the setting method in my previous blog [Cisco Packet Tracer | 3. Single switch VLAN division]. I won’t go into details here. I only give a few key tips here.

Switch(config-vlan)#interface f0/1
Switch(config-if)#switchport access vlan 2

image-20230421002252385

In the same way, complete the VLAN division of the other three hosts.

After the division is completed, you can use show vlan in privileged mode to view the relationship between the ports of each switch and the VLAN.

image-20230421002546041

2. Switch the f0/24 port between the switches from Access mode to Trunk mode

The difference between the two modes of the switch:

Access mode: Only data under one VLAN can pass between switches

Trunk mode: Data under any VLAN can pass between switches

Method 1: Manual switching

image-20230421002951281

Command line code switching under CLI:

Switch(config)#interface FastEthernet0/24

Switch(config-if)#switchport mode trunk

image-20230421003243451

In principle, here we need to set the f0/24 ports of the two switches to Trunk mode, but we only switched the mode of one switch, and the Cisco simulation software automatically helped us switch the mode of the other switch. .image-20230421003636019

4. After dividing the VLAN, test whether the ping is successful.

image-20230421004130665

Test result:successful

5. Another way to test-envelope icon

image-20230421004255240

Guess you like

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