Learn How to create VLANs on cisco switches


This article is all about how to create VLAN on cisco switches. In this tutorial, we learn basic concepts of VLANs like how to create VLAN, where we use VLANs, How to remove VLAN and How to create trunk in between two switches to communicate between our VLANs. Here we also learn that what are VLANs, why we use VLANs on switches etc. We all know that by default switches are worked on VLAN 1. In general words, we can say that VLAN is a broadcast domain which is formed by switches. Generally, we use VLANs for make a single switch into multiple virtual switches. VLAN is also useful when we are feeling a lot of broadcast traffic on our VLAN. In these cases, VLANs are a very useful option for switches. In the last, we create a trunk between two switches because without trunk creation we do not be able in to carry traffic from more than one VLAN. we also run troubleshooting commands on the switches to verify and troubleshoot our configuration easily on the switches. S0 let’s start here how to create VLANs on a cisco switch.

Now to understand this lab with ease, first of all, we take a lab in cisco packet tracer. In this lab, we use two switches and eight PCs to configure VLAN on it.

how to create VLANs on a cisco switch

First of all, we create VLAN on both the switches and then divide PCs according to the VLAN configuration on the switches. After that, we check whether VLANs are properly created or not on both the switches. Now after that, we assign VLAN membership on the interfaces of the switches and then check that membership will be assigned correctly or not. After that, we create a trunk on bothe switches to carry traffic from more than one VLAN. Now in after that we run troubleshoot command and verify our configuration. After that in last, we learn about how to remove a VLAN from the switch.

Now, first of all, we create VLAN on both the switches using given below command

For switch S1

Switch>enable

Switch#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#hostname S1

S1(config)#vlan 1

S1(config-vlan)#name satish

S1(config-vlan)#exit

S1(config)#vlan 2

S1(config-vlan)#name manu

S1(config-vlan)#exit

Now VLANs will be created on the switch and assign IP address on all the PCs.

Now check whether our VLAN is created succesfully or not on switch S1

S1#show vlan

VLAN Name Status Ports


1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4

Fa0/5, Fa0/6, 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

1 satish active

2 manu active

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

50 enet 100050 1500 – – – – – 0 0

100 enet 100100 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


 

For switch S2

Switch>enable

Switch#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#hostname S2

S2(config)#vlan 1

S2(config-vlan)#name satish

S2(config-vlan)#exit

S2(config)#vlan 2

S2(config-vlan)#name manu

S2(config-vlan)#exit

S2(config)#exit

Now check that wether vlan is created successfully or not on switch S2

S2#show vlan

VLAN Name Status Ports


1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4

Fa0/5, Fa0/6, 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

1 satish active

2 manu active

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

50 enet 100050 1500 – – – – – 0 0

100 enet 100100 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


 

Now assign VLAN membership on all the interfaces of the switch

For switch S1

S1>enable

S1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

S1(config)#int fa0/1

S1(config-if)#switchport mode access

S1(config-if)#switchport access vlan 2

S1(config-if)#exit

S1(config)#int fa0/2

S1(config-if)#switchport mode access

S1(config-if)#switchport access vlan 2

S1(config-if)#exit

S1(config)#int fa0/3

S1(config-if)#switchport mode access

S1(config-if)#switchport access vlan 1

S1(config-if)#exit

S1(config)#int fa0/4

S1(config-if)#switchport mode access

S1(config-if)#switchport access vlan 1

S1(config-if)#exit

Now check that proper port is assigned with proper VLAN or not on the switch S1

S1>enable

S1#show vlan

VLAN Name Status Ports


1 default active Fa0/5, Fa0/6, 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

1 satish active Fa0/3, Fa0/4

2 manu active Fa0/1, Fa0/2

 

For switch S2

S2>enable

S2#config t

Enter configuration commands, one per line. End with CNTL/Z.

S2(config)#int fa0/1

S2(config-if)#switchport mode access

S2(config-if)#switchport access vlan 1

S2(config-if)#exit

S2(config)#int fa0/2

S2(config-if)#switchport mode access

S2(config-if)#switchport access vlan 1

S2(config-if)#exit

S2(config)#int fa0/3

S2(config-if)#switchport mode access

S2(config-if)#switchport access vlan 2

S2(config-if)#exit

S2(config)#int fa0/4

S2(config-if)#switchport mode access

S2(config-if)#switchport access vlan 2

S2(config-if)#exit

Now check that proper VLAN will be assigned on proper  port on switch S2

S2#show vlan

VLAN Name Status Ports


1 default active Fa0/5, Fa0/6, 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

1 satish active Fa0/1, Fa0/2

2 manu active Fa0/3, Fa0/4

 

Now to create trunk on both the switches use given below command 

For switch S1

S1>enable
S1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
S1(config)#int fa0/5
S1(config-if)#switchport trunk allowed vlan all
S1(config-if)#switchport mode trunk

S1(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

S1(config-if)#exit

 

For switch S2
S2>enable
S2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
S2(config)#int fa0/5
S2(config-if)#switchport trunk allowed vlan all
S2(config-if)#switchport mode trunk
S2(config-if)#exit

 

Now to verify our configuration we run troubleshooting commands on switch S1

To show information about VLANs use given below command

S1#show vlan

VLAN Name Status Ports


1 default active Fa0/6, 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

1 satish active Fa0/3, Fa0/4

2 manu 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

50 enet 100050 1500 – – – – – 0 0

100 enet 100100 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


 

To saw brief information about VLANs

S1#show vlan brief

VLAN Name Status Ports


1 default active Fa0/6, 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

1 satish active Fa0/3, Fa0/4

2 manu active Fa0/1, Fa0/2

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

 

How to saw VLAN information using VLAN id

S1#show vlan id 1

VLAN Name Status Ports


1 satish active Fa0/3, Fa0/4

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2


1 enet 100100 1500 – – – – – 0 0

 

How to saw VLAN information using VLAN name

S1#show vlan name manu

VLAN Name Status Ports


2 manu active Fa0/1, Fa0/2

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2


2 enet 100050 1500 – – – – – 0 0

 

How to enter into VLAN database mode

S1#vlan database

% Warning: It is recommended to configure VLAN from config mode,

as VLAN database mode is being deprecated. Please consult user

documentation for configuring VTP/VLAN in config mode.

S1(vlan)#

 

How to saw configuration on any particular interface

 

 

S1#show interfaces fa0/1 switchport

Name: Fa0/1

Switchport: Enabled

Administrative Mode: static access

Operational Mode: static access

Administrative Trunking Encapsulation: dot1q

Operational Trunking Encapsulation: native

Negotiation of Trunking: Off

Access Mode VLAN: 2 (manu)

Trunking Native Mode VLAN: 1 (default)

Voice VLAN: none

Administrative private-vlan host-association: none

Administrative private-vlan mapping: none

Administrative private-vlan trunk native VLAN: none

Administrative private-vlan trunk encapsulation: dot1q

Administrative private-vlan trunk normal VLANs: none

Administrative private-vlan trunk private VLANs: none

Operational private-vlan: none

Trunking VLANs Enabled: ALL

Pruning VLANs Enabled: 2-1001

Capture Mode Disabled

Capture VLANs Allowed: ALL

Protected: false

Appliance trust: none

 

Verify interface fa0/5 on which trunk line has been created

S1#show interfaces fa0/5 switchport

Name: Fa0/5

Switchport: Enabled

Administrative Mode: trunk

Operational Mode: trunk

Administrative Trunking Encapsulation: dot1q

Operational Trunking Encapsulation: dot1q

Negotiation of Trunking: On

Access Mode VLAN: 1 (default)

Trunking Native Mode VLAN: 1 (default)

Voice VLAN: none

Administrative private-vlan host-association: none

Administrative private-vlan mapping: none

Administrative private-vlan trunk native VLAN: none

Administrative private-vlan trunk encapsulation: dot1q

Administrative private-vlan trunk normal VLANs: none

Administrative private-vlan trunk private VLANs: none

Operational private-vlan: none

Trunking VLANs Enabled: ALL

Pruning VLANs Enabled: 2-1001

Capture Mode Disabled

Capture VLANs Allowed: ALL

Protected: false

Appliance trust: none

 

How to remove a VLAN from switch

For switch S1

S1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

S1(config)#no vlan 1

S1(config)#exit

Now check whether VLAN 1 is removed or not from switch S1

S1#show vlan brief

VLAN Name Status Ports


1 default active Fa0/6, 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

2 manu active Fa0/1, Fa0/2

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

                                     THAT’S IT

If you have any queries regarding this solved out through using the comment section and also provide feedback to us because your feedback is valuable for us.

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