netns: set lo up when initializing the netns
this is critical for services which communicate with eachother, e.g. jackett -> bitmagnet
This commit is contained in:
@@ -87,6 +87,18 @@ let
|
|||||||
"${ip} netns delete ${name}"
|
"${ip} netns delete ${name}"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
systemd.services."netns-${name}-lo" = {
|
||||||
|
description = "bring loopback device online in '${name}' network namespace";
|
||||||
|
wantedBy = [ "netns-${name}.target" ];
|
||||||
|
before = [ "netns-${name}.target" ];
|
||||||
|
after = [ "netns-${name}.service" ];
|
||||||
|
partOf = [ "netns-${name}.service" ];
|
||||||
|
serviceConfig.Type = "oneshot";
|
||||||
|
serviceConfig.RemainAfterExit = true;
|
||||||
|
serviceConfig.NetworkNamespacePath = "/run/netns/${name}";
|
||||||
|
serviceConfig.ExecStart = "${ip} link set lo up";
|
||||||
|
serviceConfig.ExecStop = "${ip} link set lo down";
|
||||||
|
};
|
||||||
systemd.services."netns-${name}-veth" = {
|
systemd.services."netns-${name}-veth" = {
|
||||||
description = "create a link between ${name} and the parent net namespace which tunnels any traffic explicitly routed to it";
|
description = "create a link between ${name} and the parent net namespace which tunnels any traffic explicitly routed to it";
|
||||||
wantedBy = [ "netns-${name}.target" ];
|
wantedBy = [ "netns-${name}.target" ];
|
||||||
|
Reference in New Issue
Block a user