Just a quick post on something I was struggling with recently, as the whole thing seemed unintuitive. At least compared to Proxmox, where you just drop the VLAN tag during VM/LXC creation and off you go.
So, in short, I recently upgraded my Unraid box and wanted to run some Windows Server VMs on it, but they should be in a separate VLAN for the sake of compartmentalization. I hadn’t really used VM’s on Unraid before and couldn’t find a way to do the networking in a way similar to Proxmox, but eventually found information I could build on to enable VLANs in a working fashion.
Note that all of this assumes that you have already set up the VLAN using networking equipment that supports such a feature.
1. Disable Docker and VM Manager
Simple enough, just go to Settings and under Docker and VM Manager set the very first dropdown to No on both. This will stop them less surprisingly, so maybe do this during the time when there’s not too much use going on.
2. Enable VLANs and add a new interface
Next, go to Network Settings and set Enable VLANs to Yes. This will give you new options like the following:
- Interface description - Just give it a descriptive name
- VLAN number - I guess this is anything from 1 to 4096
- Network protocol - Select the protocol used, probably just IPv4
- IPv4 address assignment: Set to static
- IPv4 address: Set this to the address you want on your Unraid box, and set the CIDR notation accordingly.
- IPv4 default gateway: Set this to the IP of the gateway in your VLAN.
Click Apply and you’re done.
3. Launch Docker and VM Manager
Basically the opposite of the first step. I trust you to get this done.
4. Change the interface in the VM settings
Finally, you’ll need to edit the VM(s) themselves and change the Network Source to the new interface, which in this example is br0.100 for VLAN 100.
And there you go, now your VMs are working nicely with the VLAN of your choice.