diff options
author | pennae <github@quasiparticle.net> | 2021-08-11 12:48:43 +0200 |
---|---|---|
committer | tomberek <tomberek@users.noreply.github.com> | 2021-10-16 20:48:03 -0400 |
commit | c1f515547109a7e1845120449676ba6aa9a78fe9 (patch) | |
tree | 487ec319ee52767d36bb80cb59f3e1a433c0324b /nixos/modules/tasks/network-interfaces-systemd.nix | |
parent | f29ea2d15d833494f7e97e0231b03ca70a8e7db4 (diff) | |
download | nixpkgs-c1f515547109a7e1845120449676ba6aa9a78fe9.tar nixpkgs-c1f515547109a7e1845120449676ba6aa9a78fe9.tar.gz nixpkgs-c1f515547109a7e1845120449676ba6aa9a78fe9.tar.bz2 nixpkgs-c1f515547109a7e1845120449676ba6aa9a78fe9.tar.lz nixpkgs-c1f515547109a7e1845120449676ba6aa9a78fe9.tar.xz nixpkgs-c1f515547109a7e1845120449676ba6aa9a78fe9.tar.zst nixpkgs-c1f515547109a7e1845120449676ba6aa9a78fe9.zip |
nixos/networking: support FOU encapsulation for sits
Diffstat (limited to 'nixos/modules/tasks/network-interfaces-systemd.nix')
-rw-r--r-- | nixos/modules/tasks/network-interfaces-systemd.nix | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/nixos/modules/tasks/network-interfaces-systemd.nix b/nixos/modules/tasks/network-interfaces-systemd.nix index 516764b87db..ccfd7fd4132 100644 --- a/nixos/modules/tasks/network-interfaces-systemd.nix +++ b/nixos/modules/tasks/network-interfaces-systemd.nix @@ -227,7 +227,17 @@ in Local = sit.local; }) // (optionalAttrs (sit.ttl != null) { TTL = sit.ttl; - }); + }) // (optionalAttrs (sit.encapsulation != null) ( + { + FooOverUDP = true; + Encapsulation = + if sit.encapsulation.type == "fou" + then "FooOverUDP" + else "GenericUDPEncapsulation"; + FOUDestinationPort = sit.encapsulation.port; + } // (optionalAttrs (sit.encapsulation.sourcePort != null) { + FOUSourcePort = sit.encapsulation.sourcePort; + }))); }; networks = mkIf (sit.dev != null) { "40-${sit.dev}" = (mkMerge [ (genericNetwork (mkOverride 999)) { |