1
0

router, pre-router: move wireguard tunnel and change default route for router

This commit is contained in:
2022-07-26 14:40:07 +02:00
parent 30cd7a9f39
commit 86b45bae8e
5 changed files with 34 additions and 38 deletions

View File

@@ -55,34 +55,6 @@
{ address = "10.42.0.0"; prefixLength = 16; via = "10.42.10.1"; }
];
networking.wireguard = {
enable = true;
interfaces = {
wg0 = {
ips = [ "fe80::42:10:1/64" ];
privateKeyFile = "/var/src/secrets/wireguard/wg0";
allowedIPsAsRoutes = false;
peers = [{
publicKey = "Y++eB9SfU17zB4mJ/6AaN761tngXAyTNoVaPNKmuvls=";
allowedIPs = [ "::/0" ];
endpoint = "78.47.183.82:51876";
#endpoint = "gatekeeper.net.clerie.de:51876";
persistentKeepalive = 25;
}];
};
};
};
networking.localCommands = ''
ip -6 route add default dev wg0 table 100
'';
clerie.policyrouting.enable = true;
clerie.policyrouting.rules6 = [
{ rule = "lookup main suppress_prefixlength 0"; prio = 10000; }
{ rule = "from 2a01:4f8:1c0c:8221::/64 lookup 100"; prio = 19000; }
];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave