I'm trying to store default static ip settings in a custom rom.

I write the SSID and Password to /etc/wifi/wpa_supplicant.conf and that works well for Wi-Fi

But how do I add the static IP settings (gateway, fixed ip) for Wi-Fi (and Ethernet)?

  • Why would you want to do that? If you do, the device may not be able to connect other wifi networks...
    – t0mm13b
    Commented Apr 9, 2013 at 13:47
  • I want to do that because I want to set up a couple of android devices with the same rom and the same static ip settings. I don't want to reduce the manual configuration as much as possible. One step is setting up the static ip settings.
    – acy
    Commented Apr 9, 2013 at 21:29
  • manual configuration? IS there no dhcp on it? :o that is an odd one! Like as I have mentioned in my previous comment, what if you went to a public wifi hotspot - it will fail. :)
    – t0mm13b
    Commented Apr 9, 2013 at 21:53
  • static IP addresses have higher precedence over dynamic...? me fcekn memory is gone now... le sigh
    – t0mm13b
    Commented Apr 9, 2013 at 22:06
  • I'm using the devices for a signage system and it's okay that they won't connect to public hotspots then. Would be great though if it's still possible to deactivate the static ip settings at some place...
    – acy
    Commented Apr 9, 2013 at 22:22

3 Answers 3


Save the following in one of the init scripts in the ROM

ifconfig eth0 netmask
route add default gw dev eth0
setprop net.dns1
ip addr show
ip route show

Where eth0 in this case, is an ethernet adapter attached via USB.


I had a problem where my Samsung S3 Mini (Jelly Bean 4.1.2) worked 100% on my Wi-Fi router but failed to connect to the Internet with my Wi-Fi repeater - stuck on "obtaining IP address..." message. I have now set a static IP and it works 100% on both the router and the repeater. If you need multiple static IP options then check out "Wi-Fi Static" application. I found the answer courtesy of Motorola, and repeat it below, at https://motorola-global-portal.custhelp.com/app/answers/prod_answer_detail/a_id/68989/p/7901,8013,

To setup a Static IP Address on your Motorola Xoom, follow the steps below:

Touch Apps
Touch Settings
Touch Wi-Fi settings
Touch Add Wi-Fi network
Enter Name under Network SSID, and touch Save
Touch and hold the "network name", and touch Modify network
Select Static under IP settings, and enter the specific network information

Tip: You can also adjsut your security and Proxy settings.
Touch Save

You can set ip with ifconfig and gateway with route when you are rooted. I used it to change the tcp buffer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .