TechKnowSurge
Cisco CCNA 5.7 Cisco CCNA 2.1 Cisco CCNA 2.2
VideoNetworkFree

VLAN Hopping

VLAN hopping is an attack technique that allows adversaries to bypass network segmentation by exploiting switch spoofing and double tagging vulnerabilities. This content covers how both attack methods work and the configuration practices used to defend against them.

Complete this video to capture a CTF flag worth 1 point.

About this video

VLANs provide network segmentation by isolating traffic between groups of devices, but this isolation is not absolute. A class of attacks called VLAN hopping allows an attacker to send traffic across VLAN boundaries without authorization, undermining the security model that segmentation is designed to enforce. Two distinct techniques make this possible, and understanding both is essential for configuring switches defensively. The first technique is switch spoofing, which targets Dynamic Trunking Protocol. Many switches ship with DTP enabled by default to simplify the process of establishing trunk links between devices. An attacker can exploit this by connecting to a switch port and sending DTP messages that cause the switch to negotiate a trunk link, granting the attacker access to traffic across all VLANs. The mitigation is straightforward: disable DTP entirely by hardcoding access ports as access-only and trunk ports as trunk-only, so no port is capable of dynamically negotiating a trunk relationship. The second technique is double tagging, which exploits the way switches handle the native VLAN. An attacker connected to a port on the native VLAN crafts a frame with two 802.1Q tags — an outer tag matching the native VLAN and an inner tag belonging to a target VLAN. When the first switch receives the frame, it strips the outer native VLAN tag and forwards the remaining frame, still carrying the inner tag, toward the target VLAN. This gives the attacker one-way access to that VLAN, which is sufficient for reconnaissance or denial-of-service attacks. To counter this, the native VLAN should not be assigned to any access port, and its default value should be changed to a dedicated VLAN used solely for trunk communication with no other network function. Combined with disabling DTP, these measures eliminate the primary vectors through which VLAN hopping attacks are executed.

What you'll learn

What's covered

VLAN Hopping

Aligned to

Cisco CCNA
5.7 Configure and verify Layer 2 security features
2.1 Configure and verify VLANs (normal range) spanning multiple switches
2.2 Configure and verify interswitch connectivity

Key terms

Virtual LAN
VLAN
A logical grouping of network devices that behave as if they are on the same network regardless of physical location.
Switch
A network device that connects devices within a LAN and forwards traffic based on MAC addresses.
Spoofing
An attack where an adversary impersonates a trusted entity by falsifying data such as an IP address or email address.
VLAN Hopping
An attack in which traffic reaches a VLAN it should not, either by negotiating a trunk on a port left in dynamic mode or by double-tagging a frame so the outer tag is stripped as the native VLAN and the inner tag carries it into another VLAN.
Switch Spoofing
A VLAN hopping attack where an attacker mimics a switch by sending Dynamic Trunking Protocol messages to establish a trunk link and gain access to all VLANs.
Double Tagging
A VLAN hopping attack where an attacker on the native VLAN embeds two 802.1Q tags in a frame so that the second tag delivers the frame to a target VLAN after the first tag is stripped by an upstream switch.
Dynamic Trunking Protocol
DTP
A Cisco proprietary protocol that automatically negotiates whether to establish a VLAN trunk link between two switches. DTP allows switches to dynamically determine trunking mode, though it is often disabled in production environments for security reasons.
Native VLAN
The one VLAN on an 802.1Q trunk whose frames are sent untagged. Any untagged frame received on the trunk is assigned to it. Both ends of a trunk must be configured with the same native VLAN.

Topics

Vlan Hopping Network Segmentation Switch Spoofing Double Tagging Dynamic Trunking Protocol Native Vlan Networking

Transcript

One of the biggest reasons why we set up VLANs on our network is so that way we can isolate certain VLANs to keep them more protected. Although, an attacker can hop VLANs to jump to another VLAN.

The idea behind VLAN hopping is that an attacker wants to gain access to another VLAN, to communicate onto another VLAN, and they can do that by VLAN hopping. There's a couple of ways they can do that: one is switch spoofing, and another way is double tagging.

Switch spoofing

One thing that manufacturers will do on your switches is they'll set up the switch to do Dynamic Trunking Protocol. This way, when you connect two switches together, they can communicate all their VLANs from one switch to the other switch, and so this really speeds up the process of configuration. But then Dynamic Trunking Protocol can be leveraged to an attacker's advantage. What they can do is connect into a switch and pretend like they're another switch, to spoof another switch on the network. They can send out Dynamic Trunking Protocol messages to the other switch, thereby communicating and getting access to all the VLANs. There are some tools on Kali Linux that attackers can use to leverage this.

So how do you mitigate against this? Well, first of all, just don't use Dynamic Trunking Protocol. On access ports, we turn trunking on those access ports off completely, and then on our trunk ports we turn off Dynamic Trunking Protocol on those ports.

Double tagging

But an attacker doesn't necessarily need to have a trunk line established with a switch to attack or VLAN hop. The other way the attacker can do this is, if they are on a native VLAN, they can do what's called double tagging to access this other network.

For this to work, an attacker needs to be connected to a port on the switch that is part of the native VLAN. So they're connected to the native VLAN, and they send a frame to this native VLAN with tagging on it. This is 802.1Q tagging that's on there, and it's saying that this is part of whatever the native VLAN is. The default native VLAN is one, so we'll just say that it's part of the native VLAN of one. And then it's got a second tag here that's part of another VLAN, so let's say the second tag is part of VLAN 10.

Now this switch — switch 2 — receives this frame, sees that it's part of VLAN one, the native VLAN, and so then it will remove that part of the tag, since it's the native VLAN, and then it will forward the rest of the frame on to wherever it needs to go. Let's say it's going now to switch one. Switch 1 receives this, but it receives it with the second tag still intact, VLAN 10. So now this attacker has communicated to this switch a frame that is on a different VLAN, and now this attacker has access, to a certain degree — a one-way access — to this VLAN 10.

Now obviously, can the device on that network communicate directly back to this? They're on different VLANs. But perhaps they communicate back to the attacker through a layer three network instead, and so it routes traffic back on a different network. Or maybe this is just a denial of service attack, and so now this attacker is attacking another VLAN that's on your network for a denial of service attack. So there's several ways an attacker can actually leverage this to do harm to your network.

Mitigating VLAN hopping

How do you mitigate against VLAN hopping? For one, you just don't have the native VLAN set up on the ports — just don't use the native VLAN in general. I like to use them on some of my trunk lines, but on access ports I don't use a native VLAN. I also change the native VLAN so it's not the default. The native VLAN, if I use it, is set up for a different VLAN that doesn't have any other purpose except for just communicating across trunk lines. So those are two things that I like to do.

Another thing is not to use Dynamic Trunking Protocol, and that mitigates against that first attack that we talked about, where the attacker is using switch spoofing and they try to create a trunk line with the switch. We do that by turning all access ports into access ports, so they can't be trunk ports — they're all just access ports. Then on the trunk lines, just to be extra safe, I like to turn them on so that they are just trunk ports and there's not Dynamic Trunking Protocol going on on those trunk ports. Therefore now you don't have DTP running on any of your ports, and that mitigates against that issue.

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →