better network config

This commit is contained in:
Christoph Cullmann 2023-06-12 18:19:39 +02:00
parent 6ce1c0045f
commit 3f0c32302d
3 changed files with 16 additions and 18 deletions

View file

@ -62,20 +62,6 @@ in
# allow all firmware
hardware.enableAllFirmware = true;
# use systemd-networkd
networking.useDHCP = false;
systemd.network.enable = true;
systemd.network.networks."10-wan" = {
networkConfig = {
# start a DHCP Client for IPv4 Addressing/Routing
DHCP = "ipv4";
# accept Router Advertisements for Stateless IPv6 Autoconfiguraton (SLAAC)
IPv6AcceptRA = true;
};
# make routing on this interface a dependency for network-online.target
linkConfig.RequiredForOnline = "routable";
};
# ensure firewall is up, allow ssh and http in
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [ 22 ];

View file

@ -17,8 +17,14 @@
# host name
networking.hostName = "mini";
# main network interface
systemd.network.networks."10-wan".matchConfig.Name = "eno1";
# main network interface via systemd-networkd
networking.useDHCP = false;
systemd.network.enable = true;
systemd.network.networks."10-lan" = {
matchConfig.Name = "eno1";
networkConfig.DHCP = "yes";
linkConfig.RequiredForOnline = "routable";
};
# amd graphics
hardware.opengl.extraPackages = with pkgs; [ amdvlk rocm-opencl-icd rocm-opencl-runtime ];

View file

@ -17,8 +17,14 @@
# host name
networking.hostName = "neko";
# main network interface
systemd.network.networks."10-wan".matchConfig.Name = "enp9s0";
# main network interface via systemd-networkd
networking.useDHCP = false;
systemd.network.enable = true;
systemd.network.networks."10-lan" = {
matchConfig.Name = "enp9s0";
networkConfig.DHCP = "yes";
linkConfig.RequiredForOnline = "routable";
};
# intel graphics
hardware.opengl.extraPackages = with pkgs; [ intel-media-driver intel-compute-runtime ];