Basic IPv6 Setup - prefix from ISP

Dear all,
I woudl be grateful if some kind sould could give me a hint what might be the problem here: My ISP delivers v6, if I connect a Windows 10 laptop to the “LAN” interface, it gets an address, but claims there is no Internet connection:

Ethernet-Adapter LAN-Verbindung:

   Verbindungsspezifisches DNS-Suffix:
   IPv6-Adresse. . . . . . . . . . . : 2a02:ca01:203:d300:48e3:bdb9:7664:edbd
   Temporäre IPv6-Adresse. . . . . . : 2a02:ca01:203:d300:1f6:92df:463c:8acb
   Verbindungslokale IPv6-Adresse  . : fe80::48e3:bdb9:7664:edbd%25
   IPv4-Adresse (Auto. Konfiguration): 169.254.237.189
   Subnetzmaske  . . . . . . . . . . : 255.255.0.0
   Standardgateway . . . . . . . . . : fe80::d6ca:6dff:fea1:bc66%25

Here is the configuration (no firewall rules - it’s a test setup).


[admin@MikroTik] > export 
# mar/15/2022 22:26:47 by RouterOS 7.1.3
# software id = 5KFC-ED20
#
# model = 450G
/interface ethernet
set [ find default-name=ether3 ] name=LAN
set [ find default-name=ether5 ] name=WAN
/ipv6 address
add address=::2 from-pool=TPP-v6 interface=LAN
/ipv6 dhcp-client
add add-default-route=yes interface=WAN pool-name=TPP-v6 request=address,prefix

[admin@MikroTik] > ipv6/pool/print 
Flags: D - DYNAMIC
Columns: NAME, PREFIX, PREFIX-LENGTH, EXPIRES-AFTER
#   NAME    PREFIX                   PREFIX-LENGTH  EXPIRES-AFTER
0 D TPP-v6  2a02:ca01:203:d300::/56             64  27m55s       
[admin@MikroTik] > ipv6/address/print 
Flags: D - DYNAMIC; G, L - LINK-LOCAL
Columns: ADDRESS, FROM-POOL, INTERFACE, ADVERTISE
#    ADDRESS                       FROM-POOL  INTERFACE  ADVERTISE
0  G 2a02:ca01:203:d300::2/64      TPP-v6     LAN        yes      
1 DL fe80::d6ca:6dff:fea1:bc66/64             LAN        no       
2 DL fe80::d6ca:6dff:fea1:bc64/64             ether1     no       
3 DL fe80::d6ca:6dff:fea1:bc68/64             WAN        no       
4 DG 2a02:ca00:cc00:302::ca6/64               WAN        no

The DHCPv6 client add-default-route=yes is a hacky bodge. There is no default gateway information provided by DHCPv6, the client uses the address of the DHCPv6 server from which the address/prefix/other information was received - this works if the DHCPv6 server and the default gateway are the same host, but otherwise fails.

The correct method is to set add-default-route=no and use received router advertisments (RA). On v6 the default IPv6 settings include forward=yes and accept-router-advertisements=yes-if-forwarding-disabled, as you need forwarding set accept-router-advertisements=yes. I’ve not looked to see if v7 behaves in the same way, and I recall there may have been / are issues with RA in v7.

Ideally Mikrotik should implement accepting RAs per-interface rather than globally, plus other features as described in RFC7084.

I tried without the default route flag, but no change. It seems to be another problem…

Did you set set accept-router-advertisements=yes too?

Windowses need these from ND:

/ipv6 nd set [ find default=yes ] advertise-dns=yes managed-address-configuration=yes other-configuration=yes

No. As the Mikrotik DHCPv6 server can only provide prefixes and other information, but not addresses, you need managed-address-configuration=no

Thanks to all, I am, getting closer but not yet there :slight_smile:.
@tdw: I am not using the Mikrotik DHCPv6 server and DHCPv6 client “add-default-route” yes or no does not seem to make a difference.

The configuration below works in the sense that the attached Windows machine connects via v6 to the Internet. However, the router itself still as a problem: ping to the DNS server times out from the router. ::2 is the LAN interface, so the packet seems to go into the wrong direction.

[admin@MikroTik] > tool/traceroute 2a02:ca00:dc:101::51
Columns: ADDRESS, LOSS, SENT, LAST, AVG, BEST, WORST, STD-DEV
#  ADDRESS                LOSS  SENT  LAST     AVG  BEST  WORST  STD-DEV
1  2a02:ca00:cc00:302::2  0%       1  1.1ms    1.1  1.1   1.1          0
2                         100%     1  timeout                           
3                         100%     1  timeout

Here’s the config that connects the attached PC:

# mar/17/2022 09:11:08 by RouterOS 7.1.3
# software id = 5KFC-ED20
# model = 450G
/interface ethernet
set [ find default-name=ether3 ] name=LAN
set [ find default-name=ether5 ] name=WAN
/ipv6 settings
set accept-router-advertisements=yes
/ipv6 address
add address=::2 from-pool=TPP-v6 interface=LAN
/ipv6 dhcp-client
add interface=WAN pool-name=TPP-v6 request=address,prefix
/ipv6 nd
set [ find default=yes ] managed-address-configuration=yes other-configuration=yes

The accept-router-advertisements=yes is currently broken in all v7 versions (up to and including 7.1.3 and 7.2rc4) and only works with disabled forwarding (/ipv6/settings/set forward=no), but that’s not good if you want IPv6 not only for router, but also for connected devices.

As a temporary solution, you should be able to find gateway if you ping multicast address of all routers on WAN interface:

/ping interface=WAN address=ff02::2

either there will be response(s), or (I tried two routers with 50% success) at least gateway’s link-local address should appear in /ipv6/neighbor. Pick the right one from (if there are more, trial & error is your friend):

/ipv6/neighbor/print where interface=WAN

And then use it as gateway for default route:

/ipv6/route/add dst-address=::/0 gateway=fe80::xxxx:xxxx:xxxx:xxxx%WAN

Thanks for the hint. I tried this and identified fe80::6e6c:d3ff:fe6e:20c9 as the likely gateway. But are already two such dynamic entries in my routing table (added by dhcp client):

[admin@MikroTik] > ipv6/route/print 
Flags: D - DYNAMIC; I, A - ACTIVE; c, d, y - COPY; H - HW-OFFLOADED; + - ECMP
Columns: DST-ADDRESS, GATEWAY, DISTANCE
      DST-ADDRESS              GATEWAY                        DISTANCE
DAd + ::/0                     fe80::6e6c:d3ff:fe6e:20c9%WAN         1
DAd + ::/0                     fe80::6e6c:d3ff:fe6e:20c9%WAN         1
DAc   2a02:ca00:cc00:302::/64  WAN                                   0
DAd   2a02:ca01:200:f00::/56                                         1
DIcH  2a02:ca01:200:f00::/64   LAN                                   0
DAc   fe80::%ether1/64         ether1                                0
DAc   fe80::%WAN/64            WAN                                   0

I added another static route just to make sure, but the icmp packet to the nameserver 2a02:ca00:dc:101::51 still goes to the LAN interface… it seems like the route is not active or something…?

If you look at whole address, not just at ::2 at the end, you’ll see that it’s not going to LAN, that first hop is from /64 that you have on WAN. I’d expect that this address could also work as gateway. Look in /ipv6/neighbour if it has same MAC address as that link-local fe80::6e6c… you found.

Another thing you could try is to use some online ping to get incoming packets to either the address on WAN or anything from LAN prefix. You can log them with:

/ipv6 firewall mangle
add chain=prerouting in-interface=WAN protocol=icmpv6 action=log

and use it it confirm gateway’s MAC address.

If you look at whole address, not just at ::2 at the end, you’ll see that it’s not going to LAN

You’re right … I still have to get used to v6 addresses, my bad.
I did a traceroute from the succussfully connected PC and used the first hop as a gateway, which works.I am just somewhat surprised by the packet loss.
Thanks a bunch!

[admin@MikroTik] > tool/traceroute  2a00:1450:4016:80b::200e
Columns: ADDRESS, LOSS, SENT, LAST, AVG, BEST, WORST, STD-DEV
 #  ADDRESS                   LOSS   SENT  LAST     AVG   BEST  WORST  STD-DEV
 1  2a02:ca00:cc00:302::2     0%       24  2.6ms    2.7   2.4   5.1    0.5    
 2  2a02:ca00:bb::8           50%      24  2ms      1.9   1.6   2      0.1    
 3  2a00::ffc:0:700:5:15      0%       24  5.6ms    5.8   5     6.3    0.3    
 4  2a00::170:0:c             0%       24  6.4ms    6.8   6.3   12.8   1.3    
 5  2a02:908::54:1            69.6%    24  timeout  8.4   8     10.2   0.7    
 6  2a02:908::54:1            82.6%    23  timeout  8.7   8.6   8.8    0.1    
 7  2001:4860:1:1::2a4        0%       23  8ms      8.4   7.1   12     1      
 8  2001:4860::1c:4000:cf89   65.2%    23  timeout  10.5  10    11.1   0.3    
 9  2001:4860:0:1::400b       0%       23  9.3ms    9.3   8.4   10.1   0.6    
10  2a00:1450:4016:80b::200e  0%       23  9.8ms    9.8   9.6   9.9    0.1

One problem I see with this explanation is that you cracked the chicken and egg problem, you couldn’t have it working from PC behind router, if router itself didn’t have working default route. :slight_smile:

Good point, I don’t understand it either :slight_smile:. The router behaves strange in several ways, see e.g below. Both pings work perfect on the PC it copnnects via v6, and both the PC and the router use the same DNS server. The router configuration is as simple as it can be, so I cannot see what could be wrong.

[admin@MikroTik] > ping ipv6.google.com
invalid value for argument address:
    invalid value of mac-address, mac address required
    invalid value for argument ipv6-address
    failure: dns name exists, but no appropriate record
[admin@MikroTik] > ping google.com
  SEQ HOST                                     SIZE TTL TIME       STATUS                                                               
    0                                                              no route to host                                                     
    1                                                              no route to host                                                     
    2                                                              no route to host                                                     
    3                                                              no route to host                                                     
    sent=4 received=0 packet-loss=100%

That is down to Mikrotik CLI quirks, use ping [:resolve ipv6.google.com]

Thanks sigh.
It seems like :resolve does not return a v6 address for hosts with both v4 and v6. This is probably the reason for problems like

[admin@MikroTik] > system/package/update/check-for-updates 
            channel: stable
  installed-version: 7.1.3
             status: ERROR: no internet connection
             
 [admin@MikroTik] > ping [:resolve www.google.com]
  SEQ HOST                                     SIZE TTL TIME       STATUS                                                               
    0                                                              no route to host                                                     
    1                                                              no route to host                                                     
    2                                                              no route to host                                                     
    sent=3 received=0 packet-loss=100%

Frankly, this this is not a bug, it’s a no-go.