CREATION OF VLAN AND TRUNKING
A VLAN (virtual LAN) is a subnetwork which can group together collections of devices on separate physical local area networks (LANs).VLAN is a custom network which is created from one or more local area networks. It enables a group of devices available in multiple networks to be combined into one logical network. The result becomes a virtual LAN that is administered like a physical LAN.
USE OF VLAN :
A VLAN allows you to segment a network without needing separate hardware. So, you can have a single physical switch, but multiple different networks connected. You can group computers, servers, or other resources into a network based on department or user type. It doesn't have to be based entirely on physical location.
Switch 1
CLI
Switch>
Switch>en
Switch#show vlan brief
Configuring VLAN
Switch#config t
Switch(config)#vlan 10
Switch(config-vlan)#name Students
Switch(config-vlan)#vlan 20
Switch(config-vlan)#name Faculty
Switch(config-vlan)#vlan 30
Switch(config-vlan)#name IT
Switch(config-vlan)#exit
Switch#show vlan brief
We see the name of VLAN but ports are not assigned.
Switch 2
CLI
Switch>
Switch>en
Switch#show vlan brief
Switch#config t
Switch(config)#vlan 10
Switch(config-vlan)#name Students
Switch(config-vlan)#vlan 20
Switch(config-vlan)#name Faculty
Switch(config-vlan)#exit
Switch(config)#exit
Switch#
Switch#show vlan brief
To assign port to VLAN and make it access port
Switch 1
Switch#config t
Switch(config)#int fa0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#int fa0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#int fa0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 30
Switch(config-if)#exit
Switch(config)#exit
Switch#
Switch#show vlan brief
Switch 2
Switch#config t
Switch(config)#int fa0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#int fa0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#exit
Switch#
Switch#show vlan brief
Assign Ip to desktop
Vlan 10
Pc0
Ip address: 10.0.0.1
Subnet mask: 255.0.0.0
Pc3
Ip address: 10.0.0.2
Subnet mask: 255.0.0.0
Vlan 20
Pc1
Ip:192.168.10.1
255.255.255.0
Pc4
Ip:192.168.10.2
255.255.255.0
Vlan 30
Pc2
Ip:192.168.100.1
255.255.255.0
Pc0 and pc3 are on same vlan and if we try to ping them but they will not connect. Switch to switch connection has not been done.so we will make them trunk.
switch 1
Switch>
Switch>en
Switch#config t
Switch(config)#int fa0/4
Switch(config-if)#switchport mode trunk
Switch(config-if)#
SWITCH 2
Switch>
Switch>en
Switch#config t
Switch(config)#int fa 0/4
Switch(config-if)#switchport mode trunk
Switch(config-if)#
Switch(config-if)#exit
Switch(config)#exit
Switch#
Switch#
Switch#
Switch#show interface trunk
After trunking we get the reply from two pc in one vlan.