I noticed the difference between the routes:
after restart:
after dhcp disable/enable:
any ideas why it does not come as on the last picture after router restart?
DHCPv6 doesn’t provide routing information to clients. Instead device gets the IPv6 address of gateway by listening Router Advertisements (RAs) … which are sent out by routers every now and then (interval is configurable, default setting in ROS is interval between 3m20s and 10m). So right after reboot device doesn’t know IPv6 address (the link-local one) of gateway, it can take up to 10 minutes to learn the information.
According to my experience IPv6 connectivity indeed is flaky (at best) during that time.
BTW, setting interface name as gateway is kind of futile if interface is of point-to-multipoint type (e.g. ethernet, wifi, …). The way packet delivery in those networks works is that sender needs to use L2 address of receiver, in named technologies this means that sender sends packets to MAC address of receiver (e.g. gateway). And sender needs to discover that L2 (MAC) address. Usually that’s done because sender knows IP (or IPv6) address of receiver and then uses ARP mechanisms to discover MAC address. If IP address of receiver (e.g. gateway) is not known and interface technology requires using MAC address, then the whole lot depends on abuse of other mechanisms, such as proxy-ARP (where gateway replies to ARP requests with own MAC address regardless the IP address).
Setting interface name as gateway when interface type is point-to-point (e.g. PPP, PPPoE, wireguard, etc.) is really enough because there’s only one receiver and sender doesn’t have to address it.
the default gateway that is automatically added by dhcp client is different - notice the gateway field in the first route on both screenshots
after reboot it is missing ipv6 address
and ipv6 connectivity is not working I can’t ping google.com from the router for example
@mkx, RouterOS does send Router Solicitation on boot as well as Neighbor Solicitation. There should be no delays unless the counterpart is sloppy.
@ahtoh Immediately after the reboot, before you toggle dhcp-client, what do ipv6/address and ipv6/neighbor say, can you ping the gateway over IPv6 (address from the last pic) from your router? Also print ipv6/settings.
I don’t know why Mikrotik have an add-default-route option in the DHCPv6 client, it is a hacky bodge which adds the DHCPv6 server as the default gateway. This works in some situations, but not all.
As @mkx stated DHCPv6 has no mechanism to distribute a default gateway, the gateway and subnet prefix are obtained from Router Advertisments (RA). The Mikrotik default config is essentially not to accept RAs, you have to explicitly enable them with:
/ipv6 settings set accept-router-advertisements=yes
In the terminal, the ipv6 after a default config reset looks like this:
/ipv6 settings
set disable-ipv6=yes max-neighbor-entries=8192
I have never configured any of my firewalls for IPv6, and yet in winbox, both settings are set to “yes if forwarding disabled”. My read on this is that the default config disabled ipv6, however, the settings in winbox mean that if I enabled ipv6, I would have to set both of those options explicitly to no:
/ipv6 settings
set accept-redirects=no accept-router-advertisements=no max-neighbor-entries=
8192
Perhaps this would be safer and more clearly understood:
/ipv6 settings
set accept-redirects=no accept-router-advertisements=no disable-ipv6=yes
max-neighbor-entries=8192
So what am I supposed to change to make ipv6 work?
this is so basic config so I’m surprised it’s not working.
I just want to automatically get ipv6 address from the upstream router and use NAT within a subnet behind mikrotik.
Similar to default IPv4 config in many routers that just works out of the box
Ok I enabled Accept Router Advertisments and disabled that option to add default gateway in the DHCP client.
But now I have another problem,
after reboot it says duplicate address detected:
If I disable and enable the address it works.
So it’s a similar situation for me as before, now instead of toggling the dhcp client I need to toggle the ipv6 address.
There should be no need for a ULA address (fdxx: to be assigned to the interface.
Why are you using NAT? ISPs should provide a block of addresses with prefix delegation from which you assign addresses to your internal networks. Usually the only case where this isn’t possible is LTE/5G WAN connections where carriers still assume you are only connecting a mobile phone or tablet to the internet.