Hello guys today we will learn how to configure VLAN(Virtual Area network) in Cisco Switch. Before that we will learn what is VLAN. we can create block in same network through vlan. some times we have to need network block in same network, imagine that we want to create two networks block in computer lab and our condition is both block cant’communicate each-other in this condition we will configure VLAN in Switch you just follow simple Steps
before we will take two switch and eight Computer and provide ip address like this tables
PC 0 | PC 1 | PC 2 | PC 3 | PC 4 | PC 5 | PC 6 | PC 7 |
1.0.0.1 | 1.0.0.2 | 1.0.0.3 | 1.0.0.4 | 1.0.0.5 | 1.0.0.6 | 1.0.0.7 | 1.0.0.8 |
Step 2 now will go to switch 1 CLI mod and configure vlan like this
Switch>en
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#name ccna
Switch(config-vlan)#exit
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 10
Switch(config-if)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name linux
Switch(config-vlan)#exit
Switch(config)#int fa0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#int Fa0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#
Step 2 we can look our vlan through show vlan commands
Step 3 now will go to switchb 2 and Configuration vlan same like this
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#name ccna
Switch(config-vlan)#exit
Switch(config)#int fa0/1
Switch(config-if)#switchport mod access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#int fa0/2
Switch(config-if)#switchport mod access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name linux
Switch(config-vlan)#int fa0/3
Switch(config-if)#switchport mod access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#int fa0/4
Switch(config-if)#switchport mod access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Step 3 now we r connect both switch and connect VALN 10 and VLAN 20
Go to Switch 1 and configure trunk on port fa0/5
Switch>en
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int fa0/5
Switch(config-if)#switchport trunk allowed vlan all
Switch(config-if)#switchport mode trunk
Switch(config-if)#
Now go to switch 2 and configure trunk on port fa0/5
Switch>en
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int fa0/5
Switch(config-if)#switchport trunk allowed vlan all
Switch(config-if)#switchport mode trunk
now Cisco switch on complete VLAN configuretion
how to remove VLAN
if we want to remove VLAN then go to switch CLI mode and type just no vlan
Switch(config-if)#no vlan 10
Switch(config)#no vlan 20
if you have any problem in this process then comments here i will solve your problem you can also download vlan lab through this link
Thank you
by Vishnu Sharma