LEDE 17.01.2 No default route with static IPv6

I am running LEDE 17.01.2 on a NETGEAR WNDR3800. Broadband connection is via an NBN (Australia) cable modem over PPPoE to the WAN port of the router.

My service provider has recently enabled IPv6 dual stack. There are not yet auto-provisioning.

I was given the following information:
IPv6 range: 2400:4dc0:XXXX:YY00::1/56
IPv6 Default Gateway: 2400:4dc0::7
IPv6 DNS Server 1: 2001:df5:3c00:100::1:67
IPv6 DNS Server 2: 2001:df5:3c00:100::1:68

I have configured IPv6 (as detailed below) but there was no default route on the WAN.

After the following commands I have a working IPv6 setup.

ip -6 route add 2400:4dc0::7 dev pppoe-wan
ip -6 route add default via 2400:4dc0::7 dev pppoe-wan

Is my configuration correct?
Is there a work around?
If there is a bug, where should I start looking?
How else can I help resolve this?

Here are the relevant stanzas from /etc/config/network

config interface 'lan'
option ifname 'eth0.1'
option force_link '1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '64'
option ip6hint '4'

config interface 'wan'
option ifname 'eth1'
option proto 'pppoe'
option keepalive '5 5'
option username 'USERNAME'
option password 'PASSWORD'

config interface 'wan6'
option ifname '@wan'
option proto 'static'
option ip6prefix '2400:4dc0:0:2000::/56'
option ip6gw '2400:4dc0::7'
option ip6assign '64'
option ip6hint '0'
option ip6ifaceid '::1'
option dns '2001:df5:3c00:100::1:67 2001:df5:3c00:100::1:68'

root@OpenWrt:/etc/config# ip -6 addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 fe80::841b:5eff:fe7a:7f38/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 fe80::861b:5eff:fe7a:7f39/64 scope link
valid_lft forever preferred_lft forever
8: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 2400:4dc0:XXXX:YY04::1/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::841b:5eff:fe7a:7f38/64 scope link
valid_lft forever preferred_lft forever
15: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 fe80::861b:5eff:fe7a:7f38/64 scope link
valid_lft forever preferred_lft forever
17: ifb4eth1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 state UNKNOWN qlen 32
inet6 fe80::28b6:18ff:fe6e:5203/64 scope link
valid_lft forever preferred_lft forever
19: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 fe80::861b:5eff:fe7a:7f3a/64 scope link
valid_lft forever preferred_lft forever
20: pppoe-wan: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 state UNKNOWN qlen 3
inet6 2400:4dc0:XXXX:YY00::1/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::2190:a7dc:de7a:e504/10 scope link
valid_lft forever preferred_lft forever

root@OpenWrt:/etc/config# ip -6 route

2400:4dc0::7 dev pppoe-wan metric 1024
2400:4dc0:XXXX:YY00::/64 dev pppoe-wan metric 1024
2400:4dc0:XXXX:YY04::/64 dev br-lan metric 1024
unreachable 2400:4dc0:XXXX:YY00::/56 dev lo metric 2147483647 error -148
fe80::/64 dev eth0 metric 256
fe80::/64 dev br-lan metric 256
fe80::/64 dev ifb4eth1 metric 256
fe80::/64 dev eth1 metric 256
fe80::/64 dev wlan0 metric 256
fe80::/64 dev wlan1 metric 256
fe80::/10 dev pppoe-wan metric 1
fe80::/10 dev pppoe-wan metric 256
default via 2400:4dc0::7 dev pppoe-wan metric 1024
unreachable default dev lo metric -1 error -128
ff00::/8 dev eth0 metric 256
ff00::/8 dev br-lan metric 256
ff00::/8 dev ifb4eth1 metric 256
ff00::/8 dev eth1 metric 256
ff00::/8 dev pppoe-wan metric 256
ff00::/8 dev wlan0 metric 256
ff00::/8 dev wlan1 metric 256
unreachable default dev lo metric -1 error -128

I assume that your ISP means that 2400:4dc0:XXXX:YY00::1/56 is the router's WAN ipv6 address.

I have a bit trouble understanding that the ISP's default gateway is outside your own prefix. That mismatch may be the reason for the missing route.

(Typically in the old "6in4 tunnel" configs, you had separately router's wan tunnel ipv6 address and then a separate prefix for LAN, so your info looks a bit strange if there is supposed to be no prefix delegation.)

Based on that your config looks a bit complicated to me. You have not given the wan6 address a direct ipv6 address and there is superfluous is6assign etc. (It is possible that also your parameters make things work, but they look unnecessarily complicated.)

I would add into wan6
option ip6addr '2400:4dc0:XXXX:YY00::1/56'
option ip6prefix '2400:4dc0:XXXX:YYZ0::/60'
and I would remove ip6assign, ip6hint and ip6ifaceid from wan6
Note the Z there

Make also sure that you have in /etc/config/dhcp the correct dhcpv6 and ra options "server" for "lan" interface. https://wiki.openwrt.org/doc/uci/network6#router_advertisement_dhcpv6

I am not sure how the pppoe plays out here. No experience from that.


Other speculative solution proposal:

Otherwise the same but try to tackle routing by making the wan6 to believe that 2400:4dc0::7 is reachable.
add these to wan6:
option ip6addr '2400:4dc0:XXXX:YY00::1/32'
option ip6prefix '2400:4dc0:XXXX:YYZ0::/60'

That /32 looks adventurous, but I think that it would make LEDE to believe that 2400:4dc0::7 is part of the same prefix and reachable.

I also noticed that you have forgotten into one place this:
option ip6prefix '2400:4dc0:0:2000::/56'

If that means that your XXXX = 0000, then actually the /32 would be /48 that sounds more realistic for an ISP prefix:
2400:4dc0:0000:
which would also match the default matches the default gateway 2400:4dc0::7 that is actually 2400:4dc0:0000::7 if seen as /48.

I am new to IPv6. I will have to work my way through your comments - it past my bed time. Since i posted I have a better work around (below).

I have done some more reading. Using the route -A inet6 and ifstatus wan6 commands I can see the cause of my problem, and also the desired outcome.

ifstatus suggests to me that the option ip6gw '2400:4dc0::7' line is ignored. On my original configuration I see

root@OpenWrt:/etc/config# ifstatus wan6
{
        "up": true,
        "pending": false,
        "available": true,
        "autostart": true,
        "dynamic": false,
        "uptime": 132806,
        "l3_device": "pppoe-wan",
        "proto": "static",
        "device": "pppoe-wan",
        "updated": [
                "prefixes"
        ],
        "metric": 0,
        "dns_metric": 0,
        "delegation": true,
        "ipv4-address": [

        ],
        "ipv6-address": [

        ],
        "ipv6-prefix": [
                {
                        "address": "2400:4dc0:0:YY00::",
                        "mask": 56,
                        "class": "wan6",
                        "assigned": {
                                "wan6": {
                                        "address": "2400:4dc0:0:YY00::",
                                        "mask": 64
                                },
                                "lan": {
                                        "address": "2400:4dc0:0:YY04::",
                                        "mask": 64
                                }
                        }
                }
        ],
        "ipv6-prefix-assignment": [
                {
                        "address": "2400:4dc0:0:YY00::",
                        "mask": 64,
                        "local-address": {
                                "address": "2400:4dc0:0:YY00::1",
                                "mask": 64
                        }
                }
        ],
        "route": [

        ],
        "dns-server": [

        ],
        "dns-search": [

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

                ],
                "ipv6-address": [

                ],
                "route": [

                ],
                "dns-server": [

                ],
                "dns-search": [

                ]
        },
        "data": {

        }
}

Defining a default route in /etc/config/network using

config route6
        option interface wan6
        option target 2400:4dc0::7/128

config route6
        option interface wan6
        option gateway 2400:4dc0::7
        option target ::/0

works for me. It adds the following lines to ifstatus wan6

        "route": [
                {
                        "target": "2400:4dc0::7",
                        "mask": 128,
                        "nexthop": "::",
                        "source": "::\/0"
                },
                {
                        "target": "::",
                        "mask": 0,
                        "nexthop": "2400:4dc0::7",
                        "source": "::\/0"
                }
        ],

and route -A inet6 gets a working default route

Destination                                 Next Hop                                Flags Metric Ref    Use Iface
2400:4dc0::7/128                            ::                                      U     1024   0        1 pppoe-wan

::/0                                        2400:4dc0::7                            UG    1024   1     2404 pppoe-wan

Some further experiments suggests that all I need to add to /etc/config/network is

config route6
        option interface wan6
        option gateway 2400:4dc0::7
        option target ::/0

Probably wrong. Doesn't seem to work now.

See https://bugs.lede-project.org/index.php?do=details&task_id=856