LEARN HOW TO CONFIGURE VLAN ON CiSCO SWITCH .

In this post we will learn what is vlan and how to configure vlan on cisco switches . Also how to communicate between vlan using trunk . Vlan are used mostly in colleges or small offices to that different departments can’t able to make access to different department .

Vlan is group of devices connected to switch on one or more LANs to communicate as if they were attached to rthe same wire , even if they are located on a number of different LAN segments.

HOW TO CONFIGURE VLAN ON CISCO SWITCH ( SIMPLE  LAB) 

  • Take single cisco switch and four end devices( laptop or pc )  and connect laptops  with switch using copper straight wire .

vlan configuration on cisco switches

Switch configuration 

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)#vlan 20
Switch(config-vlan)#name linux
Switch(config-vlan)#exit

Switch(config)#int fa0/1
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 20
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)#int fa0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#

Now assign ip address and subnet mask to all four laptops and try to ping other three

You will find that laptop in same vlan can communicate with each other but not with different vlan .

vlan on cisco switches

HOW TO CONFIGURE VLAN AND TRUNK ON CISCO SWITCHES  ( COMPLEX LAB )

In above lab , we made two vlan and configured it to not to communicate with each other . BUT same vlan devices can communicate with each other .

Now how to make connection when there is many switches .

vlan and trunk configuration on cisco switches

 

SWITCH CONFIGURATION

SWITCH S1

Switch>en
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#vlan 30
Switch(config-vlan)#name s
Switch(config-vlan)#exit

Switch(config)#vlan 40
Switch(config-vlan)#name a
Switch(config-vlan)#exit

Switch(config)#int fa0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 30
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)#int fa0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 40
Switch(config-if)#exit

Switch(config)#int fa0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 40
Switch(config-if)#exit

Switch(config)#int fa0/5
Switch(config-if)#switchport trunk allowed vlan all
Switch(config-if)#switchport mode trunk
Switch(config-if)#exit

Switch(config)#int fa0/6
Switch(config-if)#switchport trunk allowed vlan all
Switch(config-if)#switchport mode trunk

Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to up

Switch(config-if)#exit
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console

Switch#show vlan

VLAN Name Status Ports
—- ——————————– ——— ——————————-
1 default active Fa0/7, Fa0/8, Fa0/9, Fa0/10
Fa0/11, Fa0/12, Fa0/13, Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Fa0/23, Fa0/24

30    s    active       Fa0/1, Fa0/3
40    a    active      Fa0/2, Fa0/4

1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
—- —– ———- —– —— —— ——– —- ——– —— ——
1 enet 100001 1500 – – – – – 0 0
30 enet 100030 1500 – – – – – 0 0
40 enet 100040 1500 – – – – – 0 0
1002 fddi 101002 1500 – – – – – 0 0
1003 tr 101003 1500 – – – – – 0 0
1004 fdnet 101004 1500 – – – ieee – 0 0
1005 trnet 101005 1500 – – – ibm – 0 0

Remote SPAN VLANs
——————————————————————————
Primary Secondary Type Ports
——- ——— —————– ——————————————

SWITCH 2

Switch>en
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#vlan 10
Switch(config-vlan)#name c
Switch(config-vlan)#exit

Switch(config)#vlan 20
Switch(config-vlan)#name x
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/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#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/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit

Switch(config)#int fa0/5
Switch(config-if)#switchport trunk allowed vlan all
Switch(config-if)#switchport mode trunk

Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to up

Switch(config-if)#exit
Switch(config)#int fa0/6
Switch(config-if)#switchport trunk allowed vlan all
Switch(config-if)#switchport mode trunk

Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to up

Switch(config-if)#exit
Switch(config)#

Switch>en
Switch#show vlan

VLAN Name Status Ports
—- ——————————– ——— ——————————-
1 default active Fa0/7, Fa0/8, Fa0/9, Fa0/10
Fa0/11, Fa0/12, Fa0/13, Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Fa0/23, Fa0/24

10    c      active Fa0/1, Fa0/4
20    x      active Fa0/2, Fa0/3

1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
—- —– ———- —– —— —— ——– —- ——– —— ——
1 enet 100001 1500 – – – – – 0 0
10 enet 100010 1500 – – – – – 0 0
20 enet 100020 1500 – – – – – 0 0
1002 fddi 101002 1500 – – – – – 0 0
1003 tr 101003 1500 – – – – – 0 0
1004 fdnet 101004 1500 – – – ieee – 0 0
1005 trnet 101005 1500 – – – ibm – 0 0

Remote SPAN VLANs
——————————————————————————
Primary Secondary Type Ports
——- ——— —————– ——————————————

SWITCH 3

Switch>en
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#vlan 10
Switch(config-vlan)#name c
Switch(config-vlan)#exit

Switch(config)#vlan 20
Switch(config-vlan)#name x
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/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#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/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit

Switch(config)#int fa0/5
Switch(config-if)#switchport trunk allowed vlan all
Switch(config-if)#switchport mode trunk

Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to up

Switch(config-if)#exit

Switch(config)#int fa0/6
Switch(config-if)#switchport trunk allowed vlan all
Switch(config-if)#switchport mode trunk

Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to up

Switch(config-if)#exit
Switch(config)#

 

Switch>en
Switch#show vlan

VLAN Name Status Ports
—- ——————————– ——— ——————————-
1 default active Fa0/7, Fa0/8, Fa0/9, Fa0/10
Fa0/11, Fa0/12, Fa0/13, Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Fa0/23, Fa0/24

10   c     active Fa0/1, Fa0/4
20   x    active Fa0/2, Fa0/3

1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
—- —– ———- —– —— —— ——– —- ——– —— ——
1 enet 100001 1500 – – – – – 0 0
10 enet 100010 1500 – – – – – 0 0
20 enet 100020 1500 – – – – – 0 0
1002 fddi 101002 1500 – – – – – 0 0
1003 tr 101003 1500 – – – – – 0 0
1004 fdnet 101004 1500 – – – ieee – 0 0
1005 trnet 101005 1500 – – – ibm – 0 0

Remote SPAN VLANs
——————————————————————————
Primary Secondary Type Ports
——- ——— —————– —————————————-

SWITCH 4

Switch>en
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#vlan 10
Switch(config-vlan)#name c
Switch(config-vlan)#exit

Switch(config)#vlan 30
Switch(config-vlan)#name s
Switch(config-vlan)#exit

Switch(config)#int fa0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 30
Switch(config-if)#exit

Switch(config)#int fa0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 30
Switch(config-if)#exit

Switch(config)#int fa0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit

Switch(config)#int fa0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit

Switch(config)#int fa0/5
Switch(config-if)#switchport trunk allowed vlan all
Switch(config-if)#switchport mode trunk
Switch(config-if)#exit

Switch(config)#int fa0/6
Switch(config-if)#switchport trunk allowed vlan all
Switch(config-if)#switchport mode trunk
Switch(config-if)#exit
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console

Switch#show vlan

VLAN Name Status Ports
—- ——————————– ——— ——————————-
1 default active Fa0/7, Fa0/8, Fa0/9, Fa0/10
Fa0/11, Fa0/12, Fa0/13, Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Fa0/23, Fa0/24

10    c    active Fa0/3, Fa0/4
30    s    active Fa0/1, Fa0/2

1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
—- —– ———- —– —— —— ——– —- ——– —— ——
1 enet 100001 1500 – – – – – 0 0
10 enet 100010 1500 – – – – – 0 0
30 enet 100030 1500 – – – – – 0 0
1002 fddi 101002 1500 – – – – – 0 0
1003 tr 101003 1500 – – – – – 0 0
1004 fdnet 101004 1500 – – – ieee – 0 0
1005 trnet 101005 1500 – – – ibm – 0 0

Remote SPAN VLANs
——————————————————————————
Primary Secondary Type Ports
——- ——— —————– ——————————————
Switch#

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s