set static ip / manually ip / disable dhcp

Skip to first unread message

Florian E

unread,
Jun 5, 2018, 5:54:59 AM6/5/18
to Android-x86
Hei guys,

i'm trying to set a different network adress to my eth0 interface using

ifconfig eth0 192.168.5.1 netmask 255.255.255.0
route add default gw 192.168.5.1 dev eth0

in older versions i also did:

dhcpcd -k eth0

but that isnt used anymore.

sadly i'm not getting anything to work.
ip addr shows me the correct ip but i cannot ping the device
also trying to ping another pc in the same network gives me "connect: Network is unreachable" error.

i also found the EthernetConfigStore which is trying to read /misc/ethernet/ipconfig.txt - does that work? how is the format looking?
any ideas? do i need to disable dhcp?

thanks

Antony Stone

unread,
Jun 5, 2018, 6:18:00 AM6/5/18
to andro...@googlegroups.com
On Tuesday 05 June 2018 at 11:54:59, 'Florian E' via Android-x86 wrote:

> Hei guys,
>
> i'm trying to set a different network adress to my eth0 interface using
>
> ifconfig eth0 192.168.5.1 netmask 255.255.255.0
> route add default gw 192.168.5.1 dev eth0

That makes no sense.

You're telling your machine that its own IP address is 192.168.5.1, and the
gateway router to find the rest of the Internet is also 192.168.5.1

Try changing the first address to 192.168.5.2 (assuming that 192.168.5.1 really
*is* your router to the Internet - if not, change that to the correct value
instead).


Antony.

> in older versions i also did:
>
> dhcpcd -k eth0
>
> but that isnt used anymore.
>
> sadly i'm not getting anything to work.
> ip addr shows me the correct ip but i cannot ping the device
> also trying to ping another pc in the same network gives me "connect:
> Network is unreachable" error.
>
> i also found the EthernetConfigStore which is trying to
> read /misc/ethernet/ipconfig.txt - does that work? how is the format
> looking?
> any ideas? do i need to disable dhcp?
>
> thanks

--
f u cn rd ths, u cn gt a gd jb n nx prgrmmng

Please reply to the list;
please *don't* CC me.

Florian E

unread,
Jun 5, 2018, 6:37:35 AM6/5/18
to Android-x86
sorry that was a typo 

im using

 ifconfig eth0 192.168.5.10 netmask 255.255.255.0 

of course.

but still - no change to get int working

Florian E

unread,
Jun 5, 2018, 7:26:26 AM6/5/18
to Android-x86
I now managed to get it working in one direction:


but trying to ping the android device does still not work

Florian E

unread,
Jun 5, 2018, 8:47:37 AM6/5/18
to Android-x86
One step further i stopped netd using "stop netd" and set the ip address afterwards.
now the normal ping from the android machine is working - but not the other way arround.

for now i still can't ping the android machine or use ADB.

Florian E

unread,
Jun 5, 2018, 9:08:39 AM6/5/18
to Android-x86
So i could figure it out myself.
for static ip i now use:

stop netd
ifconfig eth0 192.168.5.10 netmask 255.255.255.0
ip rule add from all lookup main pref 0

now i can work from both sides with the static ip address.
Reply all
Reply to author
Forward
0 new messages