Discussion:
Desktop PC to Android Mobile Hotspot - What do you use for the Gateway?
(too old to reply)
Patrick
2024-02-21 05:31:02 UTC
Permalink
Desktop PC to Android Mobile Hotspot - What do you use for the Gateway?
1. My Windows 10 desktop has no Wi-Fi card.
2. So I Ethernet out to an old router acting as a wireless client bridge.
3. This has been working for many years.

For whatever reason, the Internet went out.
So I set up the phone as a Mobile Hotspot which works for the laptop.
But I wanted the desktop to be connected also.
1. So I figured I'd set up the bridge, temporarily to the Mobile Hotspot.
2. The Mobile Hotspot has an SSID with the same passphrase as all my APs.
3. The Mobile Hotspot, by default, is set to 10 clients.

So I saved the old router configuration to the AP.
And I changed the SSID for the wireless client bridge to connect to.
Since the passphrase is the same, only the SSID needed to be changed.

Or so I had thought.
Booted many times but the router (as a wireless client bridge) won't
connect to the mobile phone (set up as a mobile hotspot).

Why not?
The only difference between the old setup & the new is the SSID.

There's also a question in the DD-WRT wireless client bridge setup of:
Local IP Address = 192.168.1.whatever/24
Gateway = 192.168.1.1
Local DNS = 192.168.1.1

I thought "maybe the DNS needs to be changed" so I changed that to
8.8.8.8 but what would I set the "Gateway" to when it's whatever the
carrier's gateway would be for the cellular data connection?
Carlos E.R.
2024-02-21 12:12:02 UTC
Permalink
Post by Patrick
Desktop PC to Android Mobile Hotspot - What do you use for the Gateway?
1. My Windows 10 desktop has no Wi-Fi card.
2. So I Ethernet out to an old router acting as a wireless client bridge.
3. This has been working for many years.
For whatever reason, the Internet went out. So I set up the phone as a
Mobile Hotspot which works for the laptop.
But I wanted the desktop to be connected also.
1. So I figured I'd set up the bridge, temporarily to the Mobile Hotspot.
2. The Mobile Hotspot has an SSID with the same passphrase as all my APs.
3. The Mobile Hotspot, by default, is set to 10 clients.
So I saved the old router configuration to the AP.
And I changed the SSID for the wireless client bridge to connect to.
Since the passphrase is the same, only the SSID needed to be changed.
On most software, changing the SSID erases/reset the passphrase.
Post by Patrick
Or so I had thought.
Booted many times but the router (as a wireless client bridge) won't
connect to the mobile phone (set up as a mobile hotspot).
Why not?
Read its log and find out.

...
--
Cheers, Carlos.
Java Jive
2024-02-21 13:40:06 UTC
Permalink
Post by Patrick
Desktop PC to Android Mobile Hotspot - What do you use for the Gateway?
1. My Windows 10 desktop has no Wi-Fi card.
2. So I Ethernet out to an old router acting as a wireless client bridge.
I'm confused by the terminology.  I would expect "wireless client" to be
sufficient.
He states that he's using a DD-WRT build, presumably it's on this
router, in which case, in DD-WRT speak, there is a difference between
the two. IIRC there are two possible settings to achieve what he wants,
one of which, a client-bridge, simply behaves as a replacement for a
piece of cabling, in that the router locks on to the source WiFi and
passes all DHCP & DNS etc straight through to its cabled LAN ports, and
does not act as an access-point. IIRC still, there is another choice
where the router does all the above but also acts like an AP in allowing
clients to its own WiFi also to make connections back to the source router.
Post by Patrick
3. This has been working for many years.
OK so what is the internet router it normally connects to?  And what LAN
IP address does it have?
Post by Patrick
For whatever reason, the Internet went out.
To avoid confusion, power off this router while the internet is dead.
Post by Patrick
So I set up the phone as a Mobile Hotspot which works for the laptop.
What LAN IP address does this laptop report when connected to the hotspot?
Post by Patrick
But I wanted the desktop to be connected also.
1. So I figured I'd set up the bridge, temporarily to the Mobile Hotspot.
2. The Mobile Hotspot has an SSID with the same passphrase as all my APs.
I think this is very confusing.  I think you should change its SSID to
be obviously different - "Hotspot" - and specify a different passphrase.
Then change the old router's wireless credentials to the values required
for the hotspot.
[snip]
Post by Patrick
Local IP Address = 192.168.1.whatever/24
Gateway = 192.168.1.1
Local DNS = 192.168.1.1
If it's of any help, on my DD-WRT Client-Bridge, an old Cisco LinkSys
WRT320N which links my bedroom to the rest of my home LAN, the settings are:

Setup, Basic Setup, Router IP:
Local IP Address: 192.168.x.y where y is not 1
Subnet Mask: 255.255.255.0
Gateway: 192.168.x.1
Local DNS: 192.168.x.1

However, if I was trying to connect it to my tablet acting as a mobile
hotspot, I'd expect to be using a different x than that required to
connect to my primary main router. What x should be in this case you
should be able to find out either from the phone itself or if not there
then the laptop that connects successfully - on the latter start a
Command Prompt with Administrator privileges, type ...
IPConfig /all
... and note what is x for the wireless connection.

Going back to the client-bridge, Wireless, Basic Settings:
Wireless Mode: Client Bridge
Wireless Network Mode: N-Only (2.4GHz)
Wireless Network SSID: XYZ
Sensitivity Range (ACK timing): 2000 (IIRC the default)
Network Configuration: Bridged
The LAN IP address for the wireless client can only be used for
communication with the client itself.   The DHCP service should be off,
which means that to communicate with the wireless client your computer
needs a static address of the form 192.168.1.another.  The "gateway"
value is meaningless in this context.
No, either this is incorrect or I'm misunderstanding what you're saying
because of the potential for ambiguity, so let me try a different and
hopefully entirely unambiguous explanation, (deep breath) here goes:

The client-bridge setting in the secondary DD-WRT router essentially
makes its wireless connection back to the main router behave like a
physical cable connecting the main router to its own switch and its LAN
ports beyond. As long as the desktop PC was previously set to accept a
DHCP IP & DNS from the main router, nothing should need to change;
however, if it was using a fixed IP, then obviously that would need to
change because x in the settings above is now going to be different. As
you state, I would recommend using DHCP for any devices beyond a
client-bridge, and if it was desirable that one of them has a fixed IP,
then fix that in the addresses doled out by the main router.

I have both a Network Media Player and occasionally an old laptop wired
to the bedroom client-bridge, both are set to use DHCP, but in the main
router the NMP is always given the same IP address reserved high in the
allocatable range, while the laptop just gets whatever it is given.
(You may wonder, why not use the laptop's WiFi directly? It's only G,
whereas the client-bridge is N, so the connection is significantly
faster via the client-bridge.)
--
Fake news kills!

I may be contacted via the contact address given on my website:
www.macfh.co.uk
Patrick
2024-02-22 14:47:00 UTC
Permalink
Post by Java Jive
As long as the desktop PC was previously set to accept a
DHCP IP & DNS from the main router, nothing should need to change;
however, if it was using a fixed IP, then obviously that would need to
change because x in the settings above is now going to be different.
Maybe the problem is the PC has a static IP address, but I don't see
anywhere in the DD-WRT setup as a "Repeater Bridge" where it cares.

The PC's IP address, as far as I can figure out, is set on the PC.
The DD-WRT "Repeater Bridge" doesn't seem to care what IP address it is.

But you are correct that it is in the same subnet as the DD-WRT "Repeater
Bridge" (and the same subnet of the AP that the DD-WRT "Repeater Bridge" is
wirelessly bridged to. Likewise that AP that the DD-WRT "Repeater Bridge"
is bridged to is wired to a switch which is wired to the main router which
is wired to the modem - all of which are on the same subnet.

I guess what you're suggesting I think about is that the phone, when put in
hotspot mode, is on a DIFFERENT subnet - which I'm sure it is.

I am looking at the suggestion from Andy about DNSmasq to maybe fix that.
https://wiki.dd-wrt.com/wiki/index.php/DNSMasq_as_DHCP_server
Graham J
2024-02-22 16:04:56 UTC
Permalink
Post by Patrick
Desktop PC to Android Mobile Hotspot - What do you use for the Gateway?
Short answer: leave the desktop using DHCP and it'll Just Work
Maybe your intervening router needs a DHCP helper?
I do not understand your suggestion.
The desktop has a static IP address (but it could have been assigned by the
gateway for all that it matters). Coming out of the desktop is Ethernet.
Understood. It should also therefore have a compatible subnet mask, and
a default gateway. These will enable it to communicate with the
internet router. Conventionally it will have its DNS pointing at the
internet router which will forward requests to the ISP's DNS server.
Aternatively it may explicitly use an independent DNS server such as
8.8.8.8 from Google.

Please tell us these parameters.

You may have a good reason for configuring the desktop PC with a static
IP. Please tell us why.
The Ethernet goes into the DD-WRT wireless client bridge which DD-WRT calls
a "Repeater Bridge", the other of the 6 choices being "AP", "Station",
"Station Bridge", "Repeater" & "Ad Hoc" for the "Radio Mode".
There is no obvious setting in the DD-WRT "Repeater Bridge" setup that has
anything to do with DHCP, perhaps because bridges operate at the level of
the MAC address, and as such, are simply pass-through for IP addresses.
I know nothing of DD-WRT but in the context of its "Repeater Bridge"
mode it should not have a DHCP server. Neither should it have a DNS
server. As you say it passes all such traffic through as if it were a
piece of wire.

But in order for you to communicate with the DD-WRT it needs an IP
address/mask. This must be consistent with the IP address of the
desktop PC, and it must not be the same as the IP address of anything
else in your system. It does not need anything for DNS or default
gateway unless it needs to get information from the internet.

We need to understand how the DD-WRT gets its IP address. Did you put
it there? Is it automatically established by the "Repeater Bridge"
mode? Does it get it by DHCP from the router on the other end of the
wireless link?
The router is bridged wirelessly to an access point which itself is wired
via a switch into the main router which itself connects to the modem.
The strange thing is this has been working for years, so I don't think
there is anything wrong with the DD-WRT setup.
OK so far. What is the IP address of the main router?
But I do wonder what
"gateway" the phone uses since the gateway of 192.168.1.1 wouldn't exist on
the phone's network when used as an access point mobile hotspot.
You can find this out.

Connect a laptop to the phone hotspot via WiFi. To avoid confusion first
power off everything except the laptop and phone. Use the command line
IPCONFIG /ALL to discover the network address, and specifically the
default gateway address allocated to the laptop. The laptop should be
configured to "Obtain an IP address automatically" and "Obtain DNS
server address automatically". These parameters are generated by the
hotspot in the phone.

I expect you to discover that the network address is different from the
one established by the internet router.

[Snip irrelevant part about "DHCP Helper"]

Now disconnect the laptop from the phone, by disabling its wireless
facility.

Power up the desktop PC and the DD-WRT only. Establish whether you can
still communicate with the DD-WRT. If it expects to get its IP address
from the internet router then this will fail, and you won't be able to
communicate with it. If its IP address is static (regardless of how
this was achieved) then communication should be possible.

At this stage you should be able to change the wireless parameters to
suit those required by the phone. The DD-WRT should then show it is
connected to the phone, possibly via a status page of some sort.

Now connect the laptop BY WIRE to the DD-WRT. What should happen is
that the laptop sends its DHCP request and receives replies from the
phone hotspot. The network parameters should look much the same as when
the laptop was connected directly to the phone hotspot earlier in this test.

You should then be able to browse the internet.

Now for the desktop PC. Connect this by wire to the DD-WRT. The PC is
statically configured to communicate with the DD-WRT, but the I expect
network address generated by the phone hotspot to be different. So
change the desktop PC to "Obtain an IP address automatically" and
"Obtain DNS server address automatically". It will now no longer
communicate with the management page in the DD-WRT but it should
communicate THROUGH the DD-WRT to the phone hotspot, and should be able
to browse the internet.
--
Graham J
Patrick
2024-02-22 16:31:23 UTC
Permalink
Post by Graham J
I do not understand your suggestion.
The desktop has a static IP address (but it could have been assigned by the
gateway for all that it matters). Coming out of the desktop is Ethernet.
Understood. It should also therefore have a compatible subnet mask, and
a default gateway. These will enable it to communicate with the
internet router. Conventionally it will have its DNS pointing at the
internet router which will forward requests to the ISP's DNS server.
Aternatively it may explicitly use an independent DNS server such as
8.8.8.8 from Google.
Please tell us these parameters.
C:\Windows\system32> netsh interface ipv4 show config "eth0"

Configuration for interface "eth0"
DHCP enabled: No
IP Address: 192.168.1.123
Subnet Prefix: 192.168.1.0/24 (mask 255.255.255.0)
Default Gateway: 192.168.1.1
Gateway Metric: 1
InterfaceMetric: 35
Statically Configured DNS Servers: 1.1.1.1
8.8.8.8
Register with which suffix: Primary only
Statically Configured WINS Servers: None
Post by Graham J
You may have a good reason for configuring the desktop PC with a static
IP. Please tell us why.
I configured the PC years ago, so I don't remember even how I configured it.
It doesn't matter to me what its IP address is as long as it works.

I had probably configured it following a guide such as this one I found now.

How To Set Up A Repeater Bridge in DD-WRT
https://blog.flashrouters.com/2021/07/19/how-to-set-up-a-repeater-bridge/
Post by Graham J
I know nothing of DD-WRT but in the context of its "Repeater Bridge"
mode it should not have a DHCP server. Neither should it have a DNS
server. As you say it passes all such traffic through as if it were a
piece of wire.
Notice in the above they "Disable DNSMasq" (which I also have disabled).
And notice they also "DHCP Server: Disable" (which I have disabled).

I'm sure I followed a guide on the DD-WRT website which disabled both of them.
So you are correct. The Repeater Bridge has both of those things disabled.

But I think my mistake is I don't need the router set up as a repeater
bridge to connect it to the phone hotspot. I just need it as a router.

And the PC can plug into that router just as if it was any other router.

I'm slowly coming to the realization that my fault is I was trying to
keep the repeater bridge - but I don't need the repeater bridge in the
emergency temporary situation of the Internet going out on me.
https://wiki.dd-wrt.com/wiki/index.php/Bridging
Post by Graham J
But in order for you to communicate with the DD-WRT it needs an IP
address/mask. This must be consistent with the IP address of the
desktop PC, and it must not be the same as the IP address of anything
else in your system. It does not need anything for DNS or default
gateway unless it needs to get information from the internet.
We need to understand how the DD-WRT gets its IP address.
Did you put it there? Is it automatically established by the "Repeater Bridge"
mode? Does it get it by DHCP from the router on the other end of the
wireless link?
The IP address of the DD-WRT device is assigned in the setup.
It's static.

It's how all the setup instructions say to do it.
https://blog.flashrouters.com/2021/07/19/how-to-set-up-a-repeater-bridge/
Post by Graham J
The router is bridged wirelessly to an access point which itself is wired
via a switch into the main router which itself connects to the modem.
The strange thing is this has been working for years, so I don't think
there is anything wrong with the DD-WRT setup.
OK so far. What is the IP address of the main router?
See above netsh interface ipv4 show config "eth0" which shows the main
router to be at 192.168.1.1


C:\Windows\system32>tracert 192.168.1.1
Tracing route to 192.168.1.1 over a maximum of 30 hops
1 1 ms 1 ms 1 ms 192.168.1.1
Trace complete.

Surprisingly, the PC doesn't even see the DD-WRT nor the AP as it only
sees the gateway in a single hop (interestingly so).
Post by Graham J
But I do wonder what
"gateway" the phone uses since the gateway of 192.168.1.1 wouldn't exist on
the phone's network when used as an access point mobile hotspot.
You can find this out.
Connect a laptop to the phone hotspot via WiFi. To avoid confusion first
power off everything except the laptop and phone. Use the command line
IPCONFIG /ALL to discover the network address, and specifically the
default gateway address allocated to the laptop. The laptop should be
configured to "Obtain an IP address automatically" and "Obtain DNS
server address automatically". These parameters are generated by the
hotspot in the phone.
I expect you to discover that the network address is different from the
one established by the internet router.
Yup. I'm sure it is. And that's part of the root of the problem I had.
Post by Graham J
Now disconnect the laptop from the phone, by disabling its wireless
facility.
Power up the desktop PC and the DD-WRT only. Establish whether you can
still communicate with the DD-WRT. If it expects to get its IP address
from the internet router then this will fail, and you won't be able to
communicate with it. If its IP address is static (regardless of how
this was achieved) then communication should be possible.
At this stage you should be able to change the wireless parameters to
suit those required by the phone. The DD-WRT should then show it is
connected to the phone, possibly via a status page of some sort.
Now connect the laptop BY WIRE to the DD-WRT. What should happen is
that the laptop sends its DHCP request and receives replies from the
phone hotspot. The network parameters should look much the same as when
the laptop was connected directly to the phone hotspot earlier in this test.
You should then be able to browse the internet.
Now for the desktop PC. Connect this by wire to the DD-WRT. The PC is
statically configured to communicate with the DD-WRT, but the I expect
network address generated by the phone hotspot to be different. So
change the desktop PC to "Obtain an IP address automatically" and
"Obtain DNS server address automatically". It will now no longer
communicate with the management page in the DD-WRT but it should
communicate THROUGH the DD-WRT to the phone hotspot, and should be able
to browse the internet.
I slowly came to the realization that I was thinking about it all wrong.
I should have thought about it as an entirely different network.

1. The Internet comes to the phone over the air
2. The phone acts as a mobile hotspot
3. The router should connect to that mobile hotspot
4. And the PC just plugs into the switch at the back of the router

I didn't realize it, but the "bridge" and "repeater" have nothing
to do with the problem set when I'm using the phone as a hotspot
to replicate the missing Internet when the Internet goes out.

I see there are guides for connecting a phone as a hotspot to a router,
so I will follow one of those as what I want to do is a common need.

How to Connect a Router to a Mobile Hotspot
https://www.gadgetreview.com/how-to-connect-router-to-mobile-hotspot
Java Jive
2024-02-22 18:39:02 UTC
Permalink
Post by Patrick
Configuration for interface "eth0"
   DHCP enabled:                         No
   IP Address:                           192.168.1.123
   Subnet Prefix:                        192.168.1.0/24 (mask
255.255.255.0)
   Default Gateway:                      192.168.1.1
   Gateway Metric:                       1
   InterfaceMetric:                      35
   Statically Configured DNS Servers:    1.1.1.1
                                         8.8.8.8
   Register with which suffix:           Primary only
   Statically Configured WINS Servers:   None
That looks to me like a router's subnet configuration rather than that
of a hotspot.

Now repeat that for the laptop when it is connected via the hotspot, and
compare the two subnets ranges. If they're different, there's your problem.
--
Fake news kills!

I may be contacted via the contact address given on my website:
www.macfh.co.uk
Char Jackson
2024-03-02 18:36:28 UTC
Permalink
Post by Patrick
C:\Windows\system32>tracert 192.168.1.1
Tracing route to 192.168.1.1 over a maximum of 30 hops
1 1 ms 1 ms 1 ms 192.168.1.1
Trace complete.
Surprisingly, the PC doesn't even see the DD-WRT nor the AP as it only
sees the gateway in a single hop (interestingly so).
The DD-WRT device and the AP only have IP addresses (OSI Layer 3) for management
purposes. As you discovered, those IP addresses are not used for application
traffic, which passes through those devices at OSI Layer 2. Those devices don't
even need to have IP addresses that are part of your primary subnet. For
example, you could have a separate subnet for device management, as far as those
two devices are concerned.

Char Jackson
2024-03-02 18:29:58 UTC
Permalink
On Thu, 22 Feb 2024 16:04:56 +0000, Graham J <***@nowhere.co.uk> wrote:

<big snip>
Post by Graham J
At this stage you should be able to change the wireless parameters to
suit those required by the phone. The DD-WRT should then show it is
connected to the phone, possibly via a status page of some sort.
Now connect the laptop BY WIRE to the DD-WRT. What should happen is
that the laptop sends its DHCP request and receives replies from the
phone hotspot. The network parameters should look much the same as when
the laptop was connected directly to the phone hotspot earlier in this test.
You should then be able to browse the internet.
Now for the desktop PC. Connect this by wire to the DD-WRT. The PC is
statically configured to communicate with the DD-WRT, but the I expect
network address generated by the phone hotspot to be different.
It will be different. On my phone, the 3rd octet varies slightly each time but
is always in the range of 180-190, every time I've checked.
Post by Graham J
So
change the desktop PC to "Obtain an IP address automatically" and
"Obtain DNS server address automatically". It will now no longer
communicate with the management page in the DD-WRT but it should
communicate THROUGH the DD-WRT to the phone hotspot, and should be able
to browse the internet.
If connectivity to both (from the desktop PC) are ever desired, he could simply
configure a static IP address in each of the relevant subnets. Windows will
automatically use the correct IP address.

To configure multiple IP addresses on a Windows PC, simply go to the relevant
network adapter applet and configure a static IP as normal, then hit the
Advanced button and configure as many additional IPs as you need. I don't know
what the limit is, but I did 17 once, just because I was too lazy to spin up a
virtual router, plus I wanted to see if 16 was the limit.
Arno Welzel
2024-02-25 19:24:11 UTC
Permalink
Post by Patrick
Desktop PC to Android Mobile Hotspot - What do you use for the Gateway?
1. My Windows 10 desktop has no Wi-Fi card.
2. So I Ethernet out to an old router acting as a wireless client bridge.
3. This has been working for many years.
Depending on your Android device you may also use a USB data cable and
use that for network tethering for the PC - see "Tether by USB cable" here:

<https://support.google.com/pixelphone/answer/2812516?hl=en>
--
Arno Welzel
https://arnowelzel.de
Loading...