summary refs log tree commit diff
path: root/nixos/modules/tasks
diff options
context:
space:
mode:
authorMathijs Kwik <mathijs@bluescreen303.nl>2013-12-30 00:53:45 -0800
committerMathijs Kwik <mathijs@bluescreen303.nl>2013-12-30 00:53:45 -0800
commit3668970f7fb8c900d1210be28c90c44e0ef430eb (patch)
tree508bf25b79657a56c320c3a54d1e95ebfb32b947 /nixos/modules/tasks
parent9b056e1e3ec4312ffd6043f13aa068da09908335 (diff)
parentc6ab810e37c96abea58067f9102c88429e179f2b (diff)
downloadnixlib-3668970f7fb8c900d1210be28c90c44e0ef430eb.tar
nixlib-3668970f7fb8c900d1210be28c90c44e0ef430eb.tar.gz
nixlib-3668970f7fb8c900d1210be28c90c44e0ef430eb.tar.bz2
nixlib-3668970f7fb8c900d1210be28c90c44e0ef430eb.tar.lz
nixlib-3668970f7fb8c900d1210be28c90c44e0ef430eb.tar.xz
nixlib-3668970f7fb8c900d1210be28c90c44e0ef430eb.tar.zst
nixlib-3668970f7fb8c900d1210be28c90c44e0ef430eb.zip
Merge pull request #1430 from wkennington/mtu
network-interfaces: Add mtu setting support
Diffstat (limited to 'nixos/modules/tasks')
-rw-r--r--nixos/modules/tasks/network-interfaces.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix
index 1249fabc309a..3ecc2d4d5286 100644
--- a/nixos/modules/tasks/network-interfaces.nix
+++ b/nixos/modules/tasks/network-interfaces.nix
@@ -58,6 +58,15 @@ let
         '';
       };
 
+      mtu = mkOption {
+        default = null;
+        example = 9000;
+        type = types.nullOr types.int;
+        description = ''
+          MTU size for packets leaving the interface. Leave empty to use the default.
+        '';
+      };
+
       virtual = mkOption {
         default = false;
         type = types.bool;
@@ -381,6 +390,11 @@ in
                   echo "setting MAC address to ${i.macAddress}..."
                   ip link set "${i.name}" address "${i.macAddress}"
                 ''
+              + optionalString (i.mtu != null)
+                ''
+                  echo "setting MTU to ${toString i.mtu}..."
+                  ip link set "${i.name}" mtu "${toString i.mtu}"
+                ''
               + optionalString (i.ipAddress != null)
                 ''
                   cur=$(ip -4 -o a show dev "${i.name}" | awk '{print $4}')