mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
nixos/lxd: use networkd for DHCP/RA
Enables networkd instead of dhcpcd for DHCP/RA. It offers a solid base for network configuration, that is much more extensible than dhcpcd and also better maintained than our bespoke `networking.interfaces` modules. Closes: #287269
This commit is contained in:
parent
6f5673f731
commit
73e19e1a8d
2 changed files with 32 additions and 4 deletions
|
@ -13,8 +13,22 @@
|
||||||
./lxd.nix
|
./lxd.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.useDHCP = false;
|
networking = {
|
||||||
networking.interfaces.eth0.useDHCP = true;
|
dhcdpcd.enable = false;
|
||||||
|
useDHCP = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.network = {
|
||||||
|
enable = true;
|
||||||
|
networks."50-eth0" = {
|
||||||
|
matchConfig.Name = "eth0";
|
||||||
|
networkConfig = {
|
||||||
|
DHCP = "ipv4";
|
||||||
|
IPv6AcceptRA = true;
|
||||||
|
};
|
||||||
|
linkConfig.RequiredForOnline = "routable";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
system.stateVersion = "@stateVersion@"; # Did you read the comment?
|
system.stateVersion = "@stateVersion@"; # Did you read the comment?
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,20 @@
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Network
|
# Network
|
||||||
networking.useDHCP = false;
|
networking = {
|
||||||
networking.interfaces.enp5s0.useDHCP = true;
|
dhcdpcd.enable = false;
|
||||||
|
useDHCP = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.network = {
|
||||||
|
enable = true;
|
||||||
|
networks."50-enp5s0" = {
|
||||||
|
matchConfig.Name = "enp5s0";
|
||||||
|
networkConfig = {
|
||||||
|
DHCP = "ipv4";
|
||||||
|
IPv6AcceptRA = true;
|
||||||
|
};
|
||||||
|
linkConfig.RequiredForOnline = "routable";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue