Config Lab: Data and Voice VLAN 2
Ready to prepare some access switches to support IP phones? This latest config lab sets up the problem for that specific task. The lab shows the common access switch configuration required when you connect a switch port to a phone, and then connect the phone to a PC.
The Lab Exercise
Requirements
Imagine a LAN in which all the access ports originally connected to PCs, with all access ports assigned to VLAN 20. For this lab, you should migrate the LAN to expect each switch access port to connect instead to a new IP phone. Then each IP phone will have a short patch cable that connects to the same PC that was previously connected to the same switch port. That change will happen for all the access ports shown in the figure.
Your job is to look at the existing configuration on the access ports, and then add the required configuration to support the migration to having both a phone and a PC at the end of each access link. The specific rules for this lab are:
- All phones will be in the same VLAN: new Voice VLAN 30.
- Do not change the current data VLAN used by each PC.
- Make use of the interface range command to reduce typing.
- Assumptions:
- All device interfaces shown in the lab are up and working.
- The path from the existing PCs to the existing router (as default gateway) is working, but the router is not shown in the figure.
- Trunking is configured and operational between the switches.
- All switches use VTP transparent mode.
- VLANs 20, and 30 already exist and are enabled on all four switches.
Figure 1: Original Topology without IP Phones
Figure 2: New Topology with IP Phones
Initial Configuration
Examples 1, 2, 3, and 4 show the beginning configuration state of Dist1, Dist2, Access1, and Access2.
hostname Dist1
!
vtp mode transparent
!
vlan 20,30
!
interface GigabitEthernet1/1/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet1/1/2
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet1/1/3
switchport trunk encapsulation dot1q
switchport mode trunk
Example 1: Dist1 Config
hostname Dist2
!
vtp mode transparent
!
vlan 20,30
!
interface GigabitEthernet1/1/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet1/1/2
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet1/1/3
switchport trunk encapsulation dot1q
switchport mode trunk
Example 2: Dist2 Config
hostname Access1
!
vtp mode transparent
!
vlan 20,30
!
interface GigabitEthernet1/1/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet1/1/2
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet1/0/1
switchport access vlan 20
!
interface GigabitEthernet1/0/2
switchport access vlan 20
!
interface GigabitEthernet1/0/3
switchport access vlan 20
!
interface GigabitEthernet1/0/4
switchport access vlan 20
Example 3: Access1 Config
hostname Access2
!
vtp mode transparent
!
vlan 20,30
!
!
interface GigabitEthernet1/1/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet1/1/2
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet1/0/1
switchport access vlan 20
!
interface GigabitEthernet1/0/2
switchport access vlan 20
!
interface GigabitEthernet1/0/3
switchport access vlan 20
!
interface GigabitEthernet1/0/4
switchport access vlan 20
Example 4: Access2 Config
Answer Options - Click Tabs to Reveal
You can learn a lot and strengthen real learning of the topics by creating the configuration – even without a router or switch CLI. In fact, these labs were originally built to be used solely as a paper exercise!
To answer, just think about the lab. Refer to your primary learning material for CCNA, your notes, and create the configuration on paper or in a text editor. Then check your answer versus the answer post, which is linked at the bottom of the lab, just above the comments section.
You can also implement the lab using the Cisco Packet Tracer network simulator. With this option, you use Cisco’s free Packet Tracer simulator. You open a file that begins with the initial configuration already loaded. Then you implement your configuration and test to determine if it met the requirements of the lab.
(Use this link for more information about Cisco Packet Tracer.)
Use this workflow to do the labs in Cisco Packet Tracer:
- Download the .pkt file linked below.
- Open the .pkt file, creating a working lab with the same topology and interfaces as the lab exercise.
- Add your planned configuration to the lab.
- Test the configuration using some of the suggestions below.
You can also implement the lab using Cisco Modeling Labs – Personal (CML-P). CML-P (or simply CML) replaced Cisco Virtual Internet Routing Lab (VIRL) software in 2020, in effect serving as VIRL Version 2.
If you prefer to use CML, use a similar workflow as you would use if using Cisco Packet Tracer, as follows:
- Download the CML file (filetype .yaml) linked below.
- Import the lab’s CML file into CML and then start the lab.
- Compare the lab topology and interface IDs to this lab, as they may differ (more detail below).
- Add your planned configuration to the lab.
- Test the configuration using some of the suggestions below.
Download this lab’s CML file!
Network Device Info:
This table lists the interfaces used in the lab exercise documentation that differ from those used in the sample CML file.
Device | Lab Port | Â CML Port |
Dist1 | G1/1/1 | G0/1 |
Dist1 | G1/1/2 | G0/2 |
Dist1 | G1/1/3 | G0/3 |
Dist2 | G1/1/1 | G0/1 |
Dist2 | G1/1/2 | G0/2 |
Dist2 | G1/1/3 | G0/3 |
Access1 | G1/1/1 | G0/1 |
Access1 | G1/1/2 | G0/2 |
Access2 | G1/1/1 | G0/1 |
Access2 | G1/1/2 | G0/2 |
Lab Answers Below: Spoiler Alert
Lab Answers: Configuration (Click Tab to Reveal)
Answers
Figure 1: Original Topology without IP Phones
Figure 2: New Topology with IP Phones
interface range GigabitEthernet1/0/1-4
switchport voice vlan 30
Example 1: Access1 Config
interface range GigabitEthernet1/0/1-4
switchport voice vlan 30
Example 2: Access2 Config
Commentary, Issues, and Verification Tips (Click Tabs to Reveal)
Commentary
When working on a network that implements voice over IP, one of the common tasks to perform is to configure both a data and a voice VLAN on a single switch port. When configured in this way the switch port acts as a trunk and tags voice traffic with an 802.1q tag. The IP phone is connected in line with the PC and will strip this traffic away to itself and pass all untagged traffic to the PC. Since many different companies already have an existing data VLAN configuration it is a common project for an organization to alter this configuration to take advantage of the voice VLAN feature.
This lab tasks you with taking an existing configuration that utilizes data VLANs to connect to PCs and alter it to accommodate IP phones which are being added in line with these PCs. Because each of the access switches was already configured to connect to the PCs the nice thing about the voice VLAN feature is the only thing that is required for configuration is the specific voice VLAN configuration. Since the interface range command was specified in the requirements, each access switch can be configured with these commands:
interface range GigabitEtherent1/1/1-4, followed by switchport voice vlan 30
Known Issues in this Lab
This section of each Config Lab Answers post hopes to help with those issues by listing any known issues with Packet Tracer related to this lab. In this case, the issues are:
# | Summary | Detail |
1 | vlan 20,30 command not supported | Packet Tracer does not support the use of the vlan 20,30 command or any variation with more than one VLAN listed in the command. Instead, use two separate vlan commands. |
2 | Experimenting with IP Phones | The lab asks you to configure voice VLANs. However, to make the simulated IP Phones work, Packet Tracer requires additional DHCP Server and Call Manager Express configuration. Look to the Packet Tracer Issues tab in the “Data and Voice VLAN 1” Lab for more notes. |
Why Would Cisco Packet Tracer Have Issues?
(Note: The below text is the same in every Config Lab.)
Cisco Packet Tracer (CPT) simulates Cisco routers and switches. However, CPT does not run the same software that runs in real Cisco routers and switches. Instead, developers wrote CPT to predict the output a real router or switch would display given the same topology and configuration – but without performing all the same tasks, an actual device has to do. On a positive note, CPT requires far less CPU and RAM than a lab full of devices so that you can run CPT on your computer as an app. In addition, simulators like CPT help you learn about the Cisco router/switch user interface – the Command Line Interface (CLI) – without having to own real devices.
CPT can have issues compared to real devices because CPT does not run the same software as Cisco devices. CPT does not support all commands or parameters of a command. CPT may supply output from a command that differs in some ways from what an actual device would give. Those differences can be a problem for anyone learning networking technology because you may not have experience with that technology on real gear – so you may not notice the differences. So this section lists differences and issues that we have seen when using CPT to do this lab.
Beyond comparing your answers to this lab’s Answers post, you can test in Cisco Packet Tracer (CPT) or Cisco Modeling Labs (CML). In fact, you can and should explore the lab once configured. For this lab, once you have completed the configuration, try these verification steps.Â
- Use the show interfaces interface switchport command on the access switches for the interfaces connected to the PC and IP Phone. This command lists the configured data and voice VLAN.
The figures in this lab are not displayed on the web page for some reason.
Thanks, Jay – had a certificate issue on the site that hosts the figures. Fixed. Thanks for the note – it let me know I needed to fix.
Wendell
Hi Wendell,
Regarding the answer, shouldn’t Example 1: Access1 Config be:
GigabitEthernet1/0/1
Instead of
GigabitEthernet1/1/1?
(ranges not included)
Chris,
Yes indeed! Fixed. Thanks for the heads up.
Wendell
Hello, why wasn’t Dist1 and Dist2 configured for vlan 30?
Hi Jorge,
I believe they are. The notes about the lab state that they are, the last bullet of items pre-configured list them as pre-configured, and the initial config shows the “vlan 20,30” command, which shows they are configured. Hope this helps…
why am I getting a spanning tree issue when this lab isn’t about spanning-tree?