[Cisco + Packet Tracer] Building a VLAN Network Using Switch in Packet Tracer

1. Open the Packet Tracer
2. Add a switch and four end devices (PC) to the workspace.

3. Link the router to each PC with copper straight-trough cable.



4. Click the switch, then a window will open. Go to CLI tab.
5. if you are not in the priviledge mode (switch#), type "enable"
6. Configure the VLAN:
switch#configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#name BOSS //your desired VLAN name
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name MARKETING //your desired VLAN name
Switch(config-vlan)#exit
(press ctrl-z)

Switch(config)#interface f0/1 //you can shorten the command to int f0/1, f0/1 is the port where the PC is connected to.
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#interface f0/2

Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#interface f0/3

Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#interface f0/4

Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
(press ctrl-z)
Switch#

7. Set the IP address for each PC, for example:
PC 1 VLAN 10 = 10.10.10.1
PC 2 VLAN 10 = 10.10.10.2
PC 3 VLAN 20 = 20.20.20.1
PC 4 VLAN 20 = 20.20.20.2

8. Check if the connections are working, ping the PC with the same VLAN ID, it should work. Remember that different VLAN can't communicate. If you want each VLAN ID can communicate with each other than add a router (covered in my next tutorial).



No comments:

Post a Comment