configurable excludeIP for ezwg
This commit is contained in:
parent
7604d2d7d7
commit
1da2d8a098
1 changed files with 7 additions and 1 deletions
|
@ -24,6 +24,12 @@ in
|
|||
description = "The IP of the wg server";
|
||||
};
|
||||
|
||||
excludeIP = mkOption {
|
||||
type = types.str;
|
||||
default = cfg.serverIP;
|
||||
description = "The IP to _not_ route through the proxy, you normally want this to be the same as `serverIP` when not tunneling";
|
||||
};
|
||||
|
||||
serverPort = mkOption {
|
||||
type = types.int;
|
||||
default = 51820;
|
||||
|
@ -54,7 +60,7 @@ in
|
|||
builtins.toFile "exclusionary-wildcard-ranges-generator.py" ''
|
||||
import ipaddress
|
||||
n1 = ipaddress.ip_network('0.0.0.0/0')
|
||||
n2 = ipaddress.ip_network('${cfg.serverIP}/32')
|
||||
n2 = ipaddress.ip_network('${cfg.excludeIP}/32')
|
||||
print(':'.join(list(map(lambda x: str(x), list(n1.address_exclude(n2))))), end="")
|
||||
'';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue