ma vbob.r: set route after network online
This commit is contained in:
parent
3aaab59b7f
commit
17883f68dd
@ -52,24 +52,21 @@
|
|||||||
<stockholm/makefu/2configs/tinc/retiolum.nix>
|
<stockholm/makefu/2configs/tinc/retiolum.nix>
|
||||||
(let
|
(let
|
||||||
gum-ip = config.krebs.hosts.gum.nets.internet.ip4.addr;
|
gum-ip = config.krebs.hosts.gum.nets.internet.ip4.addr;
|
||||||
Gateway = "10.0.2.2";
|
gateway = "10.0.2.2";
|
||||||
in {
|
in {
|
||||||
networking.localCommands = ''
|
# make sure the route to gum gets added after the network is online
|
||||||
ip route add ${gum-ip} via ${Gateway}
|
systemd.services.wireguard-wg0.after = [ "network-online.target" ];
|
||||||
'';
|
|
||||||
|
|
||||||
networking.wireguard.interfaces.wg0 = {
|
networking.wireguard.interfaces.wg0 = {
|
||||||
ips = [ "10.244.0.3/24" ];
|
ips = [ "10.244.0.3/24" ];
|
||||||
privateKeyFile = (toString <secrets>) + "/wireguard.key";
|
privateKeyFile = (toString <secrets>) + "/wireguard.key";
|
||||||
allowedIPsAsRoutes = true;
|
|
||||||
# explicit route via eth0 to gum
|
# explicit route via eth0 to gum
|
||||||
|
preSetup = ["${pkgs.iproute}/bin/ip route add ${gum-ip} via ${gateway}"];
|
||||||
peers = [
|
peers = [
|
||||||
{
|
{ # gum
|
||||||
# gum
|
|
||||||
endpoint = "${gum-ip}:51820";
|
endpoint = "${gum-ip}:51820";
|
||||||
# allowedIPs = [ "10.244.0.0/24" ];
|
allowedIPs = [ "0.0.0.0/0" "10.244.0.0/24" ];
|
||||||
allowedIPs = [ "0.0.0.0/0" ];
|
|
||||||
publicKey = "yAKvxTvcEVdn+MeKsmptZkR3XSEue+wSyLxwcjBYxxo=";
|
publicKey = "yAKvxTvcEVdn+MeKsmptZkR3XSEue+wSyLxwcjBYxxo=";
|
||||||
|
persistentKeepalive = 25;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user