Config Lab: Trunking Puzzle 1
You can memorize VLAN trunking commands by staring at a table – but you will remember them much better if you try different combinations in sample labs, especially if you try them from the CLI of some gear or simulator. This is a great lab to do on your gear for that reason. The lab: look at a few different contrived VLAN trunking requirements that are meant to make you exercise your memory of VLAN trunking configuration options, and then check the status to find out if the link is actually trunking.
The Lab Exercise
Requirements
Configure IEEE 802.1Q trunking between the devices shown in the figure. The specific rules for this lab are:
- Configure SW1’s trunks so that they will actively attempt to form trunks with attached switches.
- Configure the trunk between SW2 and SW3 using manual trunking and disable DTP.
- Configure SW4’s trunks to use manual trunking.
- Assume all interfaces shown in the lab are up and working.
Figure 1: Four Switches with Trunks
Initial Configuration
Examples 1, 2, 3, and 4 show the beginning configuration state of SW1, SW2, SW3, and SW4.
hostname SW1
Example 1: SW1 Config
hostname SW2
Example 2: SW2 Config
hostname SW3
Example 3: SW3 Config
hostname SW4
Example 4: SW4 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) or CML Free (CML-F). The downloadable file listed here works in both CML-P or CML-F because it uses the IOL (router) and IOL-L2 (switch) reference platform images supported by both products as of CML V2.8. Note that these images also require less CPU and RAM than the other CML-P options.
Use the same general workflow as with Cisco Packet Tracer, as follows:
- Download the CML file (filetype .yaml) linked below.
- Import the lab’s CML file into CML.
- Start the lab in CML.
- Compare the CML lab topology and interface IDs to this lab Blog page, as they may differ (more detail below).
- Add your planned configuration to the lab, adjusting for interface ID differences.
- Test the configuration using some of the suggestions below.
Download this lab’s CML file!
Network Device Info:
Device | Lab Port | Â CML Port |
SW1 | G1/0/1 | E0/1 |
SW1 | G1/0/2 | E0/2 |
SW2 | G1/0/1 | E0/1 |
SW2 | G1/0/2 | E0/2 |
SW2 | G1/0/3 | E0/3 |
SW3 | G1/0/1 | E0/1 |
SW3 | G1/0/2 | E0/2 |
SW4 | G1/0/1 | E0/1 |
SW4 | G1/0/2 | E0/2 |
SW4 | G1/0/3 | E0/3 |
Lab Answers Below: Spoiler Alert
Lab Answers: Configuration (Click Tab to Reveal)
Answers
Figure 1: Four Switches with Trunks
interface GigabitEthernet1/0/1
switchport mode dynamic desirable
!
interface GigabitEthernet1/0/2
switchport mode dynamic desirable
Example 5: SW1 Config
interface GigabitEthernet1/0/2
switchport mode trunk
switchport nonegotiate
Example 6: SW2 Config
Interface GigabitEthernet1/0/2
switchport mode trunk
switchport nonegotiate
Example 7: SW3 Config
Interface GigabitEthernet1/0/1
switchport mode trunk
!
interface GigabitEthernet1/0/2
switchport mode trunk
Example 8: SW4 Config
Commentary, Issues, and Verification Tips (Click Tabs to Reveal)
Commentary
When configuring trunking between switches, a few questions need to be answered, including: Should dynamic trunking be used? And if so, which device should initiate the trunk? If not, and manual trunking is enabled, should you also disable DTP?
For this lab, you are tasked with configuring several trunks between devices. Obviously, in a real environment, the trunking encapsulation and mode will be more consistent across the network; however, we require you to understand how to configure the various trunking modes for this lab.
First, the lab requirements tell you to make SW1 actively attempt to form a trunk with its neighboring switches. This mode is called dynamic desirable on Cisco switches and is configured with the switchport mode dynamic desirable command.
Second, the lab requirements tell you to configure the switch SW2 interface between itself (Gi1/0/2) and SW3 (Gi1/0/2) to use manual trunking and disable DTP. To do so, configure the Gi0/2 interface on both SW2 and SW3 to manually trunk using the switchport mode trunk command. Then, to disable DTP, you use the switchport nonegotiate command.
Finally, the lab also asks you to configure SW4’s interfaces to use manual trunking. To do so, you should configure these ports on SW4 like SW2 and SW3 in this lab, except that you do not disable DTP.
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 | PT may require the switchport trunk encapsulation command for trunking | Packet Tracer LAN switches operate like older Cisco switch generations in that they support both ISL and 802.1Q trunking. To make a trunk work in this lab, you may need to configure the switchport trunk encapsulation dot1q command on each switch interface. Depending on the PT version and switch model used in PT, you also may not need the command. |
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 as 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 owning 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.
Known Issues in this Lab w/ CML
This tab lists known issues with running this lab in CML with the supplied file. The issues are:
# | Summary | Detail |
1 | The used LAN switch image (IOL-L2) requires the switchport trunk encapsulation dot1q interface subcommand for trunking | The IOL-L2 image in CML (introduced in 2024) works great as a low-overhead switch in CML. However, it acts like old Cisco switch generations in supporting ISL and 802.1Q trunking encapsulation. Newer switches support only 802.1Q. To make a trunk work in this lab, you may need to configure the switchport trunk encapsulation dot1q interface subcommand. This lab pre-configures this command. |
Why Would CML Have Issues?
(Note: The text below is the same as every Config Lab.)
CML supports a variety of Cisco operating systems (called reference platforms.) To make them work in CML, Cisco makes some adjustments to the code. Also, because no real router or switch hardware exists, some software features do not work the same when running in CML versus a real Cisco device. When we come across any difference when testing the lab, we’ll try and leave a note just above in case it helps you with the 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.Â
- Each device should now be successfully trunking on all interfaces connecting to the other switches. To verify, issue the show interfaces trunk command on each device. Note that you need to check the status on both ends of the link.
- Alternately, use the show interfaces interface switchport command, which will show a more detailed display of the encapsulation and mode that an interface is currently using.
I’m not sure why but using the unchanged .pkt file, every time I try to set SW2 g1/0/2, SW3 g1/0/2 & SW4 (g1/0/1 & g1/0/2) to switchport mode trunk, I get the following error:
Command rejected: An interface whose trunk encapsulation is “Auto” can not be configured to “trunk” mode.
I also get an error when attempting to set SW2 & SW3 interfaces to switchport nonegotiate.
Command rejected: Conflict between ‘nonegotiate’ and ‘dynamic’ status.
Ray,
See the tab “Known Packet Tracer Issues” for the detail on setting the trunk encapsulation so that the trunking works.
On your second point, I didn’t know that, but it’s a Packet Tracer issue as well. Real switches wouldn’t give that error. I’ll do a little testing (maybe after Christmas at this point) and update the Packet Tracer Issues tab for that one as well.
Wendell
use the command switchport trunk encapsulation dot1q in interface config mode
As far as I understand it the reason you are getting that error is because the switch being used can be configured to use either CISCO ISL or IEEE dot1q as its trunking encapsulation protocols. Since that is the case you must first specify the encapsulation protocol to be used on the interface and before you can manually set the interface to always trunk.
SW2(config)# interface g1/0/2
SW2(config-if)# switchport trunk encapsulation dot1q
SW2( config-if)# switchport mode trunk
SW2(config-if)# switchport nonegotiate
A more modern CISCO Switch will only support dot1q as its trunking encapsulation protocol. Since that is the case you no longer have to specify the encapsulation protocol and just just have to specify the interface administrative mode.
SW2(config)# interface g1/0/2
SW2( config-if)# switchport mode trunk
SW2(config-if)# switchport nonegotiate
CML file is missing for Config Lab: Trunking Puzzle 1
I think CML link for Config Lab Trunking Puzzle 1 should point to https://files.certskills.com/virl/clab101.yaml instead of https://files.certskills.com/virl/cl101.yaml
Thank you
Ramin,
Thanks for the note. I fixed the link. File should be clab115.yaml once downloaded.
Wendell
Hi I believe there is a discrepancy in the required tasks and the commentary at the end.
Your requirements are stated as:
-Configure SW1’s trunks so that they will actively attempt to form trunks with attached switches.
-Configure the trunk between SW2 and SW3 using manual trunking and disable DTP.
-Configure SW4’s trunks to use manual trunking.
-Assume all interfaces shown in the lab are up and working.
But then go on to say (I believe incorrectly):
-Second, the lab requirements tell you to configure the switch SW1 interface between itself (Gi1/0/2) and SW3 (Gi1/0/2) to use manual trunking and disable DTP. To do so, configure the Gi0/2 interface on both SW1 and SW3 to manually trunk using the switchport mode trunk command. Then, to disable DTP, you use the switchport nonegotiate command.
The second step above asks to configure manual trunking and disable DTP on SW2 not SW1 as stated in the commentary.
That being said, I believe the answer shown for SW1 to be wrong in ‘Example 5: SW1 config.’
Am I missing something here?
Hi Gabriel,
Thanks for the note. I agree, there was something off in the lab. However, I think the lab requirements and answer are good, but the explanation on the second point was wrong. If you look for the paragraph in the Lab Commentary that begins with “Second…”, that’s the paragraph about the SW2-SW3 trunk, but it was mistakenly referencing SW1 and SW3. All I did was change all the SW1 references to SW2 and we’re all matched up.
Thanks for letting me know.
Regards,
Wendell
.Configure the trunk between SW2 and SW3 using manual trunking and disable DTP.
question:
So the switchport non negotiate command disables trunking?
if correct then y do we use trunk in the first place , y not access?
or non negotiate command has some other purpose?
Hi Sana,
The **switchport nonegotiate** command disables DTP, the protocol used to dynamically negotiate trunking. But it does not prevent manual configuration eg **Switchport mode trunk** on both ends.
Wendell
Hello Wendell,
Please a question. I am using switch model 2950-24 in packet tracer to work through some exercises and I noticed the switch appear to be preconfigured to trunk. I checked the switch interfaces and they come already configured as dynamic desirable. My question is this: Is this the way the switch come configured in real life? Are they set to dynamic desirable out of the box? Thanks
Well, you’re asking an old guy about settings on an old switch… 🙂
But in this case, I remember. But first, PT is a simulator, so I automatically distrust defaults and accuracy. It’s a great tool, but as a simulator, it is not an exact match vs. real. That said, real 2950 switches defaulted to switchport mode dynamic desirable. 2960s, which were the natural replacement in the product line, were “auto”. I can even remember a transition from showing examples in the books with 2950s, based on “desirable”, over to 2960s, with “auto”, and needing to check to make sure any implied use of defaults was accounted for in the text.
Wendell
CPT does not allow me to use the “switchport trunk encapsulation” when I am in Interface Configuration mode for a single interface, but only when I have first used interface range command to insert interface configuration mode.
It’s an old command. You can ignore it.
thank you very much for your response