Configuration of Virtual Local Area Network (VLANs)

Virtual Local Area Network (VLAN)

Virtual Local Area Network (VLAN) is broadcast domain that is used to isolate a network at layer 2 (Data Link Layer) of OSI model. Virtual Local Area Network (VLAN) is used to divide major network into sub networks to increase the performance of network.

All the interfaces of network devices are assigned to vlan 1 by default. To assign interfaces to newly created vlans following commands are used.

Configurations

VLANs
Switch>enable
Switch#configure terminal
Switch(config)#hostname TestSwitch
TestSwitch(config)#enable password cisco (Plain Text Password)
TestSwitch(config)#enable secret class (Encrypted Password)
TestSwitch(config)#username TestSwitch secret cisco
TestSwitch(config)#ip domain-name cisco.com
TestSwitch(config)#crypto key generate rsa
(Set key between 360 - 2048)
TestSwitch(config)#line console 0
TestSwitch(config-line)#password cisco
TestSwitch(config-line)#login
TestSwitch(config-line)#exit
TestSwitch(config)#line vty 0 15
TestSwitch(config-line)#transport input ssh
TestSwitch(config-line)#login local
TestSwitch(config-line)#exit
TestSwitch(config)#interface vlan 1
TestSwitch(config-if)#ip address 192.168.1.254 255.255.255.0
TestSwitch(config-if)#no shutdown
TestSwitch(config-if)#exit

!Creating VLANs

TestSwitch(config)#vlan 2
TestSwitch(config-vlan)#name Admin
TestSwitch(config-vlan)#exit
TestSwitch(config)#vlan 3
TestSwitch(config-vlan)#name Management
TestSwitch(config-vlan)#exit

!Assigning ports to VLANs

TestSwitch(config)#interface range fastEthernet 0/9-16
TestSwitch(config-if-range)#switchport mode access
TestSwitch(config-if-range)#switchport access vlan 2
TestSwitch(config-if-range)#exit
TestSwitch(config)#interface range fastEthernet 0/17-24
TestSwitch(config-if-range)#switchport mode access
TestSwitch(config-if-range)#switchport access vlan 3
TestSwitch(config-if-range)#exit
TestSwitch(config)#exit
TestSwitch#copy running-config startup-config

Result

To check the assigned ports to VLANs apply the following command
TestSwitch#show vlan brief
VLANs

No comments:

Post a Comment