Skip to content

Commit

Permalink
diff: use the table when handling routes
Browse files Browse the repository at this point in the history
  • Loading branch information
daniloegea committed Aug 3, 2023
1 parent 83815da commit dbdfce0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions netplan_cli/cli/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,8 @@ def __system_route_to_netplan(self, system_route: dict) -> libnetplan.NetplanRou
route.type = route_type
if protocol := system_route.get('protocol'):
route.protocol = protocol
if table := system_route.get('table'):
route.table = table

return route

Expand All @@ -828,6 +830,9 @@ def __filter_system_routes(self, system_routes: set) -> set:
# Filter out Link Local routes
if route.to != 'default' and ipaddress.ip_interface(route.to).is_link_local:
continue
# Filter out "local" routing table
if route.table == 'local':
continue

routes.add(route)
return routes

0 comments on commit dbdfce0

Please sign in to comment.