Assigning a static IP address to a phones hotspot - General Questions and Answers

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,

normanscr said:
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,
Click to expand...
Click to collapse
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.

normanscr said:
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,
Click to expand...
Click to collapse
Hi ,
if You are the lucky owner of a rooted phone you can try this:
How do I assign a permanent static IP address to hotspot in Android 10
I would like to assign a permanent static IP address to hotspot in Android 10 (Unofficial LineageOS 17.1 for Natrium by LuK1337, rooted with Magisk v20.3 and updated to Jan 11, 2020 build). Now whenever I turn on the hotspot, it assigns a...
forum.xda-developers.com

To assign a static IP address to your phone's hotspot:
Go to your phone's settings and find the hotspot or tethering settings.
Look for the option to set the IP address as "Static" or "Manual."
Enter the desired IP address, subnet mask, gateway, and DNS server information.
Save the settings and restart the hotspot.
For more details, you can check out https://1921681.mobi/192-168-100-1/. Hope this helps.

Related

Specifying DNS Servers for WiFi Connection

Hi Folks,
I have set up my wife's SPV E650 to hook up to our wireless network at home so she can connect to the internet through the home wireless network. We have static IP's on our LAN. Although I have specified a static IP for the E650's wireless connection, I cannot find out where I specify the DNS servers to allow her to connect to the internet via our ISP, (I know the DNS server IPs, I just can't find out where I enter that info on the E650). So at the moment, I can connect to the home network, but cannot get onto t'internet!
It is quite likely that I am being a spaz and am missing something obvious... regardless, if you can help me, let me know!
Cheers
MW
even if you have a static IP you should not have to specify a static DNS because your default gateway should be your router IP address and your router should automatically give the DNS servers to any device that pulls that ip address
Disabled said:
even if you have a static IP you should not have to specify a static DNS because your default gateway should be your router IP address and your router should automatically give the DNS servers to any device that pulls that ip address
Click to expand...
Click to collapse
Thanks for your response.
All the other devices on my home network (laptop, PC, Xbox 360, SPV M3100) ask for the DNS server to be specified in a static IP environment, and they all connect to the internet just fine through the wireless network.
I am sure you are right, but I know that none of the above mentioned devices connect to the internet without the DNS servers specified.
So, question remains, how do I specify the DNS servers on the E650? Maybe a registry entry?
@mortalwombat,
i have the same problem with my htc s710.
Even though I run the wireless network with static IPs, I set my HTC S710 to get the IP "from a server" (= dynamic IP setting).
I did this after I tried with an IP Adress within my IP Adress Range.
So what happened is that my S710 somehow gets an IP Adress from my router that is almost in my regular IP Range.
You can try to set an static IP Adress within your Range first and then switch to dynamic IP Adress on you device..
Marcus

[Q] wifi is connected but no internet access

hello, I'm using an htc inspire 4g. I connect to wifi but no internet access. other devices connect to the router. I tried resetting the phone and it still doesn't work. Can someone help me fix this???
here's the software information.
Android version 2.3.5
Htc sense version: 3.0
Software number: 3.20.502.52 710RD
Kernel version:2.6.35.10-ga 375925
Baseband version: 12.69a.29u_26.17.14.11_M
Build number: 3.20.502.CL380259 release keys
Browser version: webKit/533.1
You should check the settings for the WiFi network. Make sure gateway is set to the address of the router, DNS server is set to the address provided by your ISP (unless your router is providing a DNS service), and select DHCP as the means to get an IP address, or specify a static address if desired.
Sent from my Inspire 4G using xda app-developers app
---------- Post added at 10:50 PM ---------- Previous post was at 10:44 PM ----------
And subnet mask should most likely be set to 255.255.255.0
Sent from my Inspire 4G using xda app-developers app
Still not working
:crying:
MidnightJava said:
You should check the settings for the WiFi network. Make sure gateway is set to the address of the router, DNS server is set to the address provided by your ISP (unless your router is providing a DNS service), and select DHCP as the means to get an IP address, or specify a static address if desired.
Sent from my Inspire 4G using xda app-developers app
---------- Post added at 10:50 PM ---------- Previous post was at 10:44 PM ----------
And subnet mask should most likely be set to 255.255.255.0
Sent from my Inspire 4G using xda app-developers app
Click to expand...
Click to collapse
could u break it a down a bit more. The netmask was empty so i eneterd the one you gave me. i also type in the IP address that came up under the wifi that I'm connect to. I entered the IP at the gateway address. It's still not working.
Click to expand...
Click to collapse
The IP address you enter for the gateway address needs to be the local address and not the Internet address. Your router has one address that it presents to other hosts on the Internet, and one that it presents locally to systems on your home network. The former is your public IP address, and it will be assigned by your ISP. If you google "whats my IP address" on a working system on your network, and click one of the links in the result, you'll see your public IP address displayed. This is NOT what you want to enter for gateway address in your network configuration on your HTC.
You need the private address of the router. It probably starts with 192.168, and 192.168.1.1 would be a good guess. You need to consult your router documentation to see what it is. Also note that it could have been changed through the web interface to the router, by whomever configured your router. To verify you have the correct private LAN address, type http://<some IP address> in your browser, and you should see a router configuration screen, probably prompting you for a password. If you can't figure out the LAN address, post the make and model of your wireless router, and we can tell you the default LAN address, or you could google for that info also.
What do you have selected for how the IP address is specified? I guess the precise wording varies from ROM to ROM, but you can either define your own (static) IP address or select to have the router's DHCP server assign an IP address. You should select the latter, as it's simpler to configure. Then you need to make sure you have the correct DNS address. You can probably set this to the router's LAN address, which will work if the router is configured to pass through DNS requests. If that doesn't work, your ISP should somewhere tell you what DNS addresses (prime and backup) you should be using. You could also look at the network config of a working system on your LAN, and copy those settings on your HTC.
When all these settings are made, see if there is a selection to renew the DHCP lease, and do that if you find it. If you don't have that option, and it's still not working, select to "forget" the network, then connect to it again and enter all the settings from scratch and submit it.
Since you're connected to WiFi, it sounds like you have the correct password and security type set. The fact that you're connected to WiFi and not Internet suggests something is wrong with your IP configuration. Hopefully one of the things mentioned above will get you going.
It worked... Thank you
MidnightJava said:
The IP address you enter for the gateway address needs to be the local address and not the Internet address. Your router has one address that it presents to other hosts on the Internet, and one that it presents locally to systems on your home network. The former is your public IP address, and it will be assigned by your ISP. If you google "whats my IP address" on a working system on your network, and click one of the links in the result, you'll see your public IP address displayed. This is NOT what you want to enter for gateway address in your network configuration on your HTC.
You need the private address of the router. It probably starts with 192.168, and 192.168.1.1 would be a good guess. You need to consult your router documentation to see what it is. Also note that it could have been changed through the web interface to the router, by whomever configured your router. To verify you have the correct private LAN address, type in your browser, and you should see a router configuration screen, probably prompting you for a password. If you can't figure out the LAN address, post the make and model of your wireless router, and we can tell you the default LAN address, or you could google for that info also.
What do you have selected for how the IP address is specified? I guess the precise wording varies from ROM to ROM, but you can either define your own (static) IP address or select to have the router's DHCP server assign an IP address. You should select the latter, as it's simpler to configure. Then you need to make sure you have the correct DNS address. You can probably set this to the router's LAN address, which will work if the router is configured to pass through DNS requests. If that doesn't work, your ISP should somewhere tell you what DNS addresses (prime and backup) you should be using. You could also look at the network config of a working system on your LAN, and copy those settings on your HTC.
When all these settings are made, see if there is a selection to renew the DHCP lease, and do that if you find it. If you don't have that option, and it's still not working, select to "forget" the network, then connect to it again and enter all the settings from scratch and submit it.
Since you're connected to WiFi, it sounds like you have the correct password and security type set. The fact that you're connected to WiFi and not Internet suggests something is wrong with your IP configuration. Hopefully one of the things mentioned above will get you going.
Click to expand...
Click to collapse
Thank you very much it is working now. I reset the phone again and then enter the IP address, gateway address and DNS 1 and DNS 2. I"m so gratfeul. Thanks again.I used the info from the PC I am using
Click to expand...
Click to collapse
You're welcome. Glad to hear it's working.

A weird restriction to access internet from wifi

Ask Question
I had a small quarrel with my stepfather, and then he didn’t let me access the home internet. When I try to connect to our home wifi normally, it says "obtaining ip address" and loops for minutes until it says "failed to obtain ip address." But when I try to connect by setting static ip from my phone, it connects immediately but says " no internet." I assumed he might have blacklisted me, but I am unable to connect even my laptop and other phones. Suspecting that my stepfather had enabled whitelist or MAC filtering, I tried to spoof MAC address using kali linux, but I couldn't connect to the wifi with spoofed MAC. I need internet but my stepfather won't listen to me. Since he is not in home right now and won't return for a month, I don't have a connected device to access the setup page and see the settings of our Digicom ( DG-M342T) router. I am also unable to physically access the router but I have the password( Authentication type - WEP). How do I fix this? I would really appreciate your help.
You could download the router's management app and then view the connected devices list on your phone. Check your router's setup guide to see which app you need to download.
jwoegerbauer said:
You could download the router's management app and then view the connected devices list on your phone. Check your router's setup guide to see which app you need to download.
Click to expand...
Click to collapse
I can't access the setup page by typing 192.168.10.1 in the url or from other Router management apps on the play store. It says " Can't reach the page." I also checked the guide where it says to open admin page by typing 192.168.10.1 on the browser , but there is no mention of any management apps.
Making changes to your router you’d need to know the IP address of the router. A list of wellknown router IPs here:
How to Find Your Router IP Address in 3 Steps | ExpressVPN
Learn what an IP address is, the differences between a local and public IP address, and how to find your router’s IP on Windows and Mac.
www.expressvpn.com
jwoegerbauer said:
Making changes to your router you’d need to know the IP address of the router. A list of wellknown router IPs here:
How to Find Your Router IP Address in 3 Steps | ExpressVPN
Learn what an IP address is, the differences between a local and public IP address, and how to find your router’s IP on Windows and Mac.
www.expressvpn.com
Click to expand...
Click to collapse
Thanks for your reply jwoegerbauer. As I mentioned earlier in my post, if I connect to wifi just by typing password, it loops "obtaining ip address" for long period, and therefore I have to set static ip address through the advance setting of wifi just to connect to it. My router's local ip address is 192.168.10.1 . I used to access the admin page before the restriction through this ip address. But now it says "Can't reach the page." The problem is about not being able to access internet and admin page after connecting to the router.
Clear your local DNS cache to make sure you have the recent version from your ISP for 192.168.10.1. For Windows machine, you can do this by going to Start > Command Prompt > Type ipconfig /flushdns and then hit Enter.
Assumed that router's IP really is 192.168.10.1 and it still doesn't work then maybe ISP is blocking it. You may try to use an alternate DNS service such as Cloudflare for example.
I flushed the dns in windows. Now I can connect to the wifi without setting statip ip (in windows), but I still can't access internet. If I try to open any website, it says "
Hmmm… can't reach this page" and then says "You are not connected." I installed cloudflare WARP in windows but it was no use , since it requires internet access to function.
These are the screenshots of my android to explain what exactly happens:
1. When I try to connect to wifi just by typing it's password (loops at "obtaining ip address")
2. Setting the static ip manually
3. Instantly connected after setting static ip
4. Connected but No internet
5. Can't access router setup page
Cloudflare Warp? Confused.
How to change DNS Server to Cloudflare is explained in detail here:
How To Change DNS To 1.1.1.1 [ CloudFlare ] In Windows 10 Laptop And PC Full Tutorial - TECHWIBE
Are you having a slow Internet speed and websites are taking too long to load with your Window 10 OS (laptop or PC). Then this guide will definitely help you
www.techwibe.com
I downloaded an application( Cloudflare WARP) form the cloudflare website linked below. I checked the website you linked and changed the DNS accordingly, but I still can't access internet. My android phone is not even connecting without static ip and I am tired of manually setting it and not being able to use internet.
Windows · Cloudflare WARP client docs
The Cloudflare WARP client allows individuals or organizations to have a faster, more secure and private experience online.
developers.cloudflare.com
No further ideas on my part.
jwoegerbauer said:
No further ideas on my part.
Click to expand...
Click to collapse
Well thanks for your help jwoegerbauer. Below is the screenshot of ipconfig command after flushing dns. It looks like I haven't been assigned an ip address, the subnet is different, and the gateway is blank. Do you have any idea what this means? What could be a valid ip adress to connect manually with static ip?

Cannot access local lan web site (sometimes)

I have various machines on my lan in 192.168.1.*, I have a local DNS server to give those machines names. This normally works great, but my new Samsung Galaxy S21 sometimes says "cannot access" when I point it at a web address of a server running on my lan. I'll use a network utility app to do a DNS lookup of the other system, and it will tell me the correct address, then I'll use the same network utility to do a traceroute, and it will try to talk to a local IP I do not have in my network, in my DNS database, or anywhere in the set of addresses my router knows about. Where does this ghost address come from? Does the phone imagine that is the gateway it ought to be using for some reason? (The router's DHCP server certainly doesn't claim an unknown address is the gateway).
Every time I start trying to investigate the problem in more detail, everything suddenly starts working perfectly.
Does this ring a bell for anyone? Any clue what is going on? Maybe I should assign my phone's network statically and see if it works better.

One Plus 8 attacks my LAN VPN gateway...

This started a couple of days ago, and I have now mitigated it with a couple of firewall rules on the VPN gateway, as well as shutting down the dhcpcd server on that server (which I don't need anyway, and which probably should have been stopped long ago).
My LAN has a raspberry pi 4 running their debian firmware that is configured as a VPN gateway. It connects my LAN via ProtonVPN to the internet. This gateway is set up with a static IP address (192.168.2.49) on the LAN, and is configured to use another RPI on my LAN to get its DNS (192.168.2.50).
My one month old running OOS 11 OnePlus8 is rooted with magisk, and I have blocked most of the google stuff from the internet using afwall, and suspended non-essential system services using greenify. When connected to my LAN, the phone has a static IP address (192.168.2.71), has its gateway set to the VPN gateway (192.168.2.49), and its DNS to my local rpi DNS (192.168.2.50).
DHCP on my LAN is provided by my router (192.168.2.1).
WIFI on my LAN is provided by an enterprise-grade tp-link hotspot.
Starting a few days ago, for reasons mysterious, when the phone connects to the LAN, the VPN gateway would promptly go offline. Because I run it headless, I would be forced to reboot it - which made diagnosis a bit of a pain. Finally, I found a log entry on the VPN gateway that informed me that my OnePlus was trying to claim the ip address of the VPN gateway as its own (192.168.2.49) in spite of being set to use 192.168.2.71. This duplicate IP was causing dhcpcd on the VPN gateway to immediately take down its eth0 interface. This would break ALL connectivity because I have wifi on that RPI disabled.
Prior to this problem involving the OnePlus, that RPI had been up continuously for over 400 days, so it should certainly be considered to be reliable at the job it does and almost certainly the problem is with the OnePlus.
So, for some reason the OnePlus is trying to assert its assigned gateway address as its IP rather than the 192.168.2.71 that is set, at least in some packet that it uses to announce itself; once it is connected it works properly (which means the right IP address is being used).
I have deleted, then re-created the wifi connection profile and doing that did not cause the problem to go away.
I have another RPI VPN gateway on my IOT VLAN (192.168.24.0/24). No DHCP is available on the VLAN (a security measure), and I do have a profile for the phone that allows it to connect to the VLAN. It works without issue there, but then dhcpcd has been and remains shut down on that RPI. I suppose I could start dhcpcd on that server and see if the phone then breaks it too. I won't do this unless there is some merit to doing so...if it would help find the basic problem.
As I say, shutting down dhcpcd and blocking all dhcp traffic to/from the LAN VPN gateway mitigated the problem. But that the problem could occur at all says something is wrong, and I'm pretty sure it isn't a problem on my network.
This seems most likely to be a bug in OnePlus firmware, though why it would manifest after a month is a mystery to me. Does anyone have any insight? Or does anyone have any suggestions for another place on XDA where this post might more appropriately be placed?
I was pretty sure no one would have any idea about this. I have mitigated it by turning off dhcpcd on the VPN gateway and I am not inclined to do a deeper dive; I have too much else to do.

Categories

Resources