What does Android need so it uses IPv6

Hello,
I don't get what androids problem is. Windows and Linux Clients can use IPv6 just fine on my network, android simply refuses after 10 seconds beeing connected to my wifi to use IPv6 again. I looked with tcpdump and the device does not even attempt to make AAAA lookups. Pinging a IPv6 address from that device works just fine. What do I need to do to my OpenWRT so Android is happy and uses IPv6?
/etc/config/network

config interface 'lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ipaddr '192.168.1.1'
	option ip6weight '5'
	option ip6assign '63'
	option device 'br-lan'
	list ip6class 'local'
	list ip6class 'wan6'

/etc/config/dhcp

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option dhcpv4 'server'
	option force '1'
	option ra_management '1'
	option leasetime '12h'
	option ra 'server'
	list ra_flags 'managed-config'
	list ra_flags 'other-config'
	option dhcpv6 'server'

If some other info is needed i will provide it.

Maybe try searching this forum. I roughly remember we had something ~2-3 months ago, which was very similar from topic. I cant seem to remember/find what it was.

1 Like

I only found this Ipv6 only on OpenWrt router not on LAN - #37 by kingju
and that does not work for me, android still decides to not use ipv6 after some seconds beeing connected

You can remove both RA flags. Specifically, "Managed" is not a functionally compatible config with Android - which only uses SLAAC. "Other" should be OK, which means additional configs are available via DHCPv6.

Thanks for the input, sadly still refuses to use IPv6, or more to resolve AAAA records. If I type a IPv6 address in manually i can reach it.

You need a public ipv6 address in android

1 Like

Sounds stupid on android side but ok. I have public IPv6 with a dynamic prefix, how do I tell OpenWRT to hand out a GUA as DNS instead of ULA or LL?

I can not confirm if a gua nameserver address is needed or not. I got gua and ULA addresses via slaac on my Android but have set a nameserver with ULA address in /etc/config/DHCP explicit. (I have multiple Vlans but all get served by one nameserver service address. The only difference I can think of is that I don't use odhcpd but dnsmasq-full for DHCP, DHCPv6 and RA.)

I set dhcp_option 'option6: dns-server, [fd.....]'
I don't know how and why but this address shows up in the rdnss RA option. Verified with radvdump on linux

1 Like

Thank you very much for showing me radvdump. I only get outputs there if I do changes on the network, like changing under IPv6 RA Settings the Default Router between automatic and forced. I would have expected to see a output immediately and then atleast ones per Max RA interval but maybe I don't understand well enough RA to get what to expect right.
Do you get directly a output if you start radvdump and then in a interval again?

Edit: I think I did understand wrong how it works, you get in a interval radvd and not if you ask for it it seems.

That is what I currently get

radvdump
#
# radvd configuration generated by radvdump 2.18
# based on Router Advertisement from fe80::f415:7aff:fe44:e7ef
# received by interface eth0
#

interface eth0
{
        AdvSendAdvert on;
        # Note: {Min,Max}RtrAdvInterval cannot be obtained with radvdump
        AdvManagedFlag on;
        AdvOtherConfigFlag on;
        AdvReachableTime 0;
        AdvRetransTimer 0;
        AdvCurHopLimit 64;
        AdvDefaultLifetime 1800;
        AdvHomeAgentFlag off;
        AdvDefaultPreference medium;
        AdvSourceLLAddress on;
        AdvLinkMTU 1500;
        AdvIntervalOpt on;

        prefix 2a02:xxx::/64
        {
                AdvValidLifetime 83788;
                AdvPreferredLifetime 40588;
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr off;
        }; # End of prefix definition


        prefix fd00:13:37::/64
        {
                AdvValidLifetime infinity; # (0xffffffff)
                AdvPreferredLifetime infinity; # (0xffffffff)
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr off;
        }; # End of prefix definition


        RDNSS fd00:13:37::1
        {
                AdvRDNSSLifetime 1800;
        }; # End of RDNSS definition

}; # End of interface definition

Does this look like your working config _bernd?
I can do DNS lookups via fd00:13:37::1 so that shouldn't be the problem but I don't know yet what else is.
Removing the flags

        AdvManagedFlag on;
        AdvOtherConfigFlag on;

did sadly nothing.

I get:

# radvdump

#
# radvd configuration generated by radvdump 2.19
# based on Router Advertisement from fe80::1ff:fe01:41
# received by interface wlan0
#

interface wlan0
{
        AdvSendAdvert on;
        # Note: {Min,Max}RtrAdvInterval cannot be obtained with radvdump
        AdvManagedFlag on;
        AdvOtherConfigFlag on;
        AdvReachableTime 0;
        AdvRetransTimer 0;
        AdvCurHopLimit 64;
        AdvDefaultLifetime 7200;
        AdvHomeAgentFlag off;
        AdvDefaultPreference medium;
        AdvLinkMTU 1492;
        AdvSourceLLAddress on;

        prefix fde6:a09a:b373:41::/64
        {
                AdvValidLifetime 43200;
                AdvPreferredLifetime 43200;
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr off;
        }; # End of prefix definition


        prefix 2003:XX::/64
        {
                AdvValidLifetime 14355;
                AdvPreferredLifetime 1755;
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr off;
        }; # End of prefix definition


        DNSSL user.clients.home.arpa
        {
                AdvDNSSLLifetime 1755;
        }; # End of DNSSL definition


        RDNSS fde6:a09a:b373::1
        {
                AdvRDNSSLifetime 1755;
        }; # End of RDNSS definition

}; # End of interface definitio

My DHCP config for this VLAN looks:

config dhcp                     'vlan65'
    option  interface           'vlan65'
    option  domain              'user.clients.home.arpa'
    option  local               '/user.clients.home.arpa/'
    option  start               '32'
    option  limit               '215'
    option  leasetime           '12h'
    option  dhcpv4              'server'
    list    dhcp_option         'option:dns-server, 192.168.0.1'
    list    dhcp_option         'option:domain-name, user.clients.home.arpa.'
    list    dhcp_option         'option:ntp-server, 192.53.103.103'
    list    dhcp_option         '100,"CET-1CEST,M3.5.0/2,M10.5.0/3"'    # PCode
    list    dhcp_option         '101,"Europa/Berlin"'                   # TCode
    list    dhcp_option         'option:domain-search, user.clients.home.arpa., home.arpa.'
    list    dhcp_option         'option:classless-static-route, 192.168.0.0/16,192.168.65.1'
    option  dhcpv6              'server'
    list    dhcp_option         'option6:dns-server, [fde6:a09a:b373::1]'
    list    dhcp_option         'option6:domain-search, user.clients.home.arpa.'
    list    dhcp_option         'option6:ntp-server, de.pool.ntp.org.'
    option  ra                  'server'
    option  ra_slaac            '1'
    list    ra_flags            'managed-config'
    list    ra_flags            'other-config'

As I stated before: MAYBE this has something to do that I'm using dnsmasq-full and no odhcpd.

1 Like
option ip6assign '63'

to

option ip6assign '64'

If you want control dns like pihole or adguard.

Don't use "ipv6 dns server"

please explain why

and also explain here why.
Both are may be valid points but I would like to understand why they would matter.
Thank you

@_bernd thank you for your output, but I don't see any difference. Maybe the problem is that my wifi filters RA but then I would have thought my android clients would have no IPv6 connectivity at all instead of online failing to resolve AAAA records.
Are you maybe aware of a alternative to radvdump on android because it doesn't seem like radvdump does exists for termux?

Android uses SLAAC, which requires a 64 bit interface id.

Are you running on mvebu platform like WRT32X etc? Those seem to trash Ipv6 when I was running them. Switched like 4-5 years ago and everything just works.

as you can see on the radvdump output it uses a /64 via slaac but since I want to allocate from time to time to a router downstream via dhcpv6-pd also a /64 I need the /63 in the config.

My router is x86 so that shouldn't be the problem.

It's the wifi chipset that matters though. But if you don't have the mwlwifi gear then yeah that's not it.

I've recently fixed the Android IPv6 problem in my network and the issue for me was that the preferred lifetime was greater than the valid life time.

The valid life time has to be always equal or greater than the preferred life time, and although the router was announcing bad values, other clients were accepting it.

In your case, the valid life time is greater, but in my tests I've seen that Android rejects the prefix if the two life times are not equal.

Can you try to make both values equal? this is my setup for reference:

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option dhcpv4 'server'
	list dhcp_option '6,192.168.10.1'
	list ra_flags 'managed-config'
	list ra_flags 'other-config'
	option dhcpv6 'server'
	option ra 'server'
	option ra_useleasetime '1'
	option leasetime '10m'
	option preferred_lifetime '10m'
2 Likes

Thank you, sadly did not resolve my problem, my One Plus 8 still refuses to use ipv6 with my network. I'm starting to believe that the problem is maybe not my wifi but my phone. Sadly I don't have any other android device to test with, the linux and windows clients don't have any problem on that network even if I turn DHCPv6 off and do SLAAC only.