Skip to content

Commit 20be6dc

Browse files
committed
Use macvtap for direct external network access in nixos tests
Configure virtualisation.qemu.networkingOptions to use macvtap instead of QEMU user-mode networking. This allows the test VM to directly access the host's physical network interface without needing a bridge, enabling external connectivity for container image pulls and DNS resolution.
1 parent 9ba1c93 commit 20be6dc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/nixos/cluster-module.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,16 @@
126126
"kernel.panic_on_oops" = 1;
127127
};
128128

129-
# -- VM sizing for kubeadm cluster --
129+
# -- VM sizing and networking for kubeadm cluster --
130130
virtualisation = {
131131
memorySize = 4096;
132132
diskSize = 10240;
133133
cores = 4;
134+
# Use macvtap for direct external network access
135+
# Taps directly into host physical interface, no bridge needed
136+
qemu.networkingOptions = [
137+
"-nic type=macvtap,ifname=eth0,model=virtio-net-pci"
138+
];
134139
};
135140

136141
# -- Interactive debug user --

0 commit comments

Comments
 (0)