about summary refs log tree commit diff
path: root/nixos/modules/tasks/network-interfaces-scripted.nix
diff options
context:
space:
mode:
authorjpathy <15735913+jpathy@users.noreply.github.com>2022-03-22 20:24:25 +0530
committerJiten Kumar Pathy <jiten@lazycons.xyz>2022-03-23 00:24:44 +0530
commit19bb72c07070597f75f78ecc8673afde75fd7a4b (patch)
tree11b7756eec86b9c0463fe92b675338edef11b248 /nixos/modules/tasks/network-interfaces-scripted.nix
parent29a988f9781aa746d5afa4a4d3029e22490bb757 (diff)
downloadnixlib-19bb72c07070597f75f78ecc8673afde75fd7a4b.tar
nixlib-19bb72c07070597f75f78ecc8673afde75fd7a4b.tar.gz
nixlib-19bb72c07070597f75f78ecc8673afde75fd7a4b.tar.bz2
nixlib-19bb72c07070597f75f78ecc8673afde75fd7a4b.tar.lz
nixlib-19bb72c07070597f75f78ecc8673afde75fd7a4b.tar.xz
nixlib-19bb72c07070597f75f78ecc8673afde75fd7a4b.tar.zst
nixlib-19bb72c07070597f75f78ecc8673afde75fd7a4b.zip
networking.greTunnels: Add ttl option
Diffstat (limited to 'nixos/modules/tasks/network-interfaces-scripted.nix')
-rw-r--r--nixos/modules/tasks/network-interfaces-scripted.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/nixos/modules/tasks/network-interfaces-scripted.nix b/nixos/modules/tasks/network-interfaces-scripted.nix
index 19f2be2c4a25..b0f160c1dbf9 100644
--- a/nixos/modules/tasks/network-interfaces-scripted.nix
+++ b/nixos/modules/tasks/network-interfaces-scripted.nix
@@ -535,6 +535,7 @@ let
         createGreDevice = n: v: nameValuePair "${n}-netdev"
           (let
             deps = deviceDependency v.dev;
+            ttlarg = if lib.hasPrefix "ip6" v.type then "hoplimit" else "ttl";
           in
           { description = "GRE Tunnel Interface ${n}";
             wantedBy = [ "network-setup.service" (subsystemDevice n) ];
@@ -551,6 +552,7 @@ let
               ip link add name "${n}" type ${v.type} \
                 ${optionalString (v.remote != null) "remote \"${v.remote}\""} \
                 ${optionalString (v.local != null) "local \"${v.local}\""} \
+                ${optionalString (v.ttl != null) "${ttlarg} ${toString v.ttl}"} \
                 ${optionalString (v.dev != null) "dev \"${v.dev}\""}
               ip link set "${n}" up
             '';