@@ -8,7 +8,9 @@ with import ../lib/testing-python.nix { inherit system pkgs; };
88with pkgs.lib;
99
1010let
11− router = { config, pkgs, ... }:
11+ qemu-flags = import ../lib/qemu-flags.nix { inherit pkgs; };
12+
13+ router = { config, pkgs, lib, ... }:
1214 with pkgs.lib;
1315 let
1416 vlanIfs = range 1 (length config.virtualisation.vlans);
@@ -31,16 +33,19 @@ let
3133 enable = true;
3234 interfaces = map (n: "eth${toString n}") vlanIfs;
3335 extraConfig = ''
34− authoritative;
3536 '' + flip concatMapStrings vlanIfs (n: ''
3637 subnet 192.168.${toString n}.0 netmask 255.255.255.0 {
3738 option routers 192.168.${toString n}.1;
38− # XXX: technically it's _not guaranteed_ that IP addresses will be
39− # issued from the first item in range onwards! We assume that in
40− # our tests however.
41− range 192.168.${toString n}.2 192.168.${toString n}.254;
4239 }
43− '');
40+ '')
41+ ;
42+ machines = lib.flip map vlanIfs (vlan:
43+ {
44+ hostName = "client${toString vlan}";
45+ ethernetAddress = qemu-flags.qemuNicMac vlan 1;
46+ ipAddress = "192.168.${toString vlan}.2";
47+ }
48+ );
4449 };
4550 services.radvd = {
4651 enable = true;