From 176b2638034be2a31b83aaaa7e1d175d5d72ca61 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Mon, 10 Mar 2025 14:33:18 +0100 Subject: [PATCH] ServeNix: Enable IPv6 --- ServeNix/configuration.nix | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/ServeNix/configuration.nix b/ServeNix/configuration.nix index 5457938..ab18cfa 100644 --- a/ServeNix/configuration.nix +++ b/ServeNix/configuration.nix @@ -98,16 +98,32 @@ # Enable networking networkmanager.enable = true; + enableIPv6 = true; + + interfaces.ens18 = { + ipv4.addresses = [ + { + address = "192.168.86.25"; + prefixLength = 24; + } + ]; + + ipv6.addresses = [ + { + address = "fd00::25"; + prefixLength = 120; + } + ]; + }; - interfaces.ens18.ipv4.addresses = [{ - address = "192.168.86.25"; - prefixLength = 24; - }]; defaultGateway = "192.168.86.5"; + defaultGateway6 = "fd00::5"; + nameservers = [ # "127.0.0.1" - "192.168.86.26" # "8.8.8.8" + "192.168.86.26" + "fd00::26" ]; }; @@ -127,9 +143,9 @@ if [ -z "$check" ]; then # TODO: Disable IP masquerading to show individual containers in AdGuard/Pi-Hole # - Disabling this prevents containers from having internet connection. DNS issue? - # ${dockercli} network create -o "com.docker.network.bridge.enable_ip_masquerade"="false" ${network} + # ${dockercli} network create -o "com.docker.network.bridge.enable_ip_masquerade"="false" -o "enable_ipv6"="true" ${network} - ${dockercli} network create ${network} + ${dockercli} network create -o "enable_ipv6"="true" ${network} else echo "${network} already exists in docker" fi @@ -231,10 +247,14 @@ # setSocketVariable = true; # }; daemon.settings = { + ipv6 = true; + fixed-cidr-v6 = "2001::/80"; + dns = [ # TODO: Does this circumvent my DNS for each container? # It might improve gitea actions though... "8.8.8.8" + "2001:4860:4860::8888" # TODO: Might prevent containers from having DNS? # "127.0.0.1"