VLAN Lab

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

VLAN lab

there is one switch with 4 pcs

1 pc have ip address :192.168.0.1

2 pc have ip address :192.168.0.2

3 pc have ip address :192.168.0.3

4 pc have ip address :192.168.0.4

Switch:en

switch:show vlan brief

Switch:config t

Switch(config)#vlan 10 // FOR VLAN 10 for Students

Switch(config-vlan)#name students

Switch(config-vlan)#exit

Switch(config)#int

Switch(config)#interface fastethernet 0/1


Switch(config-if)#sw //here you press tab

Switch(config-if)#switchport mode ?

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access ?

Switch(config-if)#switchport access vlan 10

Switch(config-if)#do show vlan

Switch(config-if)#exit

Switch(config)#interface fastethernet 0/2

Switch(config-if)#sw //here you press tab

Switch(config-if)#switchport mode ?

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access ?

Switch(config-if)#switchport access vlan 10

Switch(config-if)#do show vlan

Switch(config-if)#exit

Switch(config)#vlan 20 // FOR VLAN 20 for Teachers

Switch(config-vlan)#name teachers

Switch(config-vlan)#exit

Switch(config)#int

Switch(config)#interface fastethernet 0/3

Switch(config-if)#sw //here you press tab

Switch(config-if)#switchport mode ?

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access ?

Switch(config-if)#switchport access vlan 20

Switch(config-if)#do show vlan

Switch(config-if)#exit

Switch(config)#interface fastethernet 0/4


Switch(config-if)#sw //here you press tab

Switch(config-if)#switchport mode ?

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access ?

Switch(config-if)#switchport access vlan 20

Switch(config-if)#do show vlan

Switch(config-if)#exit

Switch to Switch connection:

for switch 1: Go to cli then types these commands according to your interface

Switch(config)#interface fastethernet 0/6

Switch(config-if)#sw //here you press tab

Switch(config-if)#switchport mode trunk

for switch 2 : it has one pc(ip address :192.168.0.5) then make that pc part of vlan 10 through these
below commands

Switch(config)#interface fastethernet 0/1

Switch(config-if)#sw //here you press tab

Switch(config-if)#switchport mode ?

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access ?

Switch(config-if)#switchport access vlan 10

Switch(config-if)#do show vlan

Switch(config-if)#exit

for switch 2 to switch 1 interface:

Switch(config)#interface fastethernet 0/2

Switch(config-if)#sw //here you press tab

Switch(config-if)#switchport mode trunk


for router to switch connection there is 2 vlan so we connect with 2 lines with router.

Go to Switch(0) cli:

switch(config)#interface fastethernet 0/10

switch(config-if)#switchport mode access

switch(config-if)#switchport access vlan 10

switch(config-if)#exit

switch(config)#interface fastethernet 0/11

switch(config-if)#switchport mode access

switch(config-if)#switchport access vlan 20

switch(config-if)#exit

Go to router cli:

Router(config)#:interface gigabitEthernet 0/0/0

Router(config-if)#ip address 192.168.0.10 255.255.255.0

Router(config-if)#no shutdown

Router(config-if)#exit

Router(config)#:interface gigabitEthernet 0/0/1


Router(config-if)#ip address 192.168.1.10 255.255.255.0

Router(config-if)#no shutdown

Router(config-if)#exit

You might also like