Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

Since yesterday I have (in addition to the regular IPv4) IPv6 in my LAN at home (native IPv6 is provided by my ISP).

I have Windows XP, Windows 7 and Linux desktops and an Android 3.1 tablet (Asus Transformer 101) that all work fine. They can access IPv4 and IPv6 websites on the internet.

The problem is with my Samsung Galaxy S2 (Android 2.3.3). The system gets a public IPv6 address and an internal IPv4 address.

When typing the URL of an IPv6 enabled site (like google.com or xs4all.nl) I get to see the site just fine. When typing the URL of an IPv4 only site (like android.stackexchange.com) I get an error stating the site cannot be reached. When I enter the IPv4 IP address I CAN reach the mentioned site with this phone.

So I enabled debugging on my DNS (dnsmasq) server and I noticed that

  • all the clients that work do a request for the AAAA record and if that fails they try the A record.
  • the Android 2.3.3 phone ONLY does a request for the AAAA record and if that fails the whole thing fails.

All clients (including the phone) get the same network settings.

How do I fix this?

share|improve this question
add comment

2 Answers 2

You could report the bug to the Android developers, or vote on an existing bug, if there already is one open. This one looks a bit like the issue you are talking about.

Make sure you explain exactly what is happening, and how they can reproduce the issue.

share|improve this answer
    
Yes, this site really helped: I found this bug report code.google.com/p/android/issues/detail?id=8113 that looks like exactly what I see. So as far as I can tell this is a "known bug" that appears to have been fixed in Februari 2011. Now I have to find out which Android version includes this fix. –  Niels Basjes Jan 23 '12 at 19:29
add comment
up vote 2 down vote accepted

It took a lot of effort but I actually found a working solution to my problem.

I first updated my phone to latest available Android version 2.3.6 and that did not solve my problem. So I installed an App that shows me more details about the network setup of my phone. And after some digging around I noticed what was wrong:

My phone didn't have a default IPv4 route.

How did that happen? In the DHCP I push a default route (dhcp option 3)!

I realized that when I just had the IPv6 link (which is part of a whole new internet connection) my phone DID connect to the internet with both IPv4 and IPv6. So I recreated the original setup and found that in that scenario indeed it does work. So what is different?

It took me two nights with wireshark to track the culprit down.

The real reason turns out to be that I have a static route for my DMZ which is pushed by my IPv4 DHCP server (dhcp option 121).

When I do that the Android phone only shows a route for the local subnet and the additional route I pushed. The default route is lost, hence IPv4 traffic is distorted. Apparently Android even no longer tries to do IPv4 DNS requests (which is the problem I started with).

All of my other systems (Windows {XP,7}, Linux, Android 3.x) do not do this and they keep all of the pushed routes and the default route.

Once I figured out what the problem was I could Google more effectively and I found this bug report: http://code.google.com/p/android/issues/detail?id=17525 Which in turn led to a workaround that actually works!!

Quote from http://forum.xda-developers.com/archive/index.php/t-635489.html

So as a "band aid fix it" i added the default gw to the static routes list... 
So the line in dnsmasq looks like:

dhcp-option=121,<network>,<route>,0/0,192.168.1.254

So when looking at the DHCP ACK packet you'll see the default route in there twice: under option 3 and 121.

Quite an unexpected workaround ... but it works for me.


It turns out the Android behaviour is correct:

http://tools.ietf.org/html/rfc3442#page-5

"If the DHCP server returns both a Classless Static Routes option and
a Router option, the DHCP client MUST ignore the Router option."
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.