VLAN Subinterface (802.1q)
This example configures a VLAN subinterface (IEEE 802.1q):
- rename the base interface to
trunk - set the base interface link to
up - create a VLAN subinterface for VLAN ID
42 - make device state not to track the base interface's device state
- set the subinterface link state to
up - add an ipv4 address on the subinterface
{
networking.ifstate = {
enable = true;
settings = {
interfaces = {
trunk = {
link = {
kind = "physical";
state = "up";
};
identify.perm_address = "8c:16:45:dc:b1:ad";
};
outside = {
addresses = [ "192.0.2.1/24" ];
link = {
kind = "vlan";
link = "trunk";
vlan_id = 42;
vlan_flags = {
loose_binding = true;
}
state = "up";
};
};
};
};
};
}