From b62eb6ec03c477fbcb527675f1979ea7be452117 Mon Sep 17 00:00:00 2001 From: auvred Date: Tue, 21 Jan 2025 13:22:32 +0300 Subject: [PATCH] make kexec-installer restore routes with onlink gateways Co-authored-by: Nikolay Yakimov --- nix/kexec-installer/restore_routes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix/kexec-installer/restore_routes.py b/nix/kexec-installer/restore_routes.py index 8bb997d..3c160cf 100644 --- a/nix/kexec-installer/restore_routes.py +++ b/nix/kexec-installer/restore_routes.py @@ -108,9 +108,6 @@ def generate_routes( if interface.ifname is None or route.get("dev") != interface.ifname: continue - # we may ignore on-link default routes here, but I don't see how - # they would be useful for internet connectivity anyway - yield "[Route]" if route.get("dst") != "default": # can be skipped for default routes @@ -124,6 +121,9 @@ def generate_routes( yield "Destination = 0.0.0.0/0" if gateway: yield f"Gateway = {gateway}" + flags = route.get("flags", []) + if "onlink" in flags: + yield "GatewayOnLink = yes" def generate_networkd_units(