From f540edb361bf0cb434d4b2576bf171e25c94515e Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Wed, 13 Mar 2024 21:52:09 +0000 Subject: [PATCH] nixos/routing-common: Clear IPv6 local default route --- nixos/boxes/home/routing-common/default.nix | 24 +++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/nixos/boxes/home/routing-common/default.nix b/nixos/boxes/home/routing-common/default.nix index 9f48527..5836e78 100644 --- a/nixos/boxes/home/routing-common/default.nix +++ b/nixos/boxes/home/routing-common/default.nix @@ -152,15 +152,27 @@ in networking.domain = "h.${pubDomain}"; - systemd.services = { - ipsec = - let - waitOnline = "systemd-networkd-wait-online@wan.service"; - in - { + systemd.services = + let + waitOnline = "systemd-networkd-wait-online@wan.service"; + in + { + ipsec = { after = [ waitOnline ]; requires = [ waitOnline ]; }; + + ipv6-clear-default-route = { + description = "Clear IPv6 RA default route"; + after = [ waitOnline ]; + requires = [ waitOnline ]; + script = '' + # Seems like we can sometimes pick up a default route somehow... + ${pkgs.iproute2}/bin/ip -6 route del default via fe80::1 || true + ''; + serviceConfig.Type = "oneshot"; + wantedBy = [ "multi-user.target" ]; + }; }; systemd.network = {