From f09443f222688cfb46857e7d928af3d555fac822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Sun, 23 Apr 2023 15:46:38 +0100 Subject: [PATCH] networking: Set up static IP address --- configuration/default.nix | 47 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/configuration/default.nix b/configuration/default.nix index 2a4ce63..09c8cb2 100644 --- a/configuration/default.nix +++ b/configuration/default.nix @@ -51,10 +51,7 @@ networking = { hostName = "tlaternet"; - usePredictableInterfaceNames = false; - useDHCP = false; - interfaces.eth0.useDHCP = true; firewall = { allowedTCPPorts = [ @@ -95,6 +92,50 @@ }; }; + systemd.network = { + enable = true; + + networks = { + "10-eth0.network" = { + matchConfig.Name = "eth0"; + + networkConfig = { + DHCP = "no"; + + Address = "178.79.137.55"; + Gateway = "178.79.137.1/24"; + + Domains = "ip.linodeusercontent.com"; + DNS = [ + "178.79.182.5" + "176.58.107.5" + "176.58.116.5" + "176.58.121.5" + "151.236.220.5" + "212.71.252.5" + "212.71.253.5" + "109.74.192.20" + "109.74.193.20" + "109.74.194.20" + "2a01:7e00::9" + "2a01:7e00::3" + "2a01:7e00::c" + "2a01:7e00::5" + "2a01:7e00::6" + "2a01:7e00::8" + "2a01:7e00::b" + "2a01:7e00::4" + "2a01:7e00::7" + "2a01:7e00::2" + ]; + + IPv6PrivacyExtensions = "no"; + IPv6AcceptRA = "yes"; + }; + }; + }; + }; + time.timeZone = "Europe/London"; users.users.tlater = {