I have RaspberryPi3 running Android Things connected (ethernet) to a switch in order to communicate with other devices in network. There is no DHCP option.

I want to know if there is a way to assign a static IP to RaspberryPi?


It is possible thanks to the well known Linux command ifconfig:

ifconfig eth0 <YOUR-IP-ADDRESS>

Where eth0 is the ethernet adapter. You can do the same to wlan0 and so on.

| improve this answer | |
  • Even if this does work under Android Things it doesn't explain how to make this persist across startups. – Steve Robillard Jul 12 '17 at 20:39
  • He never asked about persistence...anyway it could be achieved by a shell script on init.d, but it is not possible at the moment. I was working for a workaround for this with no luck, because you will need to execute it with root permissions and init.d support. Unfortunately it seems that init.d is not supported by the Android Things kernel at the moment (Developers preview 4). – raiseerco Jul 12 '17 at 22:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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