In this article we will talk about vlan basic configuration on cisco catalyst switches. We will use cisco packet tracer in our lesson to demonstrate the network topology for vlan setup.
Let consider in out simple network topology there are two PCs connected to a switch. Also consider PC0’s FastEthernet connected to switch port fa0/1, and Laptop0’s FastEthernet connected to the switchport fa3/1. Now we will configure two different vlans and enable this two switch_ports associated with two different vlans. So that two PCs in the same switch will be in two separated local area network. Firstly Lets create vlan 10 and vlan 20. Next we will assign two different ports on to that two different vlans.
VLAN Basic Configuration
So click on the switch icon in packet tracer, then from the popup window go to CLI tab. Next type enable to go to privileged exec mode. Then type: config t to enter into global configuration interface (config-if)#. Now to create new vlan type vlan name, in this case I named it vlan 10. To assign an ip address to vlan 10 type: interface vlan 10 then press enter. Type: ip address 192.168.1.2 255.255.255.0. Then type: no shutdown to initiate the vlan 10. Press ctrl^z to exit. Assigning ip to vlan is optional, because switch is a layer-2 device. Therefore it is not necessary for layer-2 devices to have layer-3 network addresses. But sometimes we assign an ip address to configure the switch remotely using SSH or telnet(insecure, because communication isn’t encrypted). Note that VLAN 1 is the default vlan on cisco devices, therefore for security purpose we should not assign ip address on that default vlan.
Hence to assign switch port fa0/1 to vlan 10 we will write the following commands.
switch_name(config-if) #switchport mode access
switch_name(config-if) #switchport access vlan 10
This will assign assign the PC0 to vlan 10. Similarly we can create another vlan namely vlan 20 and then then assign fa3/1, Laptop0 to that vlan. Assigning different hosts to different vlans will separate them in two virtual network. Consequently they will become unable to communicate in the local area network.
Now to setup two PCs click on the PC0 icon in the packet tracer. From the popup window go to desktop tab and click on ip configuration and type ip: 192.168.1.10 and 255.255.255.0 as subnet mask. Follow the similar process for Laptop0 to setup ip: 192.168.2.20 and subnet mask 255.255.255.0. Hence this two PCs are now in two different network. So if we try to ping PC0 to Laptop0 then we will be unable pining.
Next we will see how to set up trunk port on the switch and connect the switch to the router through the trunk port.
not revised version