Article directory
1. Connect to the experimental topology map and set the host IP address
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:
- Connection experiment topology diagram
- Set host IP address
1. Connection experimental topology diagram
Between host and switch:
Switch to switch:
2. Set the IP address of the host
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.
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
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.
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
Command line code switching under CLI:
Switch(config)#interface FastEthernet0/24
Switch(config-if)#switchport mode trunk
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. .
4. After dividing the VLAN, test whether the ping is successful.
Test result:successful