From 1ba4c66697d1dbb3d929ed2994be40e899911b69 Mon Sep 17 00:00:00 2001 From: clerie Date: Fri, 30 Dec 2022 17:46:11 +0100 Subject: [PATCH] hosts/aluminium: use policyrouting for IPv4 too --- hosts/aluminium/configuration.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hosts/aluminium/configuration.nix b/hosts/aluminium/configuration.nix index 8f356ef..553cba0 100644 --- a/hosts/aluminium/configuration.nix +++ b/hosts/aluminium/configuration.nix @@ -20,12 +20,21 @@ networking.hostName = "aluminium"; + networking.iproute2.enable = true; + networking.iproute2.rttablesExtraConfig = '' + 200 wg-clerie + ''; + petabyte.policyrouting = { enable = true; rules6 = [ - { rule = "from 2a01:4f8:c0c:15f1::8106/128 lookup 200"; prio = 20000; } + { rule = "from 2a01:4f8:c0c:15f1::8106/128 lookup wg-clerie"; prio = 20000; } { rule = "from 2a01:4f8:c0c:15f1::8106/128 unreachable"; prio = 20001; } ]; + rules4 = [ + { rule = "from 10.20.30.106/32 lookup wg-clerie"; prio = 20000; } + { rule = "from 10.20.30.106/32 unreachable"; prio = 20001; } + ]; }; @@ -33,7 +42,7 @@ networking.wireguard.interfaces = { wg-clerie = { ips = [ "2a01:4f8:c0c:15f1::8106/128" "10.20.30.106/32" ]; - table = "200"; + table = "wg-clerie"; peers = [ { endpoint = "vpn.clerie.de:51820";