Skip to content

Commit

Permalink
make kexec-installer restore routes with onlink gateways
Browse files Browse the repository at this point in the history
Co-authored-by: Nikolay Yakimov <[email protected]>
  • Loading branch information
2 people authored and mergify[bot] committed Jan 21, 2025
1 parent f907dcf commit b62eb6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nix/kexec-installer/restore_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down

0 comments on commit b62eb6e

Please sign in to comment.