My IPv6 connection only works after a second restart

I have a very weird behaviour with my OpenWRT router. The IPv6 connection doesn't work the first time the router boots, only after a second restart via the interface.

I have two outputs of ifstatus wan6 commands one before the restart that the connection doesn't work, and one after the restart. I can see there are differences but I don't understand the problem.

Before:

{
        "up": true,
        "pending": false,
        "available": true,
        "autostart": true,
        "dynamic": false,
        "uptime": 164,
        "l3_device": "eth1",
        "proto": "dhcpv6",
        "device": "eth1",
        "updated": [
                "prefixes"
        ],
        "metric": 0,
        "dns_metric": 0,
        "delegation": true,
        "ipv4-address": [

        ],
        "ipv6-address": [
                {
                        "address": "2a00:a041:e700:3::bbe1:e79b",
                        "mask": 128,
                        "preferred": 2661,
                        "valid": 6261
                }
        ],
        "ipv6-prefix": [
                {
                        "address": "2a00:a041:e1bf:7200::",
                        "mask": 56,
                        "preferred": 2661,
                        "valid": 6261,
                        "class": "wan6",
                        "assigned": {
                                "lan": {
                                        "address": "2a00:a041:e1bf:7200::",
                                        "mask": 60
                                }
                        }
                }
        ],
        "ipv6-prefix-assignment": [

        ],
        "route": [
                {
                        "target": "::",
                        "mask": 0,
                        "nexthop": "fe80::1",
                        "metric": 512,
                        "valid": 1656,
                        "source": "2a00:a041:e1bf:7200::/56"
                },
                {
                        "target": "::",
                        "mask": 0,
                        "nexthop": "fe80::1",
                        "metric": 512,
                        "valid": 1656,
                        "source": "2a00:a041:e700:3::bbe1:e79b/128"
                }
        ],
        "dns-server": [
                "2a00:a040:3:2::162",
                "2a00:a040:0:22::162"
        ],
        "dns-search": [

        ],
        "neighbors": [

        ],
        "inactive": {
                "ipv4-address": [

                ],
                "ipv6-address": [

                ],
                "route": [

                ],
                "dns-server": [

                ],
                "dns-search": [

                ],
                "neighbors": [

                ]
        },
        "data": {
                "passthru": "001700202a00a0400003000200000000000001622a00a040000000220000000000000162"
        }
}

After:

{
        "up": true,
        "pending": false,
        "available": true,
        "autostart": true,
        "dynamic": false,
        "uptime": 41,
        "l3_device": "eth1",
        "proto": "dhcpv6",
        "device": "eth1",
        "updated": [
                "addresses",
                "routes",
                "prefixes",
                "data"
        ],
        "metric": 0,
        "dns_metric": 0,
        "delegation": true,
        "ipv4-address": [

        ],
        "ipv6-address": [
                {
                        "address": "2a00:a041:e700:3::677d:e571",
                        "mask": 128,
                        "preferred": 259,
                        "valid": 259
                }
        ],
        "ipv6-prefix": [
                {
                        "address": "2a00:a041:e1bf:7200::",
                        "mask": 56,
                        "preferred": 259,
                        "valid": 259,
                        "class": "wan6",
                        "assigned": {
                                "lan": {
                                        "address": "2a00:a041:e1bf:7200::",
                                        "mask": 60
                                }
                        }
                }
        ],
        "ipv6-prefix-assignment": [

        ],
        "route": [
                {
                        "target": "::",
                        "mask": 0,
                        "nexthop": "fe80::1a5b:ff:fe7e:bbcc",
                        "metric": 512,
                        "valid": 4459,
                        "source": "2a00:a041:e1bf:7200::/56"
                },
                {
                        "target": "::",
                        "mask": 0,
                        "nexthop": "fe80::1a5b:ff:fe7e:bbcc",
                        "metric": 512,
                        "valid": 4459,
                        "source": "2a00:a041:e700:3::677d:e571/128"
                }
        ],
        "dns-server": [
                "2a00:a040:3:2::162",
                "2a00:a040:0:22::162"
        ],
        "dns-search": [

        ],
        "neighbors": [

        ],
        "inactive": {
                "ipv4-address": [

                ],
                "ipv6-address": [

                ],
                "route": [

                ],
                "dns-server": [

                ],
                "dns-search": [

                ],
                "neighbors": [

                ]
        },
        "data": {
                "passthru": "001700202a00a0400003000200000000000001622a00a040000000220000000000000162"
        }
}

Compare text:

Please run the following commands (copy-paste the whole block) and paste the output here, using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have

ubus call system board; uci export network
{
        "kernel": "6.6.73",
        "hostname": "OpenWrt",
        "system": "ARMv8 Processor rev 4",
        "model": "GL.iNet GL-MT6000",
        "board_name": "glinet,gl-mt6000",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "24.10.0",
                "revision": "r28427-6df0e3d02a",
                "target": "mediatek/filogic",
                "description": "OpenWrt 24.10.0 r28427-6df0e3d02a",
                "builddate": "1738624177"
        }
}
package network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd34:c504:20b3::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'
        list ports 'lan5'

config device
        option name 'lan1'
        option macaddr '94:83:c4:a3:fa:8d'

config device
        option name 'lan2'
        option macaddr '94:83:c4:a3:fa:8d'

config device
        option name 'lan3'
        option macaddr '94:83:c4:a3:fa:8d'

config device
        option name 'lan4'
        option macaddr '94:83:c4:a3:fa:8d'

config device
        option name 'lan5'
        option macaddr '94:83:c4:a3:fa:8d'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config device
        option name 'eth1'
        option macaddr '94:83:c4:a3:fa:8b'

config interface 'wan'
        option device 'eth1'
        option proto 'dhcp'

config interface 'wan6'
        option device 'eth1'
        option proto 'dhcpv6'
        option reqaddress 'try'
        option reqprefix 'auto'
        option norelease '0'

I did another reboot to the router.

Before IPv6 restart - connection doesn't work:

{
        "up": true,
        "pending": false,
        "available": true,
        "autostart": true,
        "dynamic": false,
        "uptime": 111,
        "l3_device": "eth1",
        "proto": "dhcpv6",
        "device": "eth1",
        "metric": 0,
        "dns_metric": 0,
        "delegation": true,
        "ipv4-address": [

        ],
        "ipv6-address": [
                {
                        "address": "2a00:a041:e700:3::f4d8:e143",
                        "mask": 128,
                        "preferred": 188,
                        "valid": 188
                }
        ],
        "ipv6-prefix": [
                {
                        "address": "2a00:a041:e624:ae00::",
                        "mask": 56,
                        "preferred": 188,
                        "valid": 188,
                        "class": "wan6",
                        "assigned": {
                                "lan": {
                                        "address": "2a00:a041:e624:ae00::",
                                        "mask": 60
                                }
                        }
                }
        ],
        "ipv6-prefix-assignment": [

        ],
        "route": [
                {
                        "target": "::",
                        "mask": 0,
                        "nexthop": "fe80::1",
                        "metric": 512,
                        "valid": 1733,
                        "source": "2a00:a041:e624:ae00::/56"
                },
                {
                        "target": "::",
                        "mask": 0,
                        "nexthop": "fe80::1",
                        "metric": 512,
                        "valid": 1733,
                        "source": "2a00:a041:e700:3::f4d8:e143/128"
                }
        ],
        "dns-server": [
                "2a00:a040:3:2::162",
                "2a00:a040:0:22::162"
        ],
        "dns-search": [

        ],
        "neighbors": [

        ],
        "inactive": {
                "ipv4-address": [

                ],
                "ipv6-address": [

                ],
                "route": [

                ],
                "dns-server": [

                ],
                "dns-search": [

                ],
                "neighbors": [

                ]
        },
        "data": {
                "passthru": "001700202a00a0400003000200000000000001622a00a040000000220000000000000162"
        }
}

After restart - connection works:

{
        "up": true,
        "pending": false,
        "available": true,
        "autostart": true,
        "dynamic": false,
        "uptime": 11,
        "l3_device": "eth1",
        "proto": "dhcpv6",
        "device": "eth1",
        "updated": [
                "addresses",
                "routes",
                "prefixes",
                "data"
        ],
        "metric": 0,
        "dns_metric": 0,
        "delegation": true,
        "ipv4-address": [

        ],
        "ipv6-address": [
                {
                        "address": "2a00:a041:e700:3::d89c:6115",
                        "mask": 128,
                        "preferred": 289,
                        "valid": 289
                }
        ],
        "ipv6-prefix": [
                {
                        "address": "2a00:a041:e624:ae00::",
                        "mask": 56,
                        "preferred": 289,
                        "valid": 289,
                        "class": "wan6",
                        "assigned": {
                                "lan": {
                                        "address": "2a00:a041:e624:ae00::",
                                        "mask": 60
                                }
                        }
                }
        ],
        "ipv6-prefix-assignment": [

        ],
        "route": [
                {
                        "target": "::",
                        "mask": 0,
                        "nexthop": "fe80::1a5b:ff:fe7e:bbcc",
                        "metric": 512,
                        "valid": 4489,
                        "source": "2a00:a041:e624:ae00::/56"
                },
                {
                        "target": "::",
                        "mask": 0,
                        "nexthop": "fe80::1a5b:ff:fe7e:bbcc",
                        "metric": 512,
                        "valid": 4489,
                        "source": "2a00:a041:e700:3::d89c:6115/128"
                }
        ],
        "dns-server": [
                "2a00:a040:3:2::162",
                "2a00:a040:0:22::162"
        ],
        "dns-search": [

        ],
        "neighbors": [

        ],
        "inactive": {
                "ipv4-address": [

                ],
                "ipv6-address": [

                ],
                "route": [

                ],
                "dns-server": [

                ],
                "dns-search": [

                ],
                "neighbors": [

                ]
        },
        "data": {
                "passthru": "001700202a00a0400003000200000000000001622a00a040000000220000000000000162"
        }
}

Please see here, here and here. Are these the same/similar symptoms? In my case, IPv6 works from the router itself, but doesn't work from connected LAN devices. Is this the same for you?

No. IPv6 doesn't work from the router itself when using the command ping6.

Then it's probably something else, I'm afraid, but it was worth a shot.

Okay. Is there a way to disable IPv6 cleanly? I know I can disable the wan6 interface but I don't want the router to give local IPv6 addresses.

I followed this article: https://3os.org/infrastructure/openwrt/disable-ipv6/
However WAN6 continued to work, I disabled it as well, but my android devices still continue to receive addresses that start with "fe80::", how do I disable that as well?
EDIT: The command uci set network.wan.delegate='0' worked. For now I don't see IPv6 being distributed.

Actually I had similar problem in the past when my router wasn't always getting IPv6 prefix delegated (it worked 4 times out of 5). It was hard to reproduce so I nagged on my ISP. Now it is fixed.

My ISP won't provide support with the excuse that I have "private equipment".

The only significant difference here is the "nexthop" which is the link local address of the ISP's router on the other side of the connection. Depending on how the system works, it may be the ONT or cable modem in your house, or a piece of equipment in the ISP's office. Either way it is a setting that the ISP sends to you, and it appears that sometimes they send the wrong information. There are two ways that IPv6 auto-configures: RA and DHCPv6. In many cases both are active on the line at the same time, and it is likely here that one is correct and one is wrong, and your router has a race condition whether it gets the right one. You could confirm this theory by taking packet captures during the connection process.

A possible workaround may be to set reqaddress force in the wan6 section, which should make OpenWrt use DHCPv6 always instead of RA.

[Link local addresses start with fe80: and they always exist on any OS that has a v6 capable kernel. They are only valid to transmit data on one segment of a network, such as an Ethernet cable and layer 2 switch(es). They can't be used all the way to the Internet, so if the only IP a phone has is a link local it will always use v4 for Internet access.

Disabling or removing wan6 will keep your lan devices from trying to use IPv6 but it would be preferable to fix the problem or avoid rebooting the main router]

2 Likes

Thank you. Yes, I do have an ONT device. If I connect the ONT to the PC directly, then IPv6 works without a problem. Why is that?

Okay. I've done that. Now there is another behaviour, but I don't know anymore what's going on. So now after a reboot it works for 1 minute then the IPv6 connection fails until I restart it in the interface.

Try option reqaddress none then. It does the opposite of force-- only use RA addressing not DHCP.

Now doesn't work at all.

Should I change my ISP?

As others have pointed out already on the first try the IPv6 route is not set correctly.
Only the second reboot updates this.

I would try to explicitly set:

        option reqaddress 'force'
        option reqprefix '/56'

If this is not working, then I would tell this the ISP and diagnose with them.
They should be able to tell you want your router should request/configure.

But judging that your ISPs homepage is anouncing andAAAA DNS record but is not working over IPv6, tells me that they don't take it seriously.

3 Likes

Thank you, now I don't have any issues. But how did you find this out?

As hotnet.il and http://www.hotnet.net.il have AAAA records, but are not reachable.

Routing or firewall issues in their Autonomous System.