Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When connecting my pc to android wifi hotspot, It assigned a 192.168.42.x address to my pc. I really need to change this as it conflicts with one of our work subnets - is this possible?

share|improve this question
My mobile is rooted. I don't mind changing system files if required. – VVK Jun 4 '13 at 5:20

Unfortunately, there is no way to change the IP address range for the builtin tethering support, even in CyanogenMod. The Wi-Fi hotspot IP is hardcoded in; the USB tethering IP is hardcoded in

However, if your phone is rooted, you can try using third-party apps for tethering which have the option to change the IP address range. E.g., when the builtin USB tethering was broken in CyanogenMod alphas for Samsung Galaxy W, I used Wired Tether for Root Users, which has such option. For Wi-Fi tethering you can try the Wireless Tether for Root Users app from the same authors, which also has the option to change the IP address range.

share|improve this answer
+1 for the info. My device is rooted, but Wireless Tether for Root Users app is not working on my mobile. There should be some way to change the IP range on the rooted phone, C'Mon Man!, Android is an open OS after all. – VVK Jun 4 '13 at 5:18

The Android builtin wifi tethering is designed to use as the server, with netd handling the tethering, using dnsmasq. First DNS range is and and 2nd DNS range is

Netd is not easy to change. It requires a socket to communicate with it, and that socket is taken when android starts tethering. But going through the source files for (I used Froyo) we see:

// usb client will be provided
private static final String USB_NEAR_IFACE_ADDR      = "";
private static final String USB_NETMASK              = "";

// FYI - the default wifi is and

private String[] mDhcpRange;
private static final String DHCP_DEFAULT_RANGE1_START = "";
private static final String DHCP_DEFAULT_RANGE1_STOP  = "";
private static final String DHCP_DEFAULT_RANGE2_START = "";
private static final String DHCP_DEFAULT_RANGE2_STOP  = "";

And Later on we see those ranges used, AS BACKUPS.

    mDhcpRange = context.getResources().getStringArray(
    if ((mDhcpRange.length == 0) || (mDhcpRange.length % 2 ==1)) {
        mDhcpRange = new String[4];
        mDhcpRange[0] = DHCP_DEFAULT_RANGE1_START;
        mDhcpRange[1] = DHCP_DEFAULT_RANGE1_STOP;
        mDhcpRange[2] = DHCP_DEFAULT_RANGE2_START;
        mDhcpRange[3] = DHCP_DEFAULT_RANGE2_STOP;

The main source for the dhcp ranges is not the hardcoded 42 and 43, but read from array.config_tether_dhcp_range, an internal string array. But it is currently empty.

You could edit the android framework. On my phone, it is /system/framework/framework-res.apk. There are a ton of tutorials online for editing framework-res.apk, from simple strings to full theming. Find one for your phone and android version.

Main thing you want to change is the /res/values/arrays.xml

Look for <array name="config_tether_dhcp_range" />

Change to:

<string-array name="config_tether_dhcp_range">

compile/zip/sign as needed (follow a tutorial), then reinstall.

If you want more than one range, just copy the two items over and over. You always need to provide a start and a stop for each range. Try to keep it in the same /24, ie and or whatever. You can confirm it is working with busybox ps | grep dnsmasq or if you don't have busybox ps dnsmasq then use the pid in cat /proc/pid/cmdline. You should get (or similar):

/system/bin/dnsmasq --no-daemon --no-poll -no-resolv --dhcp-range=,,1h

FWIW, my WIFI tethering uses the default dnsmasq ranges, yet my computer was assigned and gateway Not sure why yours defaulted to a 42.x address.

share|improve this answer

Your Answer


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.