Android Enthusiasts
Q&A for enthusiasts and power users of the Android operating system
Latest Questions
0
votes
0
answers
138
views
How to make DHCP server in Android?
I want to move the DHCP server from my OpenWRT router to the admin’s phone (with a static IP) because I need the network to handle 200 devices connecting and disconnecting quickly—about 30 seconds per device, with up to 200 devices in 5 minutes. The router gets very slow after 70 devices, so I devel...
I want to move the DHCP server from my OpenWRT router to the admin’s phone (with a static IP) because I need the network to handle 200 devices connecting and disconnecting quickly—about 30 seconds per device, with up to 200 devices in 5 minutes. The router gets very slow after 70 devices, so I developed a DHCP server app for Android. But I found out that it can’t listen on port 67 without root, and rooting all admin phones isn’t practical. I considered using an external device, but I’m worried about efficiency and debugging compared to using my own app.
Is there a solution to run a DHCP server on Android without root, or another easy way to offload DHCP from the router while keeping flexibility and speed?
The router specs are in the attached image.
Image resized. Click to see the full size

Saif Ahmed
(1 rep)
May 24, 2025, 09:48 PM
• Last activity: May 25, 2025, 02:20 PM
1
votes
0
answers
52
views
How to disable IP settings randomization of wifi sharing?
I can not see a way to set up the network parameters if I start a wifi sharing in AP mode. The usual behavior of my phones is that they randomly allocate a /24 block somewhere below 192.168.0.0/16, and everything will be random there. They are also re-generated, if the wifi stops working on any reas...
I can not see a way to set up the network parameters if I start a wifi sharing in AP mode. The usual behavior of my phones is that they randomly allocate a /24 block somewhere below 192.168.0.0/16, and everything will be random there. They are also re-generated, if the wifi stops working on any reason.
I want to change it. I want the good old times back as I just could determine the IP range, the IP of the AP in it and that worked well. It would be yet much better if I could even create a mac-ip mapping, like it is possible in any dhcp daemon on the Linuxes; but I think it will remain a dream today.
Can I do it? I have here a rooted Android 11.
peterh
(1176 rep)
Dec 19, 2024, 06:24 PM
• Last activity: Dec 25, 2024, 05:45 PM
0
votes
0
answers
160
views
Android hotspot fixed DHCP MAC --> IP mapping?
I need to be assigned always the same IP address when I connect through Android Wi-Fi hotspot, but such technicality is not configurable via Android GUI. Is there a way I could configure Android hotspot to assign connected device always the same IP address from its DHCP pool (usually based on MAC ad...
I need to be assigned always the same IP address when I connect through Android Wi-Fi hotspot, but such technicality is not configurable via Android GUI. Is there a way I could configure Android hotspot to assign connected device always the same IP address from its DHCP pool (usually based on MAC address of the device)?
Most Android hotspots have 192.168.43.0/24 IP range with the hotspot having 192.168.43.1, so I would like my device to be assigned always for example 192.168.43.119.
Setting the address on the client is NOT an option as it could be in conflict with IP address assigned to another device connecting through the hotspot.
user3706684
(1 rep)
Oct 5, 2024, 06:56 AM
• Last activity: Oct 5, 2024, 06:57 AM
2
votes
1
answers
2766
views
Wifi Hotspot dnsmasq no DHCP ACK
I am creating a Wifi hotspot with hostapd and providing DHCP/DNS through dnsmasq on an Android 5.0.1 device. When a client connects to the Wifi hotspot it is subsequently unable to obtain an IP address through DHCP. The dnsmasq server claims to send a DHCP ACK response but no packet is seen in wires...
I am creating a Wifi hotspot with hostapd and providing DHCP/DNS through dnsmasq on an Android 5.0.1 device. When a client connects to the Wifi hotspot it is subsequently unable to obtain an IP address through DHCP. The dnsmasq server claims to send a DHCP ACK response but no packet is seen in wireshark.
dnsmasq is started with the following options (formatted for viewing).
/system/bin/dnsmasq
--keep-in-foreground
--no-resolv
--no-poll
--dhcp-authoritative
--dhcp-option-force=43,ANDROID_METERED
--pid-file
--dhcp-range=2001::2, 2001::10, ra-stateless,infinite
--enable-ra
--dhcp-range=192.168.42.2,192.168.42.254,1h
--dhcp-range=192.168.43.2,192.168.43.254,1h
--dhcp-range=192.168.44.2,192.168.44.254,1h
--dhcp-range=192.168.45.2,192.168.45.254,1h
--dhcp-range=192.168.46.2,192.168.46.254,1h
--dhcp-range=192.168.47.2,192.168.47.254,1h
--dhcp-range=192.168.48.2,192.168.48.254,1h
--dhcp-range=192.168.49.2,192.168.49.254,1h
The dnsmasq logs show that dnsmasq receives the DHCP REQUEST from the client and attempts to respond with DHCP ACK.
I/dnsmasq (10989): started, version 2.62 cachesize 150
I/dnsmasq (10989): compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-scripts no-TFTP no-conntrack
W/dnsmasq (10989): warning: no upstream servers configured
I/dnsmasq (10989): IPv6 router advertisement enabled
I/dnsmasq (10989): DHCP, IP range 192.168.49.2 -- 192.168.49.254, lease time 1h
I/dnsmasq (10989): DHCP, IP range 192.168.48.2 -- 192.168.48.254, lease time 1h
I/dnsmasq (10989): DHCP, IP range 192.168.47.2 -- 192.168.47.254, lease time 1h
I/dnsmasq (10989): DHCP, IP range 192.168.46.2 -- 192.168.46.254, lease time 1h
I/dnsmasq (10989): DHCP, IP range 192.168.45.2 -- 192.168.45.254, lease time 1h
I/dnsmasq (10989): DHCP, IP range 192.168.44.2 -- 192.168.44.254, lease time 1h
I/dnsmasq (10989): DHCP, IP range 192.168.43.2 -- 192.168.43.254, lease time 1h
I/dnsmasq (10989): DHCP, IP range 192.168.42.2 -- 192.168.42.254, lease time 1h
I/dnsmasq (10989): stateless DHCPv6 on 2001::2
I/dnsmasq (10989): SLAAC on 2001:: prefix valid infinite
I/dnsmasq (10989): read /etc/hosts - 1 addresses
I/dnsmasq (10989): using nameserver 8.8.8.8#53
I/dnsmasq (10989): update ra:true|wlan0|rmnet0|97
I/dnsmasq (10989): internal inf is wlan0
I/dnsmasq (10989): external inf is rmnet0
I/dnsmasq (10989): set table number:97
I/dnsmasq (10989): update_ra count:0
I/dnsmasq (10989): link local address:wlan0
I/dnsmasq (10989): failed to send_ra: face_enumerate, parm.found_context
I/dnsmasq (10989): failed to update ra:send_ra
I/dnsmasq (10989): DHCPDISCOVER(wlan0) c0:bd:d1:4a:3a:0f
I/dnsmasq (10989): DHCPOFFER(wlan0) 192.168.43.127 c0:bd:d1:4a:3a:0f
I/dnsmasq (10989): DHCPREQUEST(wlan0) 192.168.43.127 c0:bd:d1:4a:3a:0f
I/dnsmasq (10989): DHCPACK(wlan0) 192.168.43.127 c0:bd:d1:4a:3a:0f android-e55b7f59c0dfe96
Wireshark shows the reception of the DHCP REQUEST packet from the client but no DHCP ACK is ever sent. Instead, the host is issuing ARP requests for the offered IP address.
I cannot understand why the host is sending ARP requests for the offered IP address instead of sending the DHCP ACK. Can anyone help me understand what I am seeing and how it can be fixed? Thanks.
**EDIT**
The wifi hotspot was created by monitoring all commands sent to the netd socket during standard wifi hotspot creation through Android and replaying those commands with /system/bin/ndc.
ndc netd softap fwreload wlan0 AP
ndc netd softap set wlan0 Redskins wpa2-psk DanSnyderSucks
ndc netd softap startap
ndc netd interface getcfg wlan0
ndc netd interface setcfg wlan0 192.168.43.1 24 up multicast running broadcast
ndc netd tether interface add wlan0
ndc netd interface getcfg wlan0
ndc netd network interface add local wlan0
ndc netd network route add local wlan0 192.168.43.0/24
ndc netd ipfwd enable
ndc netd tether start 192.168.42.2 192.168.42.254 192.168.43.2 192.168.43.254 192.168.44.2 192.168.44.254 192.168.45.2 192.168.45.254 192.168.46.2 192.168.46.254 192.168.47.2 192.168.47.254 192.168.48.2 192.168.48.254 192.168.49.2 192.168.49.254
ndc netd tether dns set 501 8.8.8.8 8.8.4.4
ndc netd nat enable wlan0 rmnet0 1 192.168.43.0/24
ndc netd tether ra true wlan0 rmnet0
**EDIT**
Any suggestions or ideas on where to even begin debugging would be greatly appreciated. I have tried comparing logcat logs and kmsg logs but I have been unable to exact any useful information.

bangelo
(91 rep)
Aug 6, 2015, 04:20 PM
• Last activity: Sep 21, 2024, 07:37 PM
2
votes
0
answers
511
views
What runs the DHCP client on Android?
I am building AOSP (version 14) from sources, for a PinePhone (so I have root access). I am trying to get reverse tethering to work (i.e. the Android device connects to the network through the other device over Ethernet). I can plug an Ethernet-over-usb adapter and see that a new network interface (...
I am building AOSP (version 14) from sources, for a PinePhone (so I have root access). I am trying to get reverse tethering to work (i.e. the Android device connects to the network through the other device over Ethernet).
I can plug an Ethernet-over-usb adapter and see that a new network interface (
eth0
) appears in the output of ip link
. This interface eth0
is ` but has
state DOWN. It never gets in
state UP` and it never gets an IP.
In this situation on a Linux distro, I would just run a DHCP client for this interface. But on AOSP, I don't have a DHCP client to run from the command line (dhcpcd is no longer used in recent versions of Android, if I understand correctly).
1. Is there a way to manually run a DHCP server from the CLI?
2. What mechanism is supposed to handle this? On some phones and under some conditions (e.g. "the WiFi is not connected"), then plugging an Ethernet cable into the Android device "just works". What should I do in my AOSP build to make this "just work" for all eth*
interfaces that may appear?
JonasVautherin
(121 rep)
Aug 15, 2024, 10:47 PM
• Last activity: Aug 16, 2024, 08:35 AM
3
votes
2
answers
3910
views
Making Android Use Local DNS Server
I have local DNS (bind9) and DHCP (isc-dhcp-server) working to the point where my desktop and servers can see each other using the domain `voncorax.internal`. However, I also have two Samsung devices running Android 14. I have been able to get proper address resolution by configuring static IP and s...
I have local DNS (bind9) and DHCP (isc-dhcp-server) working to the point where my desktop and servers can see each other using the domain
voncorax.internal
. However, I also have two Samsung devices running Android 14. I have been able to get proper address resolution by configuring static IP and specifying my DNS server's IP address for both DNS1 and DNS2, but my devices are unable to resolve any names on my LAN when configured via DHCP. (Android appears to be forcing DNS2 to be 8.8.4.4.)
Is there any way to set up my DNS and/or DHCP servers so Android will preferentially use my LAN's DNS server?
Darwin von Corax
(186 rep)
May 1, 2024, 09:06 PM
• Last activity: Jul 29, 2024, 06:35 AM
1
votes
1
answers
1090
views
How to tell an Android device that only has ADB connectivity about an NTP server?
In a comment on [this question](https://android.stackexchange.com/questions/257503/a-way-to-set-time-on-android-phone-with-unaccessible-settings-through-adb-or-ano) Robert asked: > Have you tried to provide an NTP server in your local network and announce it via DHCP? How can I do that, please? I ha...
In a comment on [this question](https://android.stackexchange.com/questions/257503/a-way-to-set-time-on-android-phone-with-unaccessible-settings-through-adb-or-ano) Robert asked:
> Have you tried to provide an NTP server in your local network and announce it via DHCP?
How can I do that, please? I have several development devices whose only connectivity is ADB over USB to a Linux development host. That's part of a corporate network with an NTP server. The devices' date and time drifts, and has to be reset occasionally. Being able to tell them about an NTP server would be splendid, if they can access it through the ADB/USB connection.
I have root on the devices, and can this change their date & time from the ADB shell. If I couldn't do that, I'd use the GUI. They're running a pretty vanilla Android 12.
John Dallman
(2649 rep)
Jun 20, 2024, 02:46 PM
• Last activity: Jul 7, 2024, 09:10 PM
2
votes
0
answers
1118
views
Make/force my cellular network connection have static IP address, or manual IP
I live a conflict area with internet blocked. I have Samsung a54 phone. They block your internet by blacklisting IPs assigned by certain towers on network registering. eg. 10.111.*.* is blocked while 10.67.*.* is internet enabled. When you come from another unrestricted area, already registered with...
I live a conflict area with internet blocked. I have Samsung a54 phone. They block your internet by blacklisting IPs assigned by certain towers on network registering. eg. 10.111.*.* is blocked while 10.67.*.* is internet enabled.
When you come from another unrestricted area, already registered with an IP of that area, they let you use internet fine. And when you come to the restricted area it still works fine with all towers. That's until your device does re registers, either due to restart or the phone resetting network settings. If you re register at the restricted area towers, they will give you a not working IP. I have been forced to drive to other cities, register to a tower there, and come back. It works while the connection is still maintained, even in the restricted towers.
Unfortunately, most modern phones and android versions try to "optimize" your internet and will auto reset, reconnect, switch network... and there is no way to stop them. And that will stop the internet and create new connection with the restricted towers, with new IP.
I tried setting manual network selection, forcing 4g only with an app... Yet, they "optimize" it and reconnect anyway.
But it all comes down to IP address, since I can use internet with some subnet of IP addresses. How can I make it retain, as if I can do manual IP address on a wifi and it works well?
I already know they are dynamic. But looking for a way to force it and to make the device say "this is my IP" and get at least rejected, as you can do in any other networks, even DHCP wifi or ethernet networks, where you can give your device any IP and make it claim to have a given IP and the network will either reject or accept you. (most accept if there is no conflict or is in the subnet)
You can find your cellular IP at Settings>About>Status>IP Address
Edit: Happy to root my phone if there is any viable solution that way too.
Abraham
(121 rep)
May 5, 2024, 04:43 PM
• Last activity: May 7, 2024, 07:36 PM
0
votes
0
answers
21
views
No internet from one AP
I have four Asus APs throughout my home, with the same two SSIDs, one for 2.4 and one for 5GHz. If I connect my Android device to the 5GHz band, then it works fine on 3 APs until it roams to one of the APs (kitchen), after which it fails to find internet. If I forget the network and then join it ane...
I have four Asus APs throughout my home, with the same two SSIDs, one for 2.4 and one for 5GHz. If I connect my Android device to the 5GHz band, then it works fine on 3 APs until it roams to one of the APs (kitchen), after which it fails to find internet. If I forget the network and then join it anew, it works till it roams back to kitchen from another AP. It also works fine on the 2.4 band.
All other devices, fixed and roaming, work fine.
I have fully reset network settings on Android, set static IP and 8.8.8.8 DNS, have reset the AP in the kitchen and also reset the AP that is connected to the gateway and is serving DHCP. I changed the SSID to something different and it worked on that AP, but that's not a permanent solution and it's a pain to change them throughout and reconnect so many devices, and may not even work.
Colin Ward
(1 rep)
Feb 12, 2024, 08:02 PM
0
votes
1
answers
834
views
What does "network time" mean on a WiFi-only device?
I have a tablet (no phone network, just WiFi) running Android 12. In the Settings | Date and Time sub-dialog when I select Automatic date & time, there is a 3 way choice: - Use network provided time - Use GPS provided time - Off What does the first option mean? It sure sounds like NTP, but there is...
I have a tablet (no phone network, just WiFi) running Android 12. In the Settings | Date and Time sub-dialog when I select Automatic date & time, there is a 3 way choice:
- Use network provided time
- Use GPS provided time
- Off
What does the first option mean? It sure sounds like NTP, but there is no interface to pick a NTP server. Some wifi routers provide a NTP server address with their DHCP replies, but I don't think mine does, and in any case a mobile device can't rely on that, right?
Strangely on my phone, also Android 12, the Automatic Date & Time widget is just a binary switch, on or off (though the phone definitely has GPS). I think "on" here means the mobile network. But how come this interface differs between two devices with the same Android release?
q.undertow
(103 rep)
Jan 3, 2024, 05:23 PM
• Last activity: Jan 4, 2024, 08:20 AM
0
votes
2
answers
5407
views
What can be the reason for "internet may not be available" though the IP address was obtained
Only one device with Android (SM-G390F, Android 7.0, G390FXXU2ARA1, 3.18.14-12962328) at my home stopped connecting to Internet through my WiFi router with the message "internet may not be available" and an exclamation mark on the WiFi sign. (Whereas older non-updated Android devices, GNU/Linux and...
Only one device with Android (SM-G390F, Android 7.0, G390FXXU2ARA1, 3.18.14-12962328) at my home stopped connecting to Internet through my WiFi router with the message "internet may not be available" and an exclamation mark on the WiFi sign. (Whereas older non-updated Android devices, GNU/Linux and iOS devices work.)
If I examine the current network configuration with
ip a
in a Terminal in the device, it has got the correct IP address, but pinging the router (ping 192.162.1.1
) looses all pings... (ip ro
showed a route to this network, but no default route -- but that shouldn't have affected the pinging of the router anyway.)
The WiFi router is an ASUS one, and for this device, in the log, it prints several times (not more than 10; the repetition is only for this device):
udhcpd: sending OFFER of 192.168.1.8
and then:
udhcpd: sending ACK to 192.168.1.8
The DNS servers from the DHCP configuration seem to be working well (as tested from other connected devices).
Changing the advanced settings from DHCP to manual does not help. And it is quite strange that this device used to work with this WiFi router all the time before a couple of weeks ago... Nothing has been changed.
imz -- Ivan Zakharyaschev
(1094 rep)
May 2, 2018, 07:01 PM
• Last activity: Oct 18, 2023, 09:52 AM
0
votes
2
answers
628
views
Hotspot DHCP issues without mobile data (dhcp4 request timed out)
By default, does the Android "hotspot" functionality provide a DHCP server to its clients? Or does it just pass DHCP info on from the network that it's connected to? I'm trying to create a hotspot for LAN-only communication between my laptop and my phone. I do not have a SIM card, so **"Mobile Data"...
By default, does the Android "hotspot" functionality provide a DHCP server to its clients? Or does it just pass DHCP info on from the network that it's connected to?
I'm trying to create a hotspot for LAN-only communication between my laptop and my phone. I do not have a SIM card, so **"Mobile Data" is disabled**." I also don't have access to another WiFI network, so **"WiFi" is disabled**.
I created a hotspot and try to connect to it from my laptop, but I get this error from NetworkManager's logs (I'm using GNU/Debian 11 Linux):
[user@sys-net ~]$ sudo journalctl -u NetworkManager -f
...
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.7570] device (wls6): Activation: starting connection '' (501ce9ff-854f-472a-81cd-5eb447c47379)
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.7585] device (wls6): supplicant interface state: disconnected -> interface_disabled
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.7585] device (p2p-dev-wls6): supplicant management interface state: disconnected -> interface_disabled
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.7654] device (wls6): supplicant interface state: interface_disabled -> disconnected
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.7655] device (p2p-dev-wls6): supplicant management interface state: interface_disabled -> disconnected
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.7667] device (wls6): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.7675] manager: NetworkManager state is now CONNECTING
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.7840] device (wls6): set-hw-addr: set-cloned MAC address to (stable)
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.8065] device (wls6): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.8087] device (wls6): Activation: (wifi) access point '' has security, but secrets are required.
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.8087] device (wls6): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.8248] device (wls6): supplicant interface state: disconnected -> interface_disabled
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.8248] device (p2p-dev-wls6): supplicant management interface state: disconnected -> interface_disabled
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.8250] device (wls6): supplicant interface state: interface_disabled -> disconnected
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.8250] device (p2p-dev-wls6): supplicant management interface state: interface_disabled -> disconnected
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.8405] device (wls6): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.8412] device (wls6): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.8461] device (wls6): Activation: (wifi) connection '' has security, and secrets exist. No new secrets needed.
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.8473] Config: added 'ssid' value ''
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.8474] Config: added 'scan_ssid' value '1'
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.8474] Config: added 'bgscan' value 'simple:30:-70:86400'
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.8474] Config: added 'key_mgmt' value 'WPA-PSK WPA-PSK-SHA256 FT-PSK SAE FT-SAE'
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.8474] Config: added 'auth_alg' value 'OPEN'
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.8475] Config: added 'psk' value ''
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.9055] device (wls6): supplicant interface state: disconnected -> authenticating
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.9059] device (p2p-dev-wls6): supplicant management interface state: disconnected -> authenticating
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.9109] device (wls6): supplicant interface state: authenticating -> associating
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.9110] device (p2p-dev-wls6): supplicant management interface state: authenticating -> associating
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.9365] device (wls6): supplicant interface state: associating -> 4way_handshake
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.9365] device (p2p-dev-wls6): supplicant management interface state: associating -> 4way_handshake
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.9611] device (wls6): supplicant interface state: 4way_handshake -> completed
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.9611] device (wls6): Activation: (wifi) Stage 2 of 5 (Device Configure) successful. Connected to wireless network ""
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.9611] device (p2p-dev-wls6): supplicant management interface state: 4way_handshake -> completed
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.9616] device (wls6): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Apr 07 16:15:24 sys-net NetworkManager: [1649340924.9621] dhcp4 (wls6): activation: beginning transaction (timeout in 45 seconds)
...
...
...
Apr 07 16:16:10 sys-net NetworkManager: [1649340970.5783] dhcp4 (wls6): request timed out
Apr 07 16:16:10 sys-net NetworkManager: [1649340970.5783] dhcp4 (wls6): state changed unknown -> timeout
Apr 07 16:16:10 sys-net NetworkManager: [1649340970.5784] device (wls6): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
Apr 07 16:16:10 sys-net NetworkManager: [1649340970.5799] manager: NetworkManager state is now DISCONNECTED
Why is my android device failing to provide my laptop with an IP Address? Is it because my android isn't already connected to another network running a DHCP server? How can I make my android hotpsot provide a DHCP IP address to my laptop when I connect to my android's hotspot?
Michael Altfield
(526 rep)
Apr 7, 2022, 02:47 PM
• Last activity: Sep 24, 2023, 12:46 PM
0
votes
0
answers
1009
views
Is there a way to have a static IP address on PC if I'm using USB tethering?
I need a static IP address on my PC. It uses a USB tethered phone (Xiaomi Redmi Note 10) for internet connection, so I'm not sure how to go about that. I tried to assign one through network settings on PC but that failed. Could I root my phone and install some third-party app to change my network se...
I need a static IP address on my PC. It uses a USB tethered phone (Xiaomi Redmi Note 10) for internet connection, so I'm not sure how to go about that. I tried to assign one through network settings on PC but that failed.
Could I root my phone and install some third-party app to change my network settings? If so, what apps do I need to get? Are there any methods other than the one I've mentioned that could work as well?
My knowledge on messing with Android devices is extremely poor, and I'm not that much more knowledgeable on computer networks, so I apologize in advance for any clueless-ness.
PolarBee
(1 rep)
Jun 6, 2023, 01:28 AM
0
votes
0
answers
2369
views
How to Run Captive Portal Server on Android Device using Hotspot SoftAp and DHCP options
**Goal:** I want to run a web server that provides a Captive portal service on an Android Device, using the native Android [Soft AP/Hotspot](https://source.android.com/devices/tech/connect/wifi-softap-tethering), Termux, NodeJs, and the "new" way to detect captive portals using a DHCP option: [Capti...
**Goal:**
I want to run a web server that provides a Captive portal service on an Android Device, using the native Android [Soft AP/Hotspot](https://source.android.com/devices/tech/connect/wifi-softap-tethering) , Termux, NodeJs, and the "new" way to detect captive portals using a DHCP option: [Captive-Portal Identification in DHCP and Router Advertisements (RAs)](https://datatracker.ietf.org/doc/html/rfc8910) ,.
**Approach:**
I want to add an option on the DHCP handshake of my Android Device Soft AP as specified in the [RFC](https://datatracker.ietf.org/doc/html/rfc8910) , [Apple](https://developer.apple.com/news/?id=q78sq5rv) and [Android](https://developer.android.com/about/versions/11/features/captive-portal) official forums.
(the old way to create a captive portal was to intercept and controll all DNS or HTTP requests of each device conected to the AccessPoint, but in order to do it I need to ROOT my Device and install a DNS server or change the IP tables, and I dont want to do it becouse is very similar of what I already did that on a RaspberryPi)
**Current State:**
Im able to run a local Http Server running Nodejs in Termux app on an NOT ROOTED Android device,I want to know if it is posible to ADD THAT SIMPLE DHCP OPTION to the Android DHCP native handshake, maybe creating an APP and using the [wifi-softap-tethering](https://source.android.com/devices/tech/connect/wifi-softap-tethering) utilities or changing some kind of DHCP config file in some location like /etc/dhcp/dhcp.conf to add the option.
If adding a DHCP option is not posible Im gonna change the IP tables or run a DNS server and intercept the trafic to provide the Captive Portal Detection as the OLD fashion way.
**Previous Attempts:**
I was able to create a captive portal using DNSMASQ and HOSTAPD on a RaspberryPi, I suppose that I can do the same on MY Android device, but I want to USe the "modern Way" using DHCP captive portal options.
**Unknowns**
1. Where is the configuration of the local Android DHCP?, is it hardcoded in the source code or it exists in a /system/{some-dhcp-func}/dhcp.conf file?
2. Is it posible to add a DHCP option to the native Android Soft AP functionality?
3. Can I use or extend some offical Class of Android apk and create my app to add the DHCP Option in the Handshake?
4. Do I really need to root my device, install a DNS server and intercept all the DNS /HTTP trafic to provide the captive portal functionality?
Diego Meza
(101 rep)
Jul 15, 2022, 06:21 PM
• Last activity: Jun 1, 2023, 11:52 PM
0
votes
0
answers
70
views
Some tablets respond to pings, others don't
There are dozens of tablets on my table that are all connected to the same 5GHz Wi-Fi network. All IP addresses were given by DHCP in subnet ```192.168.34.0/24```. I want to find the ip addresses of all of them so that I connect to them and use ```adb``` wirelessly. After unlocking all devices and m...
There are dozens of tablets on my table that are all connected to the same 5GHz Wi-Fi network. All IP addresses were given by DHCP in subnet
.168.34.0/24
. I want to find the ip addresses of all of them so that I connect to them and use
wirelessly. After unlocking all devices and making sure they had enough battery, I tried nmap -sn 192.168.34.1-254
. While it found a majority of the tablets, some were missing. Then I tried a broadcast ping with 192.168.34.255 -b
but got zero responses. However I can manually pick up a tablet, go to its settings find its ip and ping it manually and they always respond. For instance .168.34.123
was not found by
but 192.168.34.123
always works.
Why do some tablets not respond to nmap pings but do respond to manual pings? How can I ensure that all tablets are reachable by
? Are there other commands or tools that are more suitable for the job?
ally8546
(1 rep)
Jan 12, 2023, 04:16 AM
4
votes
1
answers
3987
views
How to reset static IP address back to DHCP for ethernet
I have setup a static ip address for `eth0` with adb command `ip addr add $ipAddress dev eth0` plus other commands to set the `netmask`, `route` and dns values. My question is how to I go back to a non static IP address I tried doing `ifconfig eth0 dhcp` but I get an error in adb saying > ifconfig:...
I have setup a static ip address for
eth0
with adb command ip addr add $ipAddress dev eth0
plus other commands to set the netmask
, route
and dns values.
My question is how to I go back to a non static IP address
I tried doing ifconfig eth0 dhcp
but I get an error in adb saying
> ifconfig: bad argument 'dhcp'
Right now the only way I can reset everything is if I reboot the device since the changes dont persist.
How can I reset them without a reboot?
tyczj
(161 rep)
Aug 12, 2020, 06:53 PM
• Last activity: Dec 20, 2022, 09:42 AM
11
votes
5
answers
8467
views
Endless “Obtaining IP Address” loop
Possible duplicates: - https://android.stackexchange.com/questions/60139/ice-cream-sandwich-cant-obtain-ip-address-what-do-i-need-to-delete-to-reset-wi - https://android.stackexchange.com/questions/13793/device-stuck-on-obtaining-ip-address-then-sets-network-to-disabled --- I have a *Sony Ericcson M...
Possible duplicates:
- https://android.stackexchange.com/questions/60139/ice-cream-sandwich-cant-obtain-ip-address-what-do-i-need-to-delete-to-reset-wi
- https://android.stackexchange.com/questions/13793/device-stuck-on-obtaining-ip-address-then-sets-network-to-disabled
---
I have a *Sony Ericcson Mini Pro* (Codename “Mango” at CyanogenMod) with CyanogenMod 9.1.0-mango. This is Android 4.0.4.
# The problem
When trying to connect to a wireless network, it will be stuck in an “Optaining IP Address” loop for a while, until it shows “Bad Connection”. This is what it looks like in the wireless network system settings:
My tablet with CyanogenMod 10.2, Android 4.3, can connect to that wireless network without any problems, so can my Kubuntu 13.10 laptop with an Intel wireless card.
# Tried so far
While looking for the cause and a fix for the problem, I found numerous posts that suggest to use a static IP address. This is a legitamate workaround, and I might resort to that, but I would like to fix this in general.
1. The first thing I tried was to [change permissions of

/system/etc/dhcpcd/dhcpcd-run-hooks
to 555](http://androidforums.com/avail-all-things-root/583407-easy-real-wifi-fix-obtaining-ip-address-loop-found-me.html) . This did not have any effect, though.
2. Then I downloaded the [WiFix](http://mhotspot.com/blog/fix-obtaining-ip-address-android-wifi-problem/) app and ran it in automatic mode. Did not do anything either.
3. Last thing I tried was [deleting /data/misc/dhcp/*
](http://thealarmclocksixam.wordpress.com/2013/10/26/dhcp-failure-on-android-wifi-stuck-on-obtaining-ip-address-how-i-solved-it/) . No effect at all.
4. *Update 2014-02-21*: As you can see in the screenshot, the signal strength is really weak, although the phone is one meter apart from the router with a desk in between. Now it connected while being on the table. The signal strength is full now. I read in [a different question](https://android.stackexchange.com/a/13800/27017) that the issue might be caused by a weak signal. Could that the be underlying issue?
My router does not have an external antenna, therefore, it might be a little unpredictable where the signal is strongest. I set the phone onto the router, and it still had the problem. So signal strength should not be the issue.
5. **Update 2014-03-04**: I installed the [latest nightly build of Cyanogen Mod](http://download.cyanogenmod.org/?device=mango) on the device using their [instructions](http://wiki.cyanogenmod.org/w/Install_CM_for_mango) . This installed Android 4.1.3, which had a severe problem with the wireless. It was turned off when I started the device, and it got stuck at activating wifi. So I reverted to the latest stable version which still has this endless loop.
6. **Update 2014-03-04**: For my home network, I set up a static IP address, although I really do not like it. However, the internet connection works now.
7. **Update 2014-03-06**: Checked for /system/bin/sh -> mksh
, and it is present. This does not seem to cause the issue.
How could I fix this apparent DHCP issue?
Martin Ueding
(498 rep)
Feb 21, 2014, 01:34 PM
• Last activity: Jun 12, 2022, 10:08 AM
1
votes
1
answers
1065
views
Cannot connect: Obtaining IP address
*This is not a duplicate of 'Android stuck on obtaining IP address' and similar questions* When I try to connect to my home network with my android phone, it displays this message and never connects: "Obtaining ip address...". This only happens when it tries to connect directly to the modem, rather...
*This is not a duplicate of 'Android stuck on obtaining IP address' and similar questions*
When I try to connect to my home network with my android phone, it displays this message and never connects:
"Obtaining ip address...".
This only happens when it tries to connect directly to the modem, rather than another access point (which is much much slower in my case).
I have followed tips online, the standard reconnect, reboot everything etc.; aswell as changing from DHCP to static IP. After assigning a static IP I successfully connect to the modem, but I have no internet connection. Rebooting and using different IPs does not help.
This problem is infuriating. Sometimes when I leave it for (DHCP) ages (10-20 mins) it manages to connect successful, but then the connection typically breaks down again maybe half an hour later.
The modem in question is a virgin media fibre modem, model EVW3226 manufactured by Ubee.
The internet works perfectly on all other devices we have, although sometimes it crops up on the Samsung tablet aswell.
The problem device in question is my Oneplus X running the latest version of oxygen (android 6.0.1 in this case) for this device.
otoomey
(111 rep)
Jan 19, 2018, 04:45 PM
• Last activity: Dec 23, 2021, 08:03 PM
0
votes
1
answers
1022
views
fail to connect to public wifi networks with cyanogenmod
I changed my pre-installed OS to Cyanogenmod 9 on my Xperia Neo V and since then I cannot connect to any free public network that requires simple registration (like airports, cafes, etc). My phone does connect to the networks (it says connected) but when I open the browser (Opera) to register it nev...
I changed my pre-installed OS to Cyanogenmod 9 on my Xperia Neo V and since then I cannot connect to any free public network that requires simple registration (like airports, cafes, etc).
My phone does connect to the networks (it says connected) but when I open the browser (Opera) to register it never connects, getting a failed to connect message after a while.
Does this has to do with this other problem I also have? To solve that problem I had to delete the
dhcp
folder. Maybe I deleted some other important files there?
luchonacho
(21 rep)
Feb 2, 2015, 11:14 AM
• Last activity: Dec 6, 2021, 09:03 AM
1
votes
1
answers
1936
views
Configuring DHCP client on my Android board
I am running Android on my development board and want to configure DHCP client on it. Can anyone tell the details of what steps to be followed to configure DHCP client on Android?
I am running Android on my development board and want to configure DHCP client on it. Can anyone tell the details of what steps to be followed to configure DHCP client on Android?
ravspratapsingh
(119 rep)
Nov 23, 2011, 09:19 AM
• Last activity: Nov 30, 2021, 05:01 AM
Showing page 1 of 20 total questions