From bba5d8c044c701bb434454b985c81c6e688866dc Mon Sep 17 00:00:00 2001 From: clerie Date: Thu, 29 Dec 2022 22:50:34 +0100 Subject: [PATCH] hosts/beryllium: use named routing table --- hosts/beryllium/configuration.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hosts/beryllium/configuration.nix b/hosts/beryllium/configuration.nix index 5ea865a..f0f1ee5 100644 --- a/hosts/beryllium/configuration.nix +++ b/hosts/beryllium/configuration.nix @@ -20,14 +20,19 @@ networking.hostName = "beryllium"; + networking.iproute2.enable = true; + networking.iproute2.rttablesExtraConfig = '' + 200 wg-clerie + ''; + petabyte.policyrouting = { enable = true; rules6 = [ - { rule = "from 2a01:4f8:c0c:15f1::8107/128 lookup 200"; prio = 20000; } + { rule = "from 2a01:4f8:c0c:15f1::8107/128 lookup wg-clerie"; prio = 20000; } { rule = "from 2a01:4f8:c0c:15f1::8107/128 unreachable"; prio = 20001; } ]; rules4 = [ - { rule = "from 10.20.30.107/32 lookup 200"; prio = 20000; } + { rule = "from 10.20.30.107/32 lookup wg-clerie"; prio = 20000; } { rule = "from 10.20.30.107/32 unreachable"; prio = 20001; } ]; }; @@ -37,7 +42,7 @@ networking.wireguard.interfaces = { wg-clerie = { ips = [ "2a01:4f8:c0c:15f1::8107/128" "10.20.30.107/32" ]; - table = "200"; + table = "wg-clerie"; peers = [ { endpoint = "vpn.clerie.de:51820";