I am trying desperately to configure my network correctly in nixos. I am switching from a Debian based server to a new nixos based. The debian based has the following /etc/network/interfaces file:
auto lo
iface lo inet loopback
iface nic0 inet manual
auto vmbr0
iface vmbr0 inet manual
bridge-ports nic0
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes
bridge-vids 2-4094
auto vmbr0.200
iface vmbr0.200 inet static
address 172.17.20.161/24
gateway 172.17.20.2
So, actually pretty simple. But I am not able to replicate that in nixos. Can anybody help me?
Actually I tried a hundred things. Difficult to keep track.
Generally with “normal” networking.* I do not see any possibility to get the "bridge-vlan-aware” and “bridge-vids” into the configuration.
I then tried some dozend systemd.network configurations, which all provided no network connectivity on the vmbr0.200. I still have no clue what is missing, to be honest.
I’m not sure what a “VLAN-aware” bridge even is, but yes networking.bridges doesn’t support configuring one. If you use systemd.network, this is apparently supported. See [BRIDGEVLAN] section in the systemd.network(5) manual page.
Otherwise, if you know how to set one up with iproute2 commands, you can create a service that integrates with the rest of the networking scripts. Take a look at what createBridgeDevice does.