forked from DGNum/liminix
l2tp set default route via tunnel
This commit is contained in:
parent
1c9f20dd40
commit
fc9cb8e07d
1 changed files with 11 additions and 4 deletions
|
@ -6,6 +6,7 @@
|
||||||
}: let
|
}: let
|
||||||
secrets = import ./extneder-secrets.nix;
|
secrets = import ./extneder-secrets.nix;
|
||||||
rsecrets = import ./rotuer-secrets.nix;
|
rsecrets = import ./rotuer-secrets.nix;
|
||||||
|
lns = "l2tp.aaisp.net.uk";
|
||||||
inherit (pkgs.liminix.services) oneshot longrun bundle target;
|
inherit (pkgs.liminix.services) oneshot longrun bundle target;
|
||||||
inherit (pkgs.pseudofile) dir symlink;
|
inherit (pkgs.pseudofile) dir symlink;
|
||||||
inherit (pkgs) writeText dropbear ifwait serviceFns;
|
inherit (pkgs) writeText dropbear ifwait serviceFns;
|
||||||
|
@ -58,20 +59,26 @@ in rec {
|
||||||
srv = dir {};
|
srv = dir {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.lnsroute = svc.network.route.build {
|
||||||
|
via = "$(output ${services.dhcpc} router)";
|
||||||
|
target = lns;
|
||||||
|
dependencies = [services.dhcpc];
|
||||||
|
};
|
||||||
|
|
||||||
services.l2tp = svc.l2tp.build {
|
services.l2tp = svc.l2tp.build {
|
||||||
lns = "l2tp.aaisp.net.uk";
|
inherit lns;
|
||||||
ppp-options = [
|
ppp-options = [
|
||||||
"debug" "+ipv6" "noauth"
|
"debug" "+ipv6" "noauth"
|
||||||
"name" rsecrets.l2tp.name
|
"name" rsecrets.l2tp.name
|
||||||
"password" rsecrets.l2tp.password
|
"password" rsecrets.l2tp.password
|
||||||
];
|
];
|
||||||
dependencies = [ services.defaultroute4 ];
|
dependencies = [ services.lnsroute ];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.defaultroute4 = svc.network.route.build {
|
services.defaultroute4 = svc.network.route.build {
|
||||||
via = "$(output ${services.dhcpc} router)";
|
via = "$(output ${services.l2tp} router)";
|
||||||
target = "default";
|
target = "default";
|
||||||
dependencies = [services.dhcpc];
|
dependencies = [services.l2tp];
|
||||||
};
|
};
|
||||||
|
|
||||||
users.root = {
|
users.root = {
|
||||||
|
|
Loading…
Reference in a new issue