1

I have a WiFi device which connects to my Android phone's hotspot. My Android phone acts as a router.

From my Ubuntu I connect to the same network. Is there any way to query the router (in this case, my Android phone) about the local IP addresses it has already assigned?

My objective is to identify my other device's IP address from my PC without the need for scanning for IPs manually.

2

2 Answers 2

2

No, there is no standard, widely-available way to query a DHCP server about what IP address leases it has given out.

1

Maybe - An IP enabled device keeps a mapping of directly connected devices - ie a mapping between IP addresses and MAC addresses. If you can get SSH/console access to the Android device you may be able to query this mapping (called an ARP table). The limit of this is that the devices need to have communicated with each other in the last little while (eg 5 minutes or so).

On Android/Linux (and I think most OS's) you can see the arp table with

 arp -a

Problem is that this only works with older versions of Android (up to 10). If you have a newer version - and you have rooted the device - you can get this info with

  su
  cat /proc/net/arp

Of-course you use the MAC address of the PC's WIFI interface to identify the device.

2
  • When I startee answwring this question I thought the answer would be generic to all devices. Thanks to lockdown in newer versions of Androud Im wrong. This belongs on android stackexchange so Im going to vote to move it there.
    – davidgo
    Commented Oct 1, 2023 at 16:42
  • I've not tried it, but if you are very technical, also look at android.stackexchange.com/questions/248314/…
    – davidgo
    Commented Oct 1, 2023 at 16:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .