Switch configuration VLAN (Cisco simulator implementation)

1. New projects

Just open the Cisco simulator here
Insert image description here

2. Build network topology

1. Create a switch

After creating the project, build the network topology. First create two switches here.
Insert image description here

2. Connect to the switch

After creating the switch, connect the two switches through a crossover cable
Insert image description here

3. Create a host

Insert image description here
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

Insert image description here
Insert image description here
Also use straight-through cables to connect the other hosts to the switch.

  1. Host PC0 is connected to port 1 of switch Siwtch0
  2. Host PC1 is connected to port 2 of switch Siwtch0
  3. Host PC2 is connected to port 1 of switch Siwtch1
  4. Host PC3 is connected to port 2 of switch Siwtch1

After the connection is completed, it is as shown in the figure:
Insert image description here

3. Configure the address

1. Configure the host IP address

To pingfigure it out, first let each host have its own IP address
Insert image description here

Insert image description here
Use the same method to configure the IP addresses of the remaining three hosts.
Insert image description here

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
Insert image description here

  1. Enter in the command line interface enableor enenter privileged mode
  2. When #the symbol appears, it means you have entered the command line mode. Then enter configurethe configuration mode and press Enter.
    Insert image description here

①. Create VLAN2

  1. Enter vlan 2the command to create vlan2
  2. After creating vlan2, enter name vlan2the command to rename vlan2
  3. After renaming, enter to exitexit LAN configuration mode
  4. Enter interface f0/1the command to configure the f0/1 interface
  5. Enter switchport mode accessthe command to change the f0/1 interface to access mode
  6. Enter switchport access vlan 2the command to assign the f0/1 interface to vlan2
  7. Execute exitto exit the configuration of vlan2

Insert image description here

③. 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.

  1. Enter vlan 3the command to create vlan3
  2. After creating vlan3, enter name vlan3the command to rename vlan3.
  3. After renaming, enter to exitexit LAN configuration mode
  4. Enter interface f0/2the command to configure the f0/2 interface
  5. Enter switchport mode accessthe command to change the f0/2 interface to access mode
  6. Enter switchport access vlan 3the command to assign the f0/2 interface to vlan3
  7. Execute exitto exit the configuration of vlan3

Insert image description here

③. 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.

  1. Enter interface f0/3the command to configure the f0/3 interface
  2. Enter switchport mode trunkthe command to configure the current f0/3 port as Trunk mode

Insert image description here

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

  1. Enter vlan 2the command to create vlan2
  2. After creating vlan2, enter name vlan2the command to rename vlan2
  3. After renaming, enter to exitexit LAN configuration mode
  4. Enter interface f0/1the command to configure the f0/1 interface
  5. Enter switchport mode accessthe command to change the f0/1 interface to access mode
  6. Enter switchport access vlan 2the command to assign the f0/1 interface to vlan2
  7. Execute exitto exit the configuration of vlan2

Insert image description here

②. 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.

  1. Enter vlan 3the command to create vlan3
  2. After creating vlan3, enter name vlan3the command to rename vlan3.
  3. After renaming, enter to exitexit LAN configuration mode
  4. Enter interface f0/2the command to configure the f0/2 interface
  5. Enter switchport mode accessthe command to change the f0/2 interface to access mode
  6. Enter switchport access vlan 3the command to assign the f0/2 interface to vlan3
  7. Execute exitto exit the configuration of vlan3

Insert image description here

③. 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.

  1. Enter interface f0/3the command to configure the f0/3 interface
  2. Enter switchport mode trunkthe command to configure the current f0/3 port as Trunk mode
  3. Enter exitthe command to exit the configuration of the current f0/3 port

Insert image description here

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?
Insert image description here
ping 主机PC2的IP地址
Insert image description here

Insert image description here

Guess you like

Origin blog.csdn.net/qq_48455576/article/details/121862673