Bridged networking with virtd and nixos

Bridged networking in virtd

This gives each vm its own IP without involving a separate subnet / IP range.

nix config

networking.bridges.bridge0.interfaces = [ "bond0" ];
networking.interfaces.bridge0 = {
    useDHCP = false;
    ipv4.addresses = [ {
        "address" = "";
        "prefixLength" = 24;

virsh network

Create the following file, bridged.xml.

  <forward mode='bridge'/>
  <bridge name='bridge0'/>

Then define the network and connect it to the system

virsh --connect qemu:///system net-define bridged.xml
virsh net-autostart bridged


NixOS: Headless Home Assistant VM