Re: networkd: IPv6: equivalent of 'default via fe80::1` with policy routing?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 1, 2023 at 2:55 PM TJ <systemd@xxxxxx> wrote:
I may just be over-thinking this but I have a scenario that I can configure manually but have not been able to figure out how to amend the networkd configuration to match!

# echo "2 starlink" >> /etc/iproute2/rt-tables
# ip -6 rule add from 2001:0DB8:1:1::/64 table starlink priority 100
# ip -6 route add default via fe80::1 dev WAN table starlink

Note: 'via' required to prevent failed neighbour solicitations for external addresses.

The issue is I cannot see how to achieve both 'default' and 'via' in .network
  ROUTE section (when specifying a routing table).
I see recommendations to use `Gateway=::` as an alias for 'default' but that prevents
  setting the next-hop router address explicitly, which results in failure due to neighbour
  solicitation.

No; `default` has nothing to do with the gateway field. It's an alias for the route destination network field, specifically ::/0 for IPv6 or 0.0.0.0/0 for IPv6.

What you have is a completely standard IPv6 default route, regardless of which table it's in:

[Route]
Destination=::/0
Gateway=fe80::1

--
Mantas Mikulėnas

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux