DHCPv6 client and default gateway

I’ve been wondering about add-default-route option in RouterOS DHCPv6 client. In short, where does it come from, what standard is it based on?

AFAIK DHCPv6 doesn’t provide default gateway at all, client should get it from Router Advertisement. I know there’s old draft about allowing DHCPv6 to provide it (draft-ietf-mif-dhcpv6-route-option), but it never made it to RFC.

It looks like that with add-default-route=yes, RouterOS simply takes link-local address of DHCPv6 server and uses it as default gateway. Which works if DHCPv6 server and gateway are the same, but it doesn’t have to be that way, they can be different machines with different addresses, and then it fails.

At the same time, if I’d want to use RA to get gateway, it’s currently problematic, because whether to accept it is global switch, but I’d want it only on selected interface, the one with DHCPv6 client. Or perhaps more for multi-WAN.

So how is it, is MikroTik being “creative”, or it’s perfectly fine, and it’s me who missed some RFC?

Good news, I’m not crazy! I obviously doubted myself, because I couldn’t be the first one to notice this, right? And after I did a test with OpenWRT, and it also added link-local address of DHCPv6 server as default gateway, I thought “oh well, so I am crazy”. But I dug a little deeper, to understand where they got the idea to use DHCPv6 server as gateway, and their commit message for the feature is clear:

  • odhcp6c: add route-workaround for broken IPv6-ISPs

Some ISP seem to only do stateful DHCPv6 and not sending RAs.
This is technically broken because plain DHCPv6 doesn’t carry routes.

We work around here by faking a default route to the DHCPv6 server
if we do not receive a useful RA from the ISP.

This workaround can be turned off with: option fakeroutes 0