You are on page 1of 9

16 Like Like

Home
Free eBook
Contact
About
Start Here
How to Create and Delete VLAN on Cisco Catalyst
Switch
by Ramesh Natarajan on October 28, 2011
Tweet 9
One of the typical configuration activities youll perform on a
Cisco Switch is to manipulate VLANs.
VLAN stands for Virtual Local Area Network.
In one physical cisco switch, you can create multiple VLANs that connects to different network.
For example, a VLAN for 10.10.191.0 network, a VLAN for 10.10.192.0 network, and a VLAN for 10.10.193.0
network. All three of these can be configured in the same physical switch.
While these commands were tested on a cisco catalyst switch 3750 series, similar commands (may be with slight
How to Create and Delete VLAN on Cisco Catalyst Switch http://www.thegeekstuff.com/2011/10/cisco-switch-vlan/
1 of 9 5/6/2014 9:51 AM
variation to the port number format) should work on all cisco switches.
Create VLAN on Cisco Switch
If you are planning to have only one network in your whole switch (for example, 10.10.192.0). i.e All the ports
in the switch will be connected to the 10.10.192.0 network, then you dont need to create a VLAN, just use the
default VLAN 1.
Every switch comes with the default VLAN 1 as shown below. In this example, all the ports in this switch ( from
1 through 8 ) are part of the default VLAN 1.
#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- ------------
1 default active Gi1/0/1, Gi1/0/2, Gi1/0/3, Gi1/0/4
Gi1/0/5, Gi1/0/6, Gi1/0/7, Gi1/0/8
In the following example, we are creating 192 VLAN network (for 10.10.192.0 network). While creating a
VLAN you also need to specify the range of ports from the switch that needs to be part of this VLAN network.
In this example, ports 3 through 6 are configured as part of 192 VLAN network.
config t
vlan 192
interface range gigabitEthernet 1/0/3-6
switchport access vlan 192
exit
In the above commands:
config t Goes into the configuration mode
vlan 192 Creates VLAN 192
interface range gigabitEthernet 1/0/3-6 Indicates that the port numbers 3 through 6 are assigned to this
VLAN
swithport access vlan 192 Indicates that the access to the vlan 192 is enabled
Apart from providing the access to the vlan 192 for the port numbers 3 through 6, you can also specify the
following additional switchport configuration parameters (for example, nonegotiate and mode access)
How to Create and Delete VLAN on Cisco Catalyst Switch http://www.thegeekstuff.com/2011/10/cisco-switch-vlan/
2 of 9 5/6/2014 9:51 AM
Tweet 9
16 Like Like
config t
interface range gigabitEthernet 1/0/3-6
switchport mode access
switchport nonegotiate
exit
Once youve created a VLAN verify it as shown below,
#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- ------------
1 default active Gi1/0/1, Gi1/0/2, Gi1/0/7, Gi1/0/8
192 VLAN0192 active Gi1/0/3, Gi1/0/4, Gi1/0/5, Gi1/0/6
On a side note, it is always recommended that you upgrade ISO image on your cisco switch to the latest version.
Delete VLAN on Cisco Switch
You might want to delete a VLAN, if you are planning to switch the ports assigned to VLAN 192 to a different
VLAN. Or, you might want to delete a VLAN, just because youve created it by mistake.
Let us assume that you want to delete the VLAN 192 (ports 3 though 6) that you just created.
Deleting a VLAN is as simple as assigning the default VLAN 1 to the ports that are part of the VLAN you want
to delete, and delete the VLAN.
i.e If you want to delete VLAN 192, assign VLAN 1 to the ports 3 through 6, and just delete the VLAN 192.
First, assign the default VLAN 1 to ports 3 though 6 as shown below.
interface range gigabitEThernet 1/0/3-6
switchport access vlan 1
exit
Next, delete the vlan itself as shown below.
no vlan 192
Finally, verify that the VLAN 192 got deleted as shown below.
#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- ------------
1 default active Gi1/0/1, Gi1/0/2, Gi1/0/3, Gi1/0/4
Gi1/0/5, Gi1/0/6, Gi1/0/7, Gi1/0/8
As a final note, if you dont know what you are doing, do not execute any of the above commands on production
switch, as you might bring down your network. Do this only on a test system, where you can play around and
learn how to manipulate VLANs on cisco switch.
> Add your comment
How to Create and Delete VLAN on Cisco Catalyst Switch http://www.thegeekstuff.com/2011/10/cisco-switch-vlan/
3 of 9 5/6/2014 9:51 AM
Linux provides several powerful administrative tools and utilities which will
help you to manage your systems effectively. If you dont know what these tools are and how to use them, you
could be spending lot of time trying to perform even the basic administrative tasks. The focus of this course is to
help you understand system administration tools, which will help you to become an effective Linux system
administrator.
Get the Linux Sysadmin Course Now!
If you enjoyed this article, you might also like..
50 Linux Sysadmin Tutorials 1.
50 Most Frequently Used Linux Commands (With
Examples)
2.
Top 25 Best Linux Performance Monitoring and
Debugging Tools
3.
Mommy, I found it! 15 Practical Linux Find
Command Examples
4.
Linux 101 Hacks 2nd Edition eBook 5.
Awk Introduction 7 Awk Print Examples
Advanced Sed Substitution Examples
8 Essential Vim Editor Navigation
Fundamentals
25 Most Frequently Used Linux IPTables
Rules Examples
Turbocharge PuTTY with 12 Powerful
Add-Ons
{ 14 comments read them below or add one }
1 jalal hajigholamali October 28, 2011 at 8:32 am
Hi,
Thanks a lot
2 Andrew October 28, 2011 at 12:52 pm
How to Create and Delete VLAN on Cisco Catalyst Switch http://www.thegeekstuff.com/2011/10/cisco-switch-vlan/
4 of 9 5/6/2014 9:51 AM
what about the hidden vlan.dat file ?
I think that is still in place even after using the no vlan command.
3 ciscofreek February 27, 2012 at 12:16 pm
yeah you will delete the vlans until such time as a reboot when the vlan.dat file will reinsert the vlans. You
also need to delete the vlan.dat file in flash and also be aware of vtp updates if you are running multiple
switches
4 Abubakar Abdulrasheed September 4, 2012 at 4:18 am
I really enjoyed the guide and comment given, this will help me in the cause of doing my job.
5 iulian October 29, 2012 at 3:08 pm
you must delete both vlan.dat an reasing interface
6 kavi kumar November 20, 2012 at 9:32 pm
Hi,
Nice explaination fa cisco switch in VLAN.
thanks a lot
7 sudhir kumar February 27, 2013 at 12:00 am
how to configure VLAN on cisco switch please reply
8 kevin March 21, 2013 at 3:19 am
How do i configure and set a cisco sf200 switch its an webbased switch.
i need 4 vlans 145, 146,147,148 to begin.
can anyone help.
regards
9 solabayya May 14, 2013 at 8:07 am
nice explanations.
10 charan June 5, 2013 at 2:22 am
very good explanation
11 umesh tiwari October 24, 2013 at 7:14 am
How to create a two switch2950 configure vlan in cisco, drow and example step ?
12 kahil November 21, 2013 at 10:32 am
Hi please can you help
how do the switch will know that port 3 to 6 are assigned to vlan 192 with the ip adress 10.10.192.0
How to Create and Delete VLAN on Cisco Catalyst Switch http://www.thegeekstuff.com/2011/10/cisco-switch-vlan/
5 of 9 5/6/2014 9:51 AM
in your configuration you only said port from 3 to 6
and vlan 192 but not defining the ip adress?

config t
vlan 192
interface range gigabitEthernet 1/0/3-6
switchport access vlan 192
exit
also what 1/0 mean in interface range gigabitEthernet 1/0/3-6
and please how to assign port 1 and 2 to a vlan
and 3 and 4 to another vlan
thanks for your help
13 Mey January 22, 2014 at 5:33 am
Hi guy.
To create a vlan just select a number for the vlan, like 22. and then in global configuration mode type: vlan
22
(config)# vlan 22
14 paul March 16, 2014 at 9:49 am
I have a catalyst 3750g switch and I am new to cisco. The speed LED is off, in an article I read it says it
transmit at 10 Mbps when off and 1000 Mbps when flashing. How do I set this to 1000 Mbps? what are
the commands that I need to enter in the terminal emulator? Thanks in advance!
Leave a Comment
Name
E-mail
Website
Notify me of followup comments via e-mail
Previous post: RAID 10 Vs RAID 01 (RAID 1+0 Vs RAID 0+1) Explained with Diagram
Next post: 20 OpenOffice Calc Spreadsheet Tips and Tricks
How to Create and Delete VLAN on Cisco Catalyst Switch http://www.thegeekstuff.com/2011/10/cisco-switch-vlan/
6 of 9 5/6/2014 9:51 AM
RSS | Email | Twitter | Facebook | Google+
Search
COURSE
Linux Sysadmin CentOS 6 Course - Master the Tools, Configure it Right, and be Lazy
EBOOKS
Linux 101 Hacks 2nd Edition eBook - Practical Examples to Build a Strong Foundation in
Linux
Bash 101 Hacks eBook - Take Control of Your Bash Command Line and Shell Scripting
Sed and Awk 101 Hacks eBook - Enhance Your UNIX / Linux Life with Sed and Awk
Vim 101 Hacks eBook - Practical Examples for Becoming Fast and Productive in Vim Editor
Nagios Core 3 eBook - Monitor Everything, Be Proactive, and Sleep Well
The Geek Stuff
5,665 people like The Geek Stuff.
Facebook social plugin
Like Like
POPULAR POSTS
12 Amazing and Essential Linux Books To Enrich Your Brain and Library
50 UNIX / Linux Sysadmin Tutorials
50 Most Frequently Used UNIX / Linux Commands (With Examples)
How to Create and Delete VLAN on Cisco Catalyst Switch http://www.thegeekstuff.com/2011/10/cisco-switch-vlan/
7 of 9 5/6/2014 9:51 AM
How To Be Productive and Get Things Done Using GTD
30 Things To Do When you are Bored and have a Computer
Linux Directory Structure (File System Structure) Explained with Examples
Linux Crontab: 15 Awesome Cron Job Examples
Get a Grip on the Grep! 15 Practical Grep Command Examples
Unix LS Command: 15 Practical Examples
15 Examples To Master Linux Command Line History
Top 10 Open Source Bug Tracking System
Vi and Vim Macro Tutorial: How To Record and Play
Mommy, I found it! -- 15 Practical Linux Find Command Examples
15 Awesome Gmail Tips and Tricks
15 Awesome Google Search Tips and Tricks
RAID 0, RAID 1, RAID 5, RAID 10 Explained with Diagrams
Can You Top This? 15 Practical Linux Top Command Examples
Top 5 Best System Monitoring Tools
Top 5 Best Linux OS Distributions
How To Monitor Remote Linux Host using Nagios 3.0
Awk Introduction Tutorial 7 Awk Print Examples
How to Backup Linux? 15 rsync Command Examples
The Ultimate Wget Download Guide With 15 Awesome Examples
Top 5 Best Linux Text Editors
Packet Analyzer: 15 TCPDUMP Command Examples
The Ultimate Bash Array Tutorial with 15 Examples
3 Steps to Perform SSH Login Without Password Using ssh-keygen & ssh-copy-id
Unix Sed Tutorial: Advanced Sed Substitution Examples
UNIX / Linux: 10 Netstat Command Examples
The Ultimate Guide for Creating Strong Passwords
6 Steps to Secure Your Home Wireless Network
Turbocharge PuTTY with 12 Powerful Add-Ons
CATEGORIES
Linux Tutorials
Vim Editor
Sed Scripting
Awk Scripting
Bash Shell Scripting
Nagios Monitoring
OpenSSH
IPTables Firewall
Apache Web Server
MySQL Database
Perl Programming
Google Tutorials
Ubuntu Tutorials
PostgreSQL DB
Hello World Examples
C Programming
C++ Programming
How to Create and Delete VLAN on Cisco Catalyst Switch http://www.thegeekstuff.com/2011/10/cisco-switch-vlan/
8 of 9 5/6/2014 9:51 AM
DELL Server Tutorials
Oracle Database
VMware Tutorials
About The Geek Stuff
My name is Ramesh Natarajan. I will be posting instruction guides, how-to,
troubleshooting tips and tricks on Linux, database, hardware, security and web. My focus is to write
articles that will either teach you or help you resolve a problem. Read more about Ramesh Natarajan and
the blog.
Support Us
Support this blog by purchasing one of my ebooks.
Bash 101 Hacks eBook
Sed and Awk 101 Hacks eBook
Vim 101 Hacks eBook
Nagios Core 3 eBook
Contact Us
Email Me : Use this Contact Form to get in touch me with your comments, questions or suggestions
about this site. You can also simply drop me a line to say hello!.
Follow us on Google+
Follow us on Twitter
Become a fan on Facebook
Copyright 20082014 Ramesh Natarajan. All rights reserved | Terms of Service
How to Create and Delete VLAN on Cisco Catalyst Switch http://www.thegeekstuff.com/2011/10/cisco-switch-vlan/
9 of 9 5/6/2014 9:51 AM

You might also like