Add manual network namespaces to systemd
This commit is contained in:
parent
17a58f1e7e
commit
b59f21a8cc
1 changed files with 11 additions and 0 deletions
|
@ -357,6 +357,17 @@ in
|
|||
# Firewall: only open to SSH now
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
networking.firewall.allowedUDPPorts = [ 22 ];
|
||||
# Network namespaces management
|
||||
systemd.services."netns@" = {
|
||||
description = "Network namespace %I";
|
||||
before = [ "network.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = "${pkgs.iproute2}/bin/ip netns add %I";
|
||||
ExecStop = "${pkgs.iproute2}/bin/ip netns del %I";
|
||||
};
|
||||
};
|
||||
|
||||
## Time and Region
|
||||
time.timeZone = lib.mkDefault "Europe/Zurich";
|
||||
|
|
Loading…
Add table
Reference in a new issue