OpenWrt Forum Archive

Topic: Possible dnsmasq and openwrt/LEDE wifi issue with android devices

The content of this topic has been archived on 24 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm running LEDE Reboot r1442 on a BT Home Hub V5 and my ISP is Sky Fibre, I am running it as a combined VDSL modem and router. Everything is working as expected apart from when using Android Lollipop devices that connect over Wi-Fi (Nexus 4, Amazon Fire Tablet and Amazon Fire Stick). The problem is related to DNS and I am unable to browse the web without using some kind of DNS setting application. I can ping and traceroute, it's just DNS that is giving me hell.

When using this DNS setting application I can manually set Google, OpenDNS and my router IP (192.168.0.1) and it works, this leads me to believe either something is not being passed with the DHCP info or something is not being set on the Android devices properly.

I have multiple devices that work perfectly well, Mac OS, Windows, iOS and even Android 4. I have an Amazon Fire TV that runs the same OS as the Fire Stick but is connected over Ethernet, this works as expected too.

I don't have any such problems using the ISP supplied combined VDSL mode + router which leads me to believe there is either something I am not setting correctly, some kind of compatibility issue or a bug somewhere in LEDE/dnsmasq/Android 5.

Things I've tried:

Assigning a static IP and DNS on the Android devices, I feel like this should work because the 'Set DNS' application works but I still can't resolve this way.
Various different Wi-Fi settings - N-mode on/off, WMM mode on/off, all different security types and disabling it.
Sending DHCP option 6 with various DNS addresses (Google, OpenDNS, etc).
Disconnecting all wired clients from the router.
Removing all wireless networks and creating from scratch with different SSID.
Toggling Wi-Fi on/off, rebooting device, forgetting and reconnecting to wireless networks.
I also had this same problem using a trunk version of OpenWrt r49230 which is what prompted me to try LEDE in the hope it may have been some kind of regression that got fixed.

I guess what I am looking for is some pointers on how I can diagnose what might be the problem. I don't have root access on any of the Android devices but am happy to set it up on the Nexus 4 if needed.

Can anyone point me in any kind of direction here please? Thanks!

/etc/config/dhcp

config dnsmasq
    option domainneeded '1'
    option boguspriv '1'
    option filterwin2k '0'
    option localise_queries '1'
    option rebind_protection '1'
    option rebind_localhost '1'
    option local '/lan/'
    option domain 'lan'
    option expandhosts '1'
    option nonegcache '0'
    option authoritative '1'
    option readethers '1'
    option leasefile '/tmp/dhcp.leases'
    option resolvfile '/tmp/resolv.conf.auto'
    option localservice '1'

config dhcp 'lan'
    option interface 'lan'
    option start '100'
    option limit '150'
    option leasetime '12h'
    option dhcpv6 'server'
    option ra 'server'

config dhcp 'wan'
    option interface 'wan'
    option ignore '1'

config odhcpd 'odhcpd'
    option maindhcp '0'
    option leasefile '/tmp/hosts/odhcpd'
    option leasetrigger '/usr/sbin/odhcpd-update'

/etc/config/network

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

config globals 'globals'
    option ula_prefix 'fd9d:16ee:b240::/48'

config atm-bridge 'atm'
    option vpi '1'
    option vci '32'
    option encaps 'llc'
    option payload 'bridged'

config dsl 'dsl'
    option annex 'a'
    option tone 'av'
    option xfer_mode 'ptm'

config interface 'lan'
    option type 'bridge'
    option ifname 'eth0.1'
    option proto 'static'
    option ipaddr '192.168.0.1'
    option netmask '255.255.255.0'
    option ip6assign '60'

config interface 'wan'
    option ifname 'ptm0.101'
    option ipv6 'auto'
    option proto 'dhcp'                                                     
        option hostname 'Sky'                                                   
        option clientid 'my-client-id-here'
        option vendorid ''my-vendor-id-here'                  
        option macaddr ''my-macaddr-id-here'

config device 'wan_dev'
    option name 'ptm0'
    option macaddr 'a0:1b:29:71:c8:47'

config interface 'wan6'
    option ifname 'pppoe-wan'
    option proto 'dhcpv6'

config switch
    option name 'switch0'
    option reset '1'
    option enable_vlan '1'

config switch_vlan
    option device 'switch0'
    option vlan '1'
    option ports '0 1 2 4 6t'

/etc/config/wireless

config wifi-device  radio0
    option type     mac80211
    option channel  36
    option hwmode    11a
    option path    'pci0000:01/0000:01:00.0/0000:02:00.0'
    option htmode    VHT80
    # REMOVE THIS LINE TO ENABLE WIFI:
    option disabled 1

config wifi-iface
    option device   radio0
    option network  lan
    option mode     ap
    option ssid     LEDE
    option encryption none

config wifi-device  radio1
    option type     mac80211
    option channel  11
    option hwmode    11g
    option path    'pci0000:00/0000:00:0e.0'
    option htmode    HT20

config wifi-iface
    option device   radio1
    option network  lan
    option mode     ap
    option ssid     LEDE
    option encryption none

(Last edited by alexstan on 29 Aug 2016, 13:07)

Be so kind to not double post.

https://66.media.tumblr.com/aa6e9accd523609a51026fc13eb0f9cf/tumblr_n39e98PiZm1qevbnso1_500.gif
(click the image to find it)

Dear Alexstan,

please ignore Max's antics, he acts as this forum's resident troll ATM and hence can safely be ignored (unless your problem is using a search machine and roughly appropriate search terms). His remark about double posting* is somewhat besides the mark as your title shows that you did something different than last time and you included a list of things you tested unsuccessfully, which is certainly worth posting (that said a link to the old thread might still be helpful to get more information about the manifestation of the issue). I might well be that all Max wanted to raise is that it would be nice tho have the new information at least linked to the old, but if so I believe his impolite terseness does not help in that quest.

Regarding your real issue, I will test my old nexus4 against the LEDE HEAD, r1398 I have currently installed later today, and will report back here, whether it works, we can then go and look at configuration differences.

Best Regards
        M.


*) Max's biggest problem with the rest of the forum users seems to be simple procedural issues about what to post where and when; which is interesting since I do not recall him ever posting his instructions on how to use this forum. Combined with his "delusion" that people actually appreciate his help in selecting search terms and using search engines it at least explains the reputation/notoriety he earned in this forum. Which is sad, as occasionally he can be really helpful.

Hi moeller0, thanks for your reply. Although Max's reply was a little harsh I am not bothered and understand the reasoning behind it. As you say, I should have linked to my previous post as it is related to this issue...I'm not sure he needs to do the whole LMGTFY routine though...

I think I may have found a solution upon further investigation, it looks as though there is a problem with Android trying to use ipv6 DNS when it should be using ipv4. When I disabled ipv6 both in WAN and LAN in /etc/config/network and rebooted then the Android devices were able to connect. I am currently doing some more tests to see if I can narrow it down further.

I got the idea from this Android bug report (incidentally the first result in Max's LMGTFY link - I had already read it a few times but not tried every solution suggested)
code.google.com/p/android/issues/detail?id=79504

(Last edited by alexstan on 29 Aug 2016, 17:47)

alexstan wrote:

I got the idea from this Android bug report (incidentally the first result in Max's LMGTFY link ...

Well, a bit of RTFW and a fortuitous choice of keywords. Miracles do occur.

Max Hopper wrote:
alexstan wrote:

I got the idea from this Android bug report (incidentally the first result in Max's LMGTFY link ...

Well, a bit of RTFW and a fortuitous choice of keywords. Miracles do occur.

Hi Max,
let me finish that quote:

alexstan wrote:

(incidentally the first result in Max's LMGTFY link - I had already read it a few times but not tried every solution suggested)

It seems you came late to the party with your keywords, no? But I rest my case...

Best Regards
        M.

moeller0 wrote:

It seems you came late to the party with your keywords, no? But I rest my case...

The OPer revisited the bug report based upon... Correct.

N.B. - do give it a rest

alexstan wrote:

I am currently doing some more tests to see if I can narrow it down further.

I am having the same problem with an Amazon Fire TV stick. All other devices (iOS, macOS, Windows Phone) are working fine.

So did you actually narrow it down, and what exactly was the solution? Disabling IPV6?

Thanks in advance,
Markus

(Last edited by reitermarkus on 12 Oct 2016, 20:18)

Yes, setting option ipv6 to 0 on the lan interface fixed it. Sorry I didn't update the thread.

FWIW, I'm pretty sure that Lollipop on Nexus devices had both IPv4 and IPv6 google's dns servers hardcoded, I've actually struggled with that on Nexus 5 and there's a thread about it here. Maybe that's also the case with FireTV Stick (with amazon's own DNS hardcoded) and that's the reason something is not working.

alexstan wrote:

Yes, setting option ipv6 to 0 on the lan interface fixed it. Sorry I didn't update the thread.

It is unfortunate that in 2016, the _solution_ is to turn off IPv6.

It is unclear if your ISP provides you a native IPv6 connection. Perhaps you could enlighten us on that. If you don't have an IPv6 exit to your network (e.g. no connectivity) then I could see some devices which prefer IPv6, running into issues.

cvmiller wrote:
alexstan wrote:

Yes, setting option ipv6 to 0 on the lan interface fixed it. Sorry I didn't update the thread.

It is unfortunate that in 2016, the _solution_ is to turn off IPv6.

It is unclear if your ISP provides you a native IPv6 connection. Perhaps you could enlighten us on that. If you don't have an IPv6 exit to your network (e.g. no connectivity) then I could see some devices which prefer IPv6, running into issues.

Funnily enough this morning I had a go at setting up ipv6 properly and it works, my ISP (SKY UK) has recently completed their IPV6 rollout. With this set up I am able to connect all of my Android based devices without a problem.

That _is_ great news! I had heard that SKY was now offering IPV6. Just out of curiosity, do you know if they gave you a /64, or /56 as Prefix Delegation (via DHCPv6-PD)?

It's a /56 prefix.

Very nice. Thanks.

alexstan wrote:
cvmiller wrote:
alexstan wrote:

Yes, setting option ipv6 to 0 on the lan interface fixed it. Sorry I didn't update the thread.

It is unfortunate that in 2016, the _solution_ is to turn off IPv6.

It is unclear if your ISP provides you a native IPv6 connection. Perhaps you could enlighten us on that. If you don't have an IPv6 exit to your network (e.g. no connectivity) then I could see some devices which prefer IPv6, running into issues.

Funnily enough this morning I had a go at setting up ipv6 properly and it works, my ISP (SKY UK) has recently completed their IPV6 rollout. With this set up I am able to connect all of my Android based devices without a problem.

Hey, I ran into this problem as well this weekend... 5.1.1 Android phone here. Since we have IPv6 I'd like to fix it rather than turn it off (thinking ahead). How did you 'fix' your setup?

Thanks!

Not sure what Alexstan did to fix his network.

Android 5 and above support RDNSS field in the RA. You will want to add something like the following in your /etc/config/dhcp file

config dhcp 'lan'
    list dns '2001:4860:4860::8888'
    list dns '2001:4860:4860::8844'

Restart networking, and you should see the above DNS servers in your RAs (rdisc6 is a good utility for this).

HTH

Thanks a lot will give that a try.

Okay so I tested, but I forgot my ISP is IPv4-only so that doesn't help. Additionally, since my clients all already have an internal IPv6 address and now an IPv6 DNS server, the clients that were functional pretty much break.

So if anyone has a solution for this, I'd be happy to learn it.

Thanks!

Edit: it looks like using Unbound as a primary DNS server causes this kind of trouble over here, so this might be a different issue altogether.

(Last edited by Borromini on 2 Nov 2016, 22:41)

Borromini wrote:

Okay so I tested, but I forgot my ISP is IPv4-only so that doesn't help. Additionally, since my clients all already have an internal IPv6 address and now an IPv6 DNS server, the clients that were functional pretty much break.

So if anyone has a solution for this, I'd be happy to learn it.

Thanks!

You can try disabling ipv6 on the lan in /etc/config/network, it worked for me previously.

config interface 'lan'
        ...
        option ipv6 '0'
        ...

Just to update this issue, manually feeding through the external IPV6 DNS servers does fix the issue, but then it messes up any LAN IPv6 stuff as the local addresses won't be setup correctly (the DNS server won't know how to find if the devices tries IPv6 DNS over IPv4 DNS).

However, dnsmasq 2.77 fixes this issue and automatic IPv6 DNS servers now correctly point to the router, which resolves the Android issue.

I know LEDE 17.01.2 and LEDE trunk both have this version baked in. Otherwise, it should be possible to do a package upgrade on openWRT or LEDE (or just build a new custom image).

(Last edited by TeutonJon78 on 20 Jun 2017, 02:45)

The discussion might have continued from here.