VLAN Tagging on a Normal Switch
I have wondered, is it possible to use vlan tagging on a normal ethernet swtich? A quick google didn’t give me a clear awnser. But What I have found out is that what distinguises a normal ethernet frame from a VLAN tagged one is really the ethertype.
So when I use a managed switch that strips the tags off, or routes them to the right ports at least. It just checks the ethertype as 0x8100 as appose to 0x0800 for IPv4 or 0x0806 for ARP that you normally see.
I have two laptops, two ethernet cables and a ethernet switch, in this case a Netgear GS105.
First off, if you don’t have the vlan module, install it. It does not come with my debian/ubuntu machines by default.
sudo apt-get install vlan
sudo modprobe 8021q
Once it’s all loaded, create a vlan on both machines!
vconfig eth0 10
vconfig eth0 11
Once they are created, assign the ips on laptop one + two. Set the IPs unique to both ends!
sudo ipconfig eth0 10.0.0.x/24
sudo ipconfig eth0.10 10.0.10.x/24
sudo ipconfig eth0.11 10.0.11.x/24
I have used a direct link of ethernet with a single cable, and can ping each ip address with and without tagging. I used wireshark to show this was the a working setup and saw the right use of vlan tagging on the 10 and 11 tags.
So the final test, both wired into the same switch. *drum roll* Yes! it worked. I thought correctly. I wonder if it is true for all dumb un-managed switches. This could be useful for mixing managed and un-managed switches together.
My next test will be setting up vlan taging on a windows machine.