What is a VLAN
VLAN or virtual Lan is a technology to virtually segregate ports into one single broadcast domain. You don’t have to configure a VLAN until your network gets so large and has so much traffic or groups of users need more security and need to be separated with rest of traffic.
VLAN or virtual Lan is a technology to virtually segregate ports into one single broadcast domain. You don’t have to configure a VLAN until your network gets so large and has so much traffic or groups of users need more security and need to be separated with rest of traffic.
On a Cisco switch, VLAN’s are enabled by default and ALL ports are by default in VLAN 1. Without configuring we can just use all the ports and we will be able to communicate.
Devices in different VLAN's can communicate with the help of a router or a layer3 switch.
When do we need a VLAN
We need VLAN's in following situations :
- We have more than 200 devices on the LAN.
- Group of users need more security and wants to be separated from rest of the traffic.
- We have a lot of broadcast traffic on the LAN.
- We want to divide the switch into multiple virtual switches.
Why cannot we Subnet a network than using VLAN's
This is the most common question every learner has.
The advantage of having VLAN's is that devices at different physical locations, not going back to the same router, can be on the same network.
The limitation of subnetting a network with a router is that all the devices on that subnet must be connected to the same switch and that switch should be connected to a port on the router.
How to create a VLAN and assign ports
Lets say we want to create VLAN's 4 and 6. Assign the port fa0/1 in vlan4 (accounts) and port fa 0/2 in vlan6 (sales).
Router#configure terminal
Router(config)#vlan 4
Router(config-vlan)#name Accounts
Router(config-vlan)#exit
Router(config)#vlan 6
Router(config-vlan)#name Sales
Router(config-vlan)#exit
Router(config)#interface fa0/1
Router(config-if)#description Accounts
Router(config-if)#description Accounts
Router(config-if)#switchport mode access
Router(config-if)#switchport access vlan 4
Router(config-if)#interface fa0/2
Router(config-if)#description Sales
Router(config-if)#description Sales
Router(config-if)#switchport mode access
Router(config-if)#switchport access vlan 6
A VLAN is equal to a Subnet. This means that if we have two VLANS, We have at least two subnets. We can have more than one subnet in a single VLAN, but we cannot have one subnet in multiple VLANS.