5

Assigning a static IP address to a phones hotspot

 2 years ago
source link: https://forum.xda-developers.com/t/assigning-a-static-ip-address-to-a-phones-hotspot.4454483/#post-86990571
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Assigning a static IP address to a phones hotspot

normanscr

Member

How can I assign a static IP address to my phones hotspot?

I use the hotspot on my Samsung M31 to connect my laptop running Windows 10 to the internet.

I also have Oracle's Virtual Box VM running a few test websites on the laptop on Ubuntu Server 22.04, which need a static IP address to access.

A few days back when I ran ipconfig at the Windows command prompt, it showed my wireless IP address as 192.168.166.135. Today, it show as 192.168.35.125. Meaning, all my sites are now broken. Is there a way to stop the hotspot from changing IP addresses?

Can someone please help?

Thanks,

GalaxyA325G

Senior Member
How can I assign a static IP address to my phones hotspot?

I use the hotspot on my Samsung M31 to connect my laptop running Windows 10 to the internet.

I also have Oracle's Virtual Box VM running a few test websites on the laptop on Ubuntu Server 22.04, which need a static IP address to access.

A few days back when I ran ipconfig at the Windows command prompt, it showed my wireless IP address as 192.168.166.135. Today, it show as 192.168.35.125. Meaning, all my sites are now broken. Is there a way to stop the hotspot from changing IP addresses?

Can someone please help?

Thanks,

I don't know the answer to your question directly as your situation is more complicated than is mine but I will try to help in so much as you can at least check what your current settings are.

My setup is only similar to yours in that I have apps (such as vysor & scrcpy) on Windows which are expecting a static IP address from my phone. However, where my setup differs from yours is I'm not using my phone as a hotspot - the router is assigning the IP addresses.

However, maybe what I've learned by randomizing my MAC address on each connection can help you - where I say maybe - as I your situation is using the phone as a hotspot and mine is passively accepting the IP address handed to the phone by the router.

In Android 11, the phone's Wi-Fi radio MAC address can be randomized per SSID, in which case the "address reservation" feature of most routers (often incorrectly called "static" IP addresses) won't work as intended. Worse, in Android 12, in Developer options, you can set a switch to randomize the Wi-Fi radio MAC address of the phone on every connection, regardless of the SSID.

Hence, you have to set the "static" IP address request in the phone itself, so that the router will respect that request for a static IP address.

(As an extra complexity, my SSID broadcast is hidden for privacy reasons (not for security - but privacy), which complicates things only a tiny bit as you have to turn off auto-reconnect for privacy.)

See the images below where maybe (but maybe not!) this information will help you track down why in your (hotspot) case, this static IP address requrest isn't being honored in your hotstpot setup.

Attachments

  • macaddr02.jpg

    macaddr02.jpg
    595.5 KB · Views: 0
  • hiddennetwork01.jpg

    hiddennetwork01.jpg
    83.6 KB · Views: 0
  • adb02.jpg

    adb02.jpg
    107.8 KB · Views: 0
  • adb15.jpg

    adb15.jpg
    84.4 KB · Views: 0

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK