Article directory
1. New projects
Just open the Cisco simulator here
2. Build network topology
1. Create a switch
After creating the project, build the network topology. First create two switches here.
2. Connect to the switch
After creating the switch, connect the two switches through a crossover cable
3. Create a host
After creating the host, the next thing to do is to use a straight-through cable to connect the host and the switch.
4. Connect the host and switch
Also use straight-through cables to connect the other hosts to the switch.
- Host PC0 is connected to port 1 of switch Siwtch0
- Host PC1 is connected to port 2 of switch Siwtch0
- Host PC2 is connected to port 1 of switch Siwtch1
- Host PC3 is connected to port 2 of switch Siwtch1
After the connection is completed, it is as shown in the figure:
3. Configure the address
1. Configure the host IP address
To ping
figure it out, first let each host have its own IP address
Use the same method to configure the IP addresses of the remaining three hosts.
2. Configure the switch address
After configuring the IP address of the host, proceed to configure the switch address. Here we use the command to configure
- Enter in the command line interface
enable
oren
enter privileged mode - When
#
the symbol appears, it means you have entered the command line mode. Then enterconfigure
the configuration mode and press Enter.
①. Create VLAN2
- Enter
vlan 2
the command to create vlan2 - After creating vlan2, enter
name vlan2
the command to rename vlan2 - After renaming, enter to
exit
exit LAN configuration mode - Enter
interface f0/1
the command to configure the f0/1 interface - Enter
switchport mode access
the command to change the f0/1 interface to access mode - Enter
switchport access vlan 2
the command to assign the f0/1 interface to vlan2 - Execute
exit
to exit the configuration of vlan2
③. Create VLAN3
After we create a vlan2, we continue to create a vlan3. We still follow the same steps for configuration. At this time, we need to give the right to use the f0/2 interface to vlan3.
- Enter
vlan 3
the command to create vlan3 - After creating vlan3, enter
name vlan3
the command to rename vlan3. - After renaming, enter to
exit
exit LAN configuration mode - Enter
interface f0/2
the command to configure the f0/2 interface - Enter
switchport mode access
the command to change the f0/2 interface to access mode - Enter
switchport access vlan 3
the command to assign the f0/2 interface to vlan3 - Execute
exit
to exit the configuration of vlan3
③. Configure f0/3 as Trunk mode
After configuring vlan2 and vlan3 of the current switch, you also need to configure the f0/3 interface connecting the two switches to Trunk mode.
- Enter
interface f0/3
the command to configure the f0/3 interface - Enter
switchport mode trunk
the command to configure the current f0/3 port as Trunk mode
3. Configure another switch
Use the same steps to configure another switch. How to open the command interface of another switch and enter the privileged mode for configuration will not be repeated here.
①. Create VLAN2
- Enter
vlan 2
the command to create vlan2 - After creating vlan2, enter
name vlan2
the command to rename vlan2 - After renaming, enter to
exit
exit LAN configuration mode - Enter
interface f0/1
the command to configure the f0/1 interface - Enter
switchport mode access
the command to change the f0/1 interface to access mode - Enter
switchport access vlan 2
the command to assign the f0/1 interface to vlan2 - Execute
exit
to exit the configuration of vlan2
②. Create VLAN3
After we create a vlan2, we continue to create a vlan3. We still follow the same steps for configuration. At this time, we need to give the right to use the f0/2 interface to vlan3.
- Enter
vlan 3
the command to create vlan3 - After creating vlan3, enter
name vlan3
the command to rename vlan3. - After renaming, enter to
exit
exit LAN configuration mode - Enter
interface f0/2
the command to configure the f0/2 interface - Enter
switchport mode access
the command to change the f0/2 interface to access mode - Enter
switchport access vlan 3
the command to assign the f0/2 interface to vlan3 - Execute
exit
to exit the configuration of vlan3
③. Configure f0/3 as Trunk mode
In the same way as configuring the switch just now, here we also configure the f0/3 port of the current switch to Trunk mode.
- Enter
interface f0/3
the command to configure the f0/3 interface - Enter
switchport mode trunk
the command to configure the current f0/3 port as Trunk mode - Enter
exit
the command to exit the configuration of the current f0/3 port
4. Test whether the network is connected
Here we use the hosts PC0 and PC2 to test (because PC0 and PC2 are both in vlan2 at this time), and test whether they can communicate ping
. Can the hosts PC1 and PC3 be pinged?
ping 主机PC2的IP地址