Skip to content

Instantly share code, notes, and snippets.

@sedlund
Last active December 31, 2025 09:47
Show Gist options
  • Select an option

  • Save sedlund/0152e7e32f3d6e2318a31a0e4e79b499 to your computer and use it in GitHub Desktop.

Select an option

Save sedlund/0152e7e32f3d6e2318a31a0e4e79b499 to your computer and use it in GitHub Desktop.
# this is a snippet without context, not a complete module
networking = {
useDHCP = false;
};
systemd = {
network = {
enable = true;
networks."40-ens3" = {
name = "ens3";
address = [
"167.10.10.15/25"
"2a11:8000:10:1000::a/64"
];
gateway = [ "167.10.10.254" ];
dhcpV4Config = {
# Provider offers Google DNS
UseDNS = false;
};
dns = [
# resolved allows max 6
"2620:fe::fe#dns.quad9.net"
"2620:fe::9#dns.quad9.net"
"9.9.9.9#dns.quad9.net"
"149.112.112.112#dns.quad9.net"
];
networkConfig = {
DNSOverTLS = true;
DNSSEC = "allow-downgrade";
IPv6AcceptRA = false;
};
routes = [
{
Gateway = "2a11:8000:10::1";
GatewayOnLink = true;
# IPv6Preference = "high";
}
];
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment