Adjusting DHCP obtain IP timeout - Android Software/Hacking General [Developers Only]

Hey folks,
Just wondering if there is an easy way to adjust the timeout that Android will wait for before giving up on obtaining an IP address via the wireless connection?
I know in linux you can specify that in dhclient.conf in /etc/ but that doesn't exist in Android. It appears it uses dhcpd to obtain IP addresses.
Any ideas?
Thanks
--H

Did a quick search on google & most of the hits lead back to you
It seems the dhcp client Android uses is dhcpcd as you found out elsewhere on xda.
The original author, Roy Marples, has a an active blog. Perhaps you could try asking him directly?
Afraid I can't find anything more helpful than olearyp's advice in the above xda thread.

Thanks for the advice. I'll see what else I can find. The options in dhcpcd.conf do seem to be obeyed, but the "timeout" parameter may or may not respected by some other component in Android.
I'll keep looking around...

Related

[Q] DNS resolving

I've searched the web and I couldn't find any documentation about the DNS resolving in the android OS. Can somebody, please, point me to the documentation.
If not, could anyone explain which of the net*dns{1,2} properties is used to do actual resolving and what is the meaning of others.
Also, is there a way (without changing the code) to permanently change DNS servers so that they are not updated after 3g/2g reconnect (rmnet). If, in contrast, I need to change the code could somebody point me to the class/file/directory where I should do it.
Thanks

Solution/possible solution for Tether police issues

I don't have much time to look into it at the moment, but for those of you who tether either internet or bluetooth you should look into getting NAT going on your phone. This requires root as far as I know.
You can use iptables (comes with our kernels), ipchains, netfilter, or what ever else passes for NAT/firewall these days on linux. I'll probably end up compiling a ipchains binary here in the next couple weeks if I don't find one (I haven't been able to as of yet)
That will solve the problem of detection via originating address.
To bypass deep packet inspection, look into an encrypted VPN solution. There are some free ones out there, or you can try something like what Giganews offers. Depending on how AT&T does things, this could also potentially speed up your service because many ISPs give VPNs higher QOS priority. This could also be a bad thing because they could decide you need to be on the enterprise plan. Use at your own risk. If you really want to get crazy, tunnel a VPN through an SSL proxy.
One other thing that will help that will help in general is to install any firewall program. Here are a couple I found on the market (sorry can't link yet):
com.wemobs.internetfirewall
com.mm.plugins.contactsprotect.droidwall1
com.dexters.andfirewall
com.googlecode.droidwall.free
I have not tested any, but they all appear to allow you to pick and choose which applications can access the internet. What better way to make sure no applications are phoning home without permission.
These may or may not turn on the NAT functionality for you.
YMMV, but I hope this helps someone
I think tor has some android proxy service, should help.

[Q]Change(spoof) WiFi(wireless) MAC address. Done lots of research! Impossible maybe?

Hey, folks!
I wanna learn how to change my WiFi MACaddress (yes, I can solve things in other way, but we are here to learn ) in Android v4.1.2. My ROM is CyanoGenMod 10 v6 based, updated 01/11/2012.
I have searched lots of threads and forums. I have tested many methods (about 10-20 systems), most of them for another Android devices and/or versions (Samsung, Nexus... etc):
- Editing/creating nvram.txt file (in several paths).
- ifconfig methods.
- ip link methods.
- Specific programs.
- Another files, like "mac_address".
None of them do work . The farther y did reach is the "ip link" way, that seems to have changed my MAC address... but my Transformer does not get IP .
Any ideas will be very welcome, friends, and I will edit this first post resuming the method or publish a How-To thread to help some (many) people hazy with this matter.
I have been searching for a method to spoof the MAC on my GNex as well. I have not been successful either. It really bites because the wifi at my employer uses MAC filtering.
Not sure how well this will work, but you can access the MAC Address of the TF101 by navigating here
/sys/class/net/wlan0/address
Open "address" as a text file and you`ll see your MAC Address,
Not sure the implications of changing it manually, but so long as you save the old address I don't think it will hurt to try changing it
You`ll need to be rooted and use a root file explorer
unable to save the file after editing...

[App] DHCPv6 Client

Hi everyone,
What is this?
This is a DHCPv6 Client for Android.
Motivation
Google doesn't support DHCPv6. See: https://code.google.com/p/android/issues/detail?id=32621
This is an issue for a lot of people especially for corporations and universities because they need control over the IPv6 addresses they distribute.
I did some research and found out that Fairphone already has support for DHCPv6, they achieve this by implementing the wide-dhcpv6 client and added some own scripts around it.
This gave me the idea to play a little with this client. I did so and the result is this app.
Basically it is an implementation of Fairphone's DHCPv6 solution for every rooted Android phone and not just Fairphone.
Workflow
Broadcast Receiver for CONNECTIVITY_CHANGE (invoked when connectivity is changed)
Check if /system/bin/dhcp6c <interface> is running (this is the master process) if not then invoke it
Sending a signal with /system/bin/dhcp6ctl to the master process to get an IPv6 address (dhcp6ctl -C start interface <interface>)
Why is root required?
Root permissions are required for the DHCPv6 client to work because it binds to port 546.
Permissions
root - see above
access network and wifi state - catching network changes
internet - for checking if internet is available and getting a list of all interfaces available
billing - for donation
Get the app
Simply download it from the app store: Download from Google Play Store
Source Code
DHCPv6 Client for Android on GitHub
-realm_01
hostname/domain name support?
Installed this on my android TV media box, and it now connects to my DHCPv6 server as expected, and a lease is registered, however it does not supply a host name or domain name. The domain name is advertised by my router, and also supplied as option in DHCPv6 scope.
Are these an android problem, or the DHCPv6 client?
Almost working...
Hi !
Thanks for the app. Android really needs this. I'm trying to use it on Motorola XT1058 running Lollipop. I can see in the packet capture of my router (OpenWrt) that the DHCPv6 transaction is working and my router is giving out statefully assigned IPv6 addresses to my phone. Unfortunately, these addresses don't get assigned to wlan0 interface on Android. I'm still seeing only stateless addresses on wlan0. Any help would be appreciated.
Regards,
André
Thank you, as a system administrator it was crazy annoying to not be able to enforce a an IPv6 range for android devices
This app doesn't work until I adb shell into my device and run dhcp6c wlan0 as root manually.
Works on Pixel XL
Works fine on my Pixel XL with Android 7.1.
Thank you!
Hi, great job on this app. Wondering how you were able to override the Android DHCP software from trying to connect to networks and have it use the IPV6 info your client acquired?

[Completed] Identifying my Default gateway and DNS (Rooted Turbo)

Hello geniuses, ( and I mean that literally, you guys are amazing) I have Direct TV and just got my hands on there Cinema connection kit witch allows me to connect to an internet source wireless-ly. Anywho, the error I am getting is asking for my default gateway, and my DNS, and that is way over my head. Can anyone assist? I am running a rooted Turbo. Thanks in advance!
Special~k said:
Hello geniuses, ( and I mean that literally, you guys are amazing) I have Direct TV and just got my hands on there Cinema connection kit witch allows me to connect to an internet source wireless-ly. Anywho, the error I am getting is asking for my default gateway, and my DNS, and that is way over my head. Can anyone assist? I am running a rooted Turbo. Thanks in advance!
Click to expand...
Click to collapse
Hello and thank you for using XDA Assist.
It's unclear what Android-related specific problem you have but if by "Turbo" you mean a Verizon Motorola Droid Turbo, there is a forum specifically for questions about that device at http://forum.xda-developers.com/droid-turbo/help where you may want to ask Turbo-related questions.
That said, if the Direct TV device simply needs information about your internet connection, you would need to know the address of your WIFI router (it'll be something like "192.168.0.1") and your default DNS server (maybe "8.8.8.8" for Google DNS?), something whoever installed your internet connection should be able to provide.
If all else fails, try posting with all relevant details in the general forum at http://forum.xda-developers.com/general/general where someone might be familiar with your specific situation.
Good luck!
I appreciate your reply... and yes I was referring to the droid trubo. The internet service I am referring to, however, is my Turbos hotspot. I figured anyone running 4.4 or 5.1, no matter the device could possibly help. I know its possible, and I came very close last night to getting my Direct TV to connect to my phones hotspot. Everything else in my house is connected to my phone, not sure why this won't. I am certain its an address issue, and the default gateway and DNS is the culprit.
Special~k said:
I appreciate your reply... and yes I was referring to the droid trubo. The internet service I am referring to, however, is my Turbos hotspot. I figured anyone running 4.4 or 5.1, no matter the device could possibly help. I know its possible, and I came very close last night to getting my Direct TV to connect to my phones hotspot. Everything else in my house is connected to my phone, not sure why this won't. I am certain its an address issue, and the default gateway and DNS is the culprit.
Click to expand...
Click to collapse
Hello again.
If you are connecting though your phone's hotspot feature, then you have to use its address. That information depends on your phone, ROM and which and how many other devices are on the local network you establish, among other factors, but it's probably in the "198.162.?.?" range mentioned earlier and you can probably set "8.8.8.8" (Google) as your DNS provider. One simple way to determine your default gateway's address is to use whatever other phone, tablet, or computer you connect to that hotspot and execute a "traceroute" command. The first entry will be the gateway. I'm afraid I can't tell you how to do that specifically for your device/OS but most all operating systems have a similar command.
We cannot provide technical support nor can other members reply to your posts here on XDA Assist but, as suggested earlier, asking in the Turbos' Q&A thread at http://forum.xda-developers.com/droid-turbo/help would be the best way to get help
This thread is now closed.
Once again, good luck!

Categories

Resources