Labels

Saturday, May 25, 2013

Figured out how to make a set of tagged vlans from the Mac Mini

I was successful in determining how to set up the connection between two managed switches in my network to be a trunk with multiple tagged vlans.  I thought it might be nice to figure out how to have a trunk from my Mac Mini to one of my managed switches with the same capability.  I did determine how to add a port connection to a different vlan from the Mac via a USB to Ethernet adapter.  I decided to take the idea one step further and get a Thunderbolt to Gigabit Ethernet adapter for the purpose of getting the most speed out of the trunk line.  I plugged the adapter into Mac and fed an ethernet cable from the closest managed switch.  I then gave the adapter a fixed ip address in the home network range (same as the Mac); to have an ip address when the trunk cable is then limited to just tagged packets.  I created some VLAN Adapters on the network tool by running System Preferences -> Network, selecting the starred button on the bottom of the interface list and selecting "Manage Virtual Interfaces".  On each of these vlans I added a connection to the new adapter, selected DHCP, and set the vlan ID.  On the managed switch, at the port that my adapter was connected to, I selected the PVID line to be "VLAN only"; that makes sure that only tagged vlan packets are passed on.

In order to test this combination, I took one of the VMs that I had previously connected to the USB-Ethernet adapter and changed the bridge interface to connect to one of these new VLAN Adapters, with the same vlan ID as the USB-Ethernet adapter vlan ID.  I rebooted the VM and checked the ip that the VM had obtained.  It came back with the previous subnet that it was connected to and the same ip on that subnet (my third router remembers).  Once I was sure that the VLAN Adapter was working correctly, I moved all of the other VMs to that VLAN Adapter.  Now I have the same circuit setup as before, only this time I can reuse the trunk cable for additional tagged vlan traffic.

My next trick will be to setup a VM based router to allow traffic between vlans via the VLAN Adapters.