Dhcptool on Android 7.1.2

1,424 views
Skip to first unread message

Peter Mackenthun

unread,
Aug 16, 2017, 3:32:29 AM8/16/17
to Android-x86

Hello everyone!

 

I am using the tool „dhcptool“ to establish a connection on an „eth0“ device. This was working fine on Android 7.1.1. I updated my Android-x86 and have Android 7.1.2 and now this isn’t working anymore. Adding the gateway address always fails with “Network not reachable”. I checked the debug output on ADB: DHCP managed to get the correct IP address, DNS and gateway. I also checked in the source code: the failure happens in /system/core/libnetutils/ifc_utils.c, function ifc_configure():ifc_create_default_route() failes with ENETUNREACH    (“network unreachable”).

Maybe “dhcptool” is no longer recommended? If so, what is the alternative?

I don’t know, if this is relevant: the “eth0” device comes from a LTE modem, not a LAN Ethernet card.

 

Regards,

Peter


Chih-Wei Huang

unread,
Aug 16, 2017, 3:57:20 AM8/16/17
to Android-x86
2017-08-16 15:32 GMT+08:00 Peter Mackenthun <peter.ma...@gmail.com>:
> I am using the tool „dhcptool“ to establish a connection on an „eth0“
> device. This was working fine on Android 7.1.1. I updated my Android-x86 and
> have Android 7.1.2 and now this isn’t working anymore. Adding the gateway
> address always fails with “Network not reachable”. I checked the debug
> output on ADB: DHCP managed to get the correct IP address, DNS and gateway.
> I also checked in the source code: the failure happens in
> /system/core/libnetutils/ifc_utils.c, function
> ifc_configure():ifc_create_default_route() failes with ENETUNREACH
> (“network unreachable”).

I also suffered from a similar issue recently.
You may try the commands after using dhcptool

stop netd; start netd
ndc network create 100
ndc network interface add 100 eth0
ndc network route add 100 eth0 0.0.0.0/0 10.0.1.1 <= your gw ip

It sometimes works, but not always...

> Maybe “dhcptool” is no longer recommended? If so, what is the alternative?

dhcptool is still used in 7.1.2.

> I don’t know, if this is relevant: the “eth0” device comes from a LTE modem,
> not a LAN Ethernet card.

Dunno.

Peter Mackenthun

unread,
Aug 16, 2017, 4:39:20 AM8/16/17
to Android-x86
Thanks for the hint. Unfortunately, it didn't work in my case. The command to add the route "ndc network route add ..." failed with the error message "400 0 addRoute() failed (Network is unreachable)".
Message has been deleted

quentin

unread,
Jan 18, 2018, 8:22:41 AM1/18/18
to Android-x86
Hi,

I am having the same problem with an LTE modem.
Did you find a solution to your issue ?

Regards,

Quentin
Reply all
Reply to author
Forward
0 new messages