I am trying to configure a new network interface on Android tablet (v3.2). From terminal application I can "ifconfig eth0 192.168.11.14 netmask 255.255.255.0 up" and everything works fine (ethernet cable is connected trough USB-Ethernet dongle)
I want to make this configuration persistent, but it looks like there is no 'interfaces' file in Android. Where is network configuration file located? Do I need to create new one? Where?
Thanks,
yet another late answer... scoured the internet and couldn't find any decent answer until I checked out /etc/init.sh ...
I'm using an Android Oreo vmware image for testing purposes and here are the steps that I used to add static IP to Android on boot:
su
vi /etc/init.sh
i
function do_init()
}
), type post_init_network
create new line after the closing curly brace (}
), type
function post_init_network()
{
ifconfig 192.168.63.122/24 up
}
change the ip and subnet as needed...
press :wq!
to save and exit vi
su
, then type ifconfig
NOTE: I encounter this issue where I can't get an IP from NAT network using 2 interfaces where the first interface is set to static IP and the other DHCP, just power on and power off Android until you can get an internet connection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With