How to setup VLan for Cisco IP Phones on cisco Switch

Posted on 2007-10-17
Last Modified: 2013-11-16
We are putting in a new Cisco ASA 5520 to replace our Pix 515. We have Cisco managed switches (I think Cisco 3750 but not sure ). We have Cisco  VOIP phones on the same network that the computers are on.

We would like to setup VLans to separate the traffic in order to improve the network performance. The cisco switches are Gigabit switches.

Is the only way to setup VLans thought port VLans or can we do it any other way. The reason is that we have one cable going into the phones and then the phones have a switch port that goes to the workstations. Therefore we can not do port VLans.
FYI, I am not familiar with VLans and am not sure how they work. Do you some how login to the switch and do it.
Question by:netcomp
    LVL 3

    Accepted Solution

    Ok I can help you with this....

    Yes it is best practise to seperate your voice and data networks using VLAN's. Vlans must be first setup on the switch (such as VLAN100 for data, VLAN200 for voice). Then the actually interfaces on the switches must be configure to "trunk" both voice and data VLAN's to the phone. The phone will then operate on the voice VLAN and the PC connected to it will operate on the data VLAN.

    How does the phone know to take the VLAN200 and give VLAN100 to the PC? Sound like Magic? When configuring the switch interface, we use commands which identify which VLANs are used for Voice and for Data. This is the benfit of using Cisco switches with Cisco phones, they communicate using CDP "Cisco discovery protocol".

    Here is an example of the VLAN configuration on the switch:
    interface Vlan100
     description ### DATA VLAN ###
     ip address
    interface Vlan200
     description ### VOICE VLAN ###
     ip address

    and how we assign the VLAN's to the switch interface and identify VOICE vlan:
    interface GigabitEthernet1/0/1
     description ### Trunk Link to Cisco IP Phone ###
     switchport trunk encapsulation dot1q
     switchport trunk native vlan 100
     switchport voice vlan 200
     switchport mode trunk

    So thats a good start on this subject. However when you have multiple switches, it gets a little more complicated. Usually we would use a single Layer 3 switch as a "core" switch which handles the routing between VLANs, the other switches would operate at layer 2. If you have a single stack of 3750 switches then this is easy becuase they are configured and operate as a single switch.

    Let me know your thoughts...
    LVL 3

    Expert Comment

    Oh I would also recommend implementing QoS (Quality of Service) on the switches. This will garantee that voice is prioritized. Again becuase you are using Cisco phones on Cisco switches, this is made very easy. It is as simple as putting in the following command on each switch interfaces:

    auto qos voip cisco-phone

    Anyway we could deal with that later ;)
    LVL 16

    Expert Comment

    by:Aaron Street
    REmber on Ciscos you can also have dynamic Vlans.

    You set up your trunks as normal. but you can assing different mac addresses different Vlans.
    then what ever switch port they are pluged in to. as long as you have set up the switchs correctly. will automatical place that port in to the correct vlan.

    If you want to be able to move phones around with out having to reconfiger the vlan date each time this might be a good idea.

    You only have to set up one switch (core switch normaly) as the vlan server and all the rest as clients. and it will proprogate through the network.

    AS for Vlans decribed in a simple way. simple breack up the switch in to seperat switches and so stop traffic moving between them. You then need a router if you want one vlan to talk to another.

    As the Rock said. QOS would be a great idea for Voip as well. As by default voice and data will compeate for bandwith. by running QOS you can garantee that a certian % of the link is always avalible for voip traffic.

    LVL 3

    Expert Comment

    Also a note I would like to add to my first comment:
    If you connect a PC (without first connecting to a phone) to a switch port which is configured as trunk port, the switch will assign the PC to VLAN100 because this is marked as the "Native VLAN". All devices will be assigned to the Native VLAN unless the switch knows it is an IP phone connecting... as mentioned the switch knows when a Cisco phone is connected (by use of CDP protocol) and assigns the phone to the VLAN marked with "switchport voice vlan xxx"

    Hope that helps...
    LVL 16

    Expert Comment

    by:Aaron Street
    oh thats quite cool :)

    sorry we dont use Voip here so i missed that in your post Rock. see arn't cisco helpfull..

    but i have used dynamic vlans for different machines on site.

    Learn something new every day :)
    LVL 1

    Author Comment

    Wow, Lots of great info. I have some confusion:
    1.      What is a Trunk,  and how does it work.
    2.      How does IP Addressing and DHCP play into this .
    3.      What do you mean by  we assign Vlans to the switch interface . Also what does the command interface GigabitEthernet 1/0/1 do.  
    4.      How do you assign a switch as core switch and make it handell the routing. Dont we need a router to do the routing between the Vlans.
    Thanks for all of your help
    LVL 16

    Assisted Solution

    by:Aaron Street
    A trunk is a link between the ports of two seperate switchs that can carry multiply vlans.

    the idea is all ports on the switch are in a single vlan, and then the trunking ports are like the backbone ports that carry the information between different switchs.

    usual you would have a different sub net associated with each vlan. so different Ip ranges. As for DHCP you can either have a seperate DHCP serve on each VLAN (rember vlans are the same as seperate switched network. ) or you can set up a DHCP helper on the switchs and you can use one DHCP server to servioce all the different ip ranges. (I can tell you how to do this if you want )

    The command interface gig1/0/1 simple takes you in to the configeration settings for that inter face
    the 1/0/1 is to do with the switch number (if you have a stack) the swithc moduel if you have more than one in some switchs and the port number

    so in this case it would be .. first switch in stack... no module present and first port

    any layer 3 switch can handle routing. most moden switchs are able to do this. there are in fact routers. and many switches these days have good routing functions on them. one of the main differences is that a true route will have serial ports and is able to run other proticals over these serial ports.
    Switchs which are layer 3, can normaly only route between eathernet networks. where as routers can route between other protocals as well.

    so yes you need a router to route between VLANS. but i know for a fact both the 3700 series of switchs have all the routing functions you will need.
    LVL 3

    Expert Comment

    Do you need to know anything else on this topic?
    LVL 3

    Expert Comment

    As per your initial question "Do you some how login to the switch and do it", the answer is most surely Yes. You will need to connect a console cable to switch (the switches have an RJ45 slot in the back called "Console") which is provided with the switch. You then must use a program such as hyperterminal to connect to the switch. Some of the new Cisco switches can be managed through a web-interface, however usually the are configured by command line. The information you  have been provided above is obviously for command line configuration. Just wanted to clarify in case you were unsure....
    LVL 16

    Expert Comment

    by:Aaron Street
    of course you can also configure it over the network through the console.

    As long as the switch has a ipaddress set on it. (however of course by default it wont be set up)

    The command line is very sright forwardx. (although it looks daunting) I will post a link to another thread on this site which deals with the basic introduction to the commands on Cisco ISO.

    but really if you have a quick glance through a cisco manual (i can send you a PDF version of one if you need it ) you will be able to do the kind of configuring we are talking about here very quickly.

    Just rember in the work of Cisco the "?" is your friend :) as is the show command!!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    When posting a question about a Cisco ASA, Cisco Router or Cisco Switch, it can aid diagnosis if a suitably sanitised copy of the config is provided. It is much better to leave as much of the configuration as original as possible, as it could be tha…
    Hello All, I have been training on Multicast for a while now and whenever I start the topic , I find out that my friends /  Colleagues mention that they do not know how to test Multicast Joins. As most of the multicast would be video traffic and …
    After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
    After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now