nixos/network-interfaces: Add flush upon interface going down
This commit is contained in:
parent
098c8f4c77
commit
1ff4b83875
@ -639,6 +639,19 @@ in
|
|||||||
''
|
''
|
||||||
echo 1 > /proc/sys/net/ipv6/conf/${i.name}/proxy_ndp
|
echo 1 > /proc/sys/net/ipv6/conf/${i.name}/proxy_ndp
|
||||||
'';
|
'';
|
||||||
|
preStop =
|
||||||
|
''
|
||||||
|
echo "releasing configured ip's..."
|
||||||
|
''
|
||||||
|
+ flip concatMapStrings (i.ip4 ++ optionals cfg.enableIPv6 i.ip6) (ip:
|
||||||
|
let
|
||||||
|
address = "${ip.address}/${toString ip.prefixLength}";
|
||||||
|
in
|
||||||
|
''
|
||||||
|
echo -n "Deleting ${address}..."
|
||||||
|
ip addr del "${address}" dev "${i.name}" >/dev/null 2>&1 || echo -n " Failed"
|
||||||
|
echo ""
|
||||||
|
'');
|
||||||
};
|
};
|
||||||
|
|
||||||
createTunDevice = i: nameValuePair "${i.name}"
|
createTunDevice = i: nameValuePair "${i.name}"
|
||||||
|
Loading…
Reference in New Issue
Block a user