Is there any way to tell the kernel which policy routing table should receive the default route learned from an IPv6 router advertisement?
My home network has native IPv6 service from Spectrum and a tunnel from Hurricane Electric that I still need for other reasons. They won't do router redirection so I use policy routing to maintain separate routing tables for each set of source addresses.
My policy rule list first searches the 'main' routing table, which is limited to local destination prefixes that can be reached with either set of source addresses. I tell dhcpcd to tell the kernel to not put a default route into that table, so if there's no match routing falls through to the next rule.
That next rule invokes a HE-specific table for HE source addresses only. That table consists only of a default route pointing at HE.
And the last rule invokes a Spectrum-specific table only for Spectrum source addresses. It contains only a default route pointing at Spectrum.
It all works well enough with static scripts, but it seems inelegant to hardwire addresses all over my scripts. What if Spectrum changes its IPv6 router address?
I'd like to maintain the default route to Spectrum automatically, but the Linux kernel only gives me two choices: pick up Spectrum's router advertisement and put that into a default route in the 'main' table, or (if you set "accept_ra_def_rtr=0"), do nothing. dhcpcd won't tell you the IPv6 gateway address since DHCP6, unlike DHCP4, doesn't assign IPv6 gateways; that function is done by the kernel when it receives Router Advertisement messages.
I could let the kernel install Spectrum's default route in the "main" table, invoke that table only if the source address belongs to Spectrum, and then fall through to the table for HE. But then I'd have to replicate all my local routes in the HE table, and again that gets messy.
A simple and obvious answer occurred to me: let me tell the kernel WHICH routing table to use for default routes to the gateways learned from IPv6 router advertisements. There's even a special table named "default" which is automatically put on the end of the policy rule list. But I can't find any way to tell the kernel to do that. It's either the 'main' table or nothing. Again, I'd rather limit the 'main' table to local entries managed (in part) by dhcpcd (e.g. my delegated prefix from Spectrum).
Anybody else ran into this problem? Any workarounds?