File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -82,24 +82,26 @@ nixpkgs.lib.nixosSystem {
82
82
} ;
83
83
networks . virbr0 = {
84
84
matchConfig . Name = "virbr0" ;
85
+
86
+ addresses = [ {
87
+ addressConfig . Address = "10.0.0.1/24" ;
88
+ } {
89
+ addressConfig . Address = "fd12:3456:789a::1/64" ;
90
+ } ] ;
85
91
# Hand out IP addresses to MicroVMs.
86
92
# Use `networkctl status virbr0` to see leases.
87
93
networkConfig = {
88
94
DHCPServer = true ;
89
95
IPv6SendRA = true ;
90
96
} ;
91
- dhcpServerStaticLeases = [ {
92
- # Let DHCP assign a statically known address to the qemu vm
97
+ # Let DHCP assign a statically known address to the VMs
98
+ dhcpServerStaticLeases = lib . imap0 ( i : hypervisor : {
93
99
dhcpServerStaticLeaseConfig = {
94
- MACAddress = hypervisors-with-mac . qemu ;
95
- Address = "10.0.13.37 " ;
100
+ MACAddress = hypervisorMacAddrs . ${ hypervisor } ;
101
+ Address = "10.0.0. ${ toString ( 2 + i ) } " ;
96
102
} ;
97
- } ] ;
98
- addresses = [ {
99
- addressConfig . Address = "10.0.0.1/24" ;
100
- } {
101
- addressConfig . Address = "fd12:3456:789a::1/64" ;
102
- } ] ;
103
+ } ) ( builtins . attrNames hypervisorMacAddrs ) ;
104
+ # IPv6 SLAAC
103
105
ipv6Prefixes = [ {
104
106
ipv6PrefixConfig . Prefix = "fd12:3456:789a::/64" ;
105
107
} ] ;
You can’t perform that action at this time.
0 commit comments