From 44aa8ae7ec95d4fdc90e6a01a7019fb8d8daaa03 Mon Sep 17 00:00:00 2001
From: Leon Vatthauer <leon.vatthauer@fau.de>
Date: Wed, 8 May 2024 16:35:56 +0200
Subject: [PATCH] static ipv6

---
 dafoe/configuration.nix | 15 ++++++++++++++-
 dafoe/services/ssh.nix  |  2 +-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/dafoe/configuration.nix b/dafoe/configuration.nix
index 09539ce..bd5b462 100644
--- a/dafoe/configuration.nix
+++ b/dafoe/configuration.nix
@@ -19,10 +19,23 @@
   boot.loader.grub.device = "/dev/sda";
 
   networking.hostName = "dafoe"; # Define your hostname.
-  #networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.
+
+  # open ports for servers
   networking.firewall.allowedTCPPorts = [ 22 80 443 631 8096 8920 ];
   networking.firewall.allowedUDPPorts = [ 22 80 443 631 1900 7359 ];
 
+  # static ipv6 (hetzner cant manage ipv6 via dhcp)
+  networking.interfaces = {
+    ens3.ipv6.addresses = [{ 
+      address = "2a01:4f8:1c1e:83ae::";
+      prefixLength = 64;
+    }];
+  };
+  networking.defaultGateway6 = {
+    address = "fe80::1";
+    interface = "ens3";
+  };
+
   # Set your time zone.
   time.timeZone = "Europe/Berlin";
 
diff --git a/dafoe/services/ssh.nix b/dafoe/services/ssh.nix
index dba27db..650c7fc 100644
--- a/dafoe/services/ssh.nix
+++ b/dafoe/services/ssh.nix
@@ -1,4 +1,4 @@
 {
   # Enable the OpenSSH daemon.
   services.openssh.enable = true;
-}
\ No newline at end of file
+}