Route Device via Mac to Different VLAN

I have a Host Machine, A, that is on VLAN300 and I have a Virtual Machine, B, running on Host A. I want VM B to use to VLAN400 instead of VLAN300. How could I achieve this? I assume I could just route the Mac Address to VLAN400 but I'm a bit lost on how to accomplish this.

You can't, not using MAC addresses. You either need to use the different tagged VLAN ID, or connect to a dedicated switch port.

1 Like

Its a Virtual Machine so I can't plug it directly. Well I can if I probably plug an Ethernet USB/USB to the VM then use an Ethernet but I have no more free ports. A WiFi adapter may work but I was hoping there was another way.

Host A connected to VLAN300 via WiFi and I have the VM's NIC setup as a Bridged so it connects to the router.

Assuming a lot of things, including that VLAN 400 is even available on the switch port the host is connected to: create an interface on the host for VLAN 400, with no address. In Linux this would be ethX.400, windows and mac presumably have their own way. Bridge the VM to that interface rather than the default interface. No need to do any VLAN specific stuff on the VM's interface, it should just inherit it.

1 Like

In the default 3-address mode, a wifi station (client) interface cannot be joined to a bridge, and WiFi links cannot carry VLAN tags.

Possible solutions: