Creating VLAN Interfaces on Debian 11
I’ve had trouble finding good documentation on how to create VLAN interfaces on a Debian machine, so here I am tossing my proverbial hat into the ring in hopes that someone will find this useful.
Many guides will tell you to just edit your /etc/network/interfaces
file and have it look something like this:
In my experience this will not work. The interface will not show up and ifup
will not activate it.
What you want to do instead is define a file in /etc/network/interfaces.d/
like so:
For VLAN interfaces in which you need to make up a MAC address I use a one-liner like this to avoid MAC duplication in my local network:
So yeah, this is how I got it working in my case. Hope this helps you!