PPPoE: Manual IPv6 setup

Hello everyone,

in addition to IPv4 (dual stack), my ISP supplies me with a /56 IPv6 prefix over PPPoE. That works without issues with the default setup, having

option ipv6 'auto'

in the WAN interfaces setup in /etc/config/network. A wan_6 interface is spawned, /56 prefix assigned and delegated to lan and everything is beautiful out-of-the-box.

But I would like to learn and use the manually configured wan6 interface instead. So I set

option ipv6 '1'

expecting everything to work out of the box with this wan6 configuration:

config interface 'wan6'
        option device 'wan'
        option proto 'dhcpv6'

Instead, wan only receives a link-local IPv6 address and there's no public prefix assigned to wan or wan6.

Any input is greatly appreciated.

The sensible option would be to simply put it back as it was and forget about making the setup more complicated for no benefit.

But you could also try changing option device 'wan' to option device '@wan'.

:smiley: Of course I know and that's what I did for now. But I would still like to understand why the manual setup does not work. Unfortunately, @wan does not change the behavior.

https://openwrt.org/docs/guide-user/network/ipv6/configuration#native_ipv6_connection read the introduction and lookup the config options and there defaults...

That's what I did, but I don't see any apparent issues with the defaults. This is the firewall rule I have:

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

I'm clueless as to what could be going wrong here. Are there any logs I could check? System log does not show any errors.

then show us your network config... You don't have to change firewall rules.

You need to also request for a delegated prefix otherwise the DHCP server will not give it.

The only thing I changed from default is the ipv6 option on the wan interface:

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 packet_steering '1'
        option ula_prefix 'fd27:70fa:5c1d::/48'

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

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

config interface 'wan'
        option device 'wan'
        option proto 'pppoe'
        option username 'xxx'
        option password 'xxx'
        option ipv6 '1'

config interface 'wan6'
        option device 'wan'
        option proto 'dhcpv6'

Is that the reqprefix option? I tried setting it to 56, but that didn't change things.

You shold only need:

config interface 'wan6'
    option device           'wan'
    option  proto           'dhcpv6'
    option  reqprefix       '56'

Nothing more...

/*
Site note: I'm using auto on the wan interface... But as far as I see as long as you set reqprefix it should be sufficent, because link-local address is generate by default on the wan interface...

config interface            'wan'
    option  device          'eth0.7'
    option  proto           'pppoe'
    option  username        'XXX@t-online.de'
    option  password        'XXX'
    option  ipv6            'auto'

How ever...
*/

What's your status on:
ip -6 addr show;
ip -6 route show; and
ifstatus wan6 / ifstatus wan_6?

If you /etc/init.d/network restart, does logread show something regarding your wan interface?

On a DSA router, option device 'wan' is the physical Ethernet port-- not the pppoe tunnel. The DHCP request must be sent inside the tunnel not raw to the Ethernet port. I think that option device '@wan' as already suggested would fix this.

If it still does not work, run tcpdumps on the pppoe-wan interface to see if DHCPv6 is being sent and received.

Omg, you're right, option @wan fixed it - in a way. I must have forgot to network restart when I replied earlier...

IPv6 is looking good now, but IPv4 is sketchy: After rebooting the router, the interfaces look perfect. wan6 looks just like wan_6 when using ipv6 = auto before. But pinging any internet IPv4 doesn't work for about 5 minutes and then just magically starts working (no syslog entries, no re-established connection etc.)

This happens on the router itself and also on LAN devices. Would could be the culprit of that?