Desktop PC to Android Mobile Hotspot - What do you use for the Gateway?

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?
Reply to
Patrick
Loading thread data ...

[snip detail]

Let's look at each component of this in turn.

The router. Conventionally a router contains 4 systems: the network switch (so it has several Ethernet ports), the Wireless Access Point (connecting to the network switch), the router (providing DHCP, DNS, NAT services), and the WAN port (which could be Ethernet or a modem for ADSL/VDSL).

The client computer. If this has WiFi it is configured as a wireless client and only requires the SSID and key of the Wireless Access Point. It gets everything else it needs from the DHCP and DNS services in the router (provided the computer is set for "Auto"). If the client computer has only Ethernet then simply plug in the cable to the router.

The hotspot. This is a router and Wireless Access Point integrated into a mobile phone. A client only needs the SSID and key to connect to it - everything else is provided by the hotspot. When you configure the phone it will tell you the SSID/key that you will need. You could test this by using a WiFi-equipped laptop. You don't need to know anything about IP addresses. To make life easier, if you try this it would be sensible to shut down all other computers, routers, and wireless access points - this avoids confusion.

Your requirement is to use a conventional router as a wireless client. This depends on the router, so you will have to refer to its manual. In general terms, you must disable all the routing functions (DHCP, DNS, NAT, etc.) leaving only the network switch and its internal wireless system, which is reconfigured as a client rather than an access point.

Some routers have an option to achieve this: set the option and reboot. Reverting to router mode may require a factory reset so find out how to do this first. Once in wireless client mode you then have to reconfigure the connected computer to communicate with the reconfigured router. This might involve setting a static IP address in your computer. Once you have communication with the router it might find the hotspot and ask for the key, or you might have to set everything manually. Some routers will help you with this - they get you to configure the WiFi parameters first, then on reboot they come up properly configured. The router should then show you that it has a connection to the hotspot. The computer you use for this can only see the router (because of its static IP address). So to see the internet use another computer, or reconfigure the first as "auto". It will communicate through the wireless client (your reconfigured router) and get all the IP details (address, mask, gateway, DNS) from the hotspot.

Once a router is configured as a client, you can no longer use it as an access point. So the issue of same SSIDs does not arise. If you have other wireless clients (laptop, phone, tablet, etc.) these need to be reconfigured to talk directly to the hotspot.

Some routers can be configured to use their wireless component to implement their WAN port. In this case the router retains its DHCP, DNS, and NAT function. It's important that its LAN address is different from the LAN address of the hotspot (which you will know if you've tested the hotspot with a WiFi-enabled laptop or similar).

Hope this helps ...

Reply to
Graham J

I'm confused by the terminology. I would expect "wireless client" to be sufficient.

OK so what is the internet router it normally connects to? And what LAN IP address does it have?

To avoid confusion, power off this router while the internet is dead.

What LAN IP address does this laptop report when connected to the hotspot?

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]

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.

Once you have the wireless client connected to the hotspot, reconfigure your computer to "automatic IP addressing" then it will get its IP address, DNS, and Gateway information directly from the hotspot.

Reply to
Graham J

On most software, changing the SSID erases/reset the passphrase.

Read its log and find out.

...

Reply to
Carlos E.R.

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.

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

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.)

Reply to
Java Jive

Short answer: leave the desktop using DHCP and it'll Just Work??

Reply to
Andy Burns

Maybe your intervening router needs a DHCP helper?

Reply to
Andy Burns

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.

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.

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. 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.

I looked up the term "DHCP Helper" which is indeed a thing.

formatting link
"DHCP IP Helper addresses are IP addresses configured on a routed interface such as a VLAN Interface or a routers Ethernet interface that allows that specific device to act as a middle man which forwards BOOTP (Broadcast) DHCP request it receives on an interface to the DHCP server specified by the IP Helper address via unicast."

I guess I have to learn how to use "ip helpers" on DD-WRT.

formatting link

Reply to
Patrick

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.

formatting link

Reply to
Patrick

Strictly speaking, DD-WRT calls the setup I've been using for years a "Repeater Bridge", which means it's a bridge and it's also a repeater.

formatting link
Here's the scenario so you can visualize the setup.

  1. The Windows 10 desktop PC has no Wi-Fi card but it has Ethernet
  2. So, the desktop "thinks" it's using Ethernet all the time
  3. The desktop PC has a static IP address (for simplicity)
  4. Let's call that static IP address 192.168.1.4
  5. This is because it's the fourth item after the modem
  6. The 3rd item after the modem is the DD-WRT "Repeater Bridge"
  7. So let's assign that DD-WRT repeater bridge the address 192.168.1.3
  8. That DD-WRT repeater bridge connects on 2.4GHz to a 2.4GHZ AP
  9. So let's assign that 2.4GHz Ap the IP address 192.168.1.2
  10. It's a minor detail but the Ethernet out of that AP goes to a switch
  11. But a switch operates at the MAC address level so the IP passes through
  12. The switch is wired to the main router which is IP address 192.168.1.1

To summarize in fewer words, the "Internet" cat5 cable comes out of the modem to the 192.168.1.1 router whose cat5 cable goes to the switch whose cat5 cable goes into the access point at 192.168.1.2 which is wirelessly bridged to the DD-WRT "Repeater Bridge" at 192.168.1.3 whose cat5 cable goes into the Windows PC at 192.168.1.4.

As you seem to have understood, the DD-WRT could have been set up as what I think DD-WRT calls a "Station Bridge" but as shown in the link above, a "Station Bridge" is a bridge plus it allows the integrated switch to work on the router so that wired clients can attach to it (like the desktop PC).

But since the desktop is far away from everything else, I figured I'd set up the DD-WRT router to also act as a 2.4 GHz access point for nearby devices to connect to (either wired or wirelessly) - so it's actually set up as both a bridge and as a repeater (which really have nothing to do with each other). It's a repeater. And it's a bridge. Two different things.

  1. The DD-WRT repeater bridge connects to the access point wirelessly
  2. But also the DD-WRT repeater bridge allows Ethernet to connect to it
  3. And the DD-WRT repeater bridge allows wireless clients to connect too

It's really a good use of an old router if you need to have an access point & an Ethernet switch all in one when you're far away from the main router.

See above description, depicted below: Modem->Router->Switch->AP->Bridge->PC Internet->192.168.1.1->switch->192.168.1.2->192.168.1.3->192.168.1.4

Everything is wired via cat5 except the connection between the access point and the bridge is over 2.4GHz channels. For our purposes, we can ignore the switch as it's just a pass-through device, so the circuit simplifies to: Modem->Router->AP->Bridge->PC Internet->192.168.1.1->192.168.1.2->192.168.1.3->192.168.1.4

I don't know if I understand bridges well enough to say the next statement, but I think even the bridge is a pass-through device, so it simplifies further to something like this. Modem->Router->AP->PC Internet->192.168.1.1->192.168.1.2->192.168.1.4

But I'm not sure of that. If I trace the route from the PC through the bridge and access point and switch to the router, let me see what happens.

Well that was unexpected.

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.

The traceroute didn't see any of the intervening devices. Is that how it's supposed to work?

That's a good idea. Too late now. The Internet came back. :) So I'm back on the repeater bridge setup that has been working for years.

I think you hit the nail on the head. The laptop must be in a different subnet. Let's say the cellular company is on 1.2.3.4, then the laptop will likely be on 1.2.3.x which I think is probably what my problem was.

I guess the DD-WRT "Repeater Bridge" is on the wrong subnet because it's on

192.168.1.3 while the cellphone acting as a mobile hotspot is likely on 1.2.3.x - so they're completely different networks (I think).

There must be a way around this so I'll look up, for the future, how to connect a mobile hotspot to a DD-WRT repeater bridge.

I don't think the mobile hotspot passphrase matters at all as I originally set the mobile hotspot up without any security which worked for the laptop but the DD-WRT "Repeater Bridge" wanted an SSID and a passphrase so I set up the mobile hotspot with a passphrase to satisfy the DD-WRT demands.

I don't think it would have mattered what the SSID was either for the mobile hotspot but I made the SSID unique so there would be no confusion.

I think the problem is the subnet mismatch between the static IP address on the DD-WRT "Repeater Bridge" and the mobile hotspot IP address.

The Internet came back but for the future I need to look up the procedure.

formatting link

I think that's the problem which is the static IP address of the PC is on a different subnet than the phone's hotspot and also the static IP address of the DD-WRT repeater bridge is also on a different subnet than the hotspot.

I'm looking for a guide for setting up a DD-WRT router to a cellular hotspot where I think the fact it's currently set up as a repeater bridge is the problem. It should be set up differently.]

formatting link
So I think I've been looking at this all wrong.

I think I need to consider the DD-WRT device simply a dumb switch from the standpoint of the PC. What I have to do is have the DD-WRT device connect to the cellular hotspot - so I'm looking up a guide for how to do that.

I think my major mistake was keeping the DD-WRT setup as a repeater bridge. The DD-WRT setup probably needs to be set up as "something else" instead.

I think this is user error.

formatting link

Reply to
Patrick

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.

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?

OK so far. What is the IP address of the main router?

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.

Reply to
Graham J

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

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

formatting link

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.

formatting 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.

formatting link

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).

Yup. I'm sure it is. And that's part of the root of the problem I had.

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

formatting link

Reply to
Patrick

Yes, exactly. To spell it out in more detail ...

The Repeater-Bridge - BTW you said earlier up thread that it was a Client Bridge, which is a different possible configuration - doesn't care how the PC is configured, but, obviously, the PC does, because unless it is configured correctly, it won't interact with the network.

As I tried to explain in my last mail, the third number in the IP Address range being used by the two arrangements - the normal router and the mobile hotspot - is very likely to be different, I used x before, so let's call the two numbers x(r) and x(h) for the router and the hotspot respectively.

The subnet created by your main router will be in the range ... 192.168.x(r).0 to 192.168.x(r).255 ... with the router's IP address usually, but not certainly, being ... 192.168.x(r).1 Very often, but again not certainly, x(r) will be a low number, such as

0 or 1.

The subnet created by the mobile hotspot will be in the range ... 192.168.x(h).0 to 192.168.x(h).255 ... with the phone's IP address usually, but not certainly, being ... 192.168.x(h).1 Very often, x(h) will be a larger number, ISTR that mine is 47, but the actual value is relatively unimportant, as long as *ALL* devices on the network that are configured with a fixed IP are re-configured to use IP addresses in hotspot's subnet rather than the router's.

So now consider things from the PoV of the PC, or indeed any other device, if it has a fixed IP address. Almost certainly, it will still be in the router's subnet range and therefore of the form ... 192.168.x(r).y ... where y is some number between 1 & 255 and hopefully different from those of the IPs of the router or any other device on the network, whereas for the mobile hotspot it needs to have an IP of the form ... 192.168.x(h).y ... as otherwise it will sit there receiving only traffic in the subnet range of the hotspot, all of which it will simply & steadfastly ignore because it's configured to interact with a subnet range different from the all the traffic that it's seeing.

I suggest that before you do anything else, you log into the desktop PC, open a Command Prompt with Administrator rights, and run ... IPConfig /all ... and see which of the two subnet ranges the IP address range is in; if it's that of the router rather than the hotspot, there's your problem.

I don't think you need should need DNSMasq, or use special DNS settings, etc. Just get the basics right, as described above and in my previous post, and it should work: Configure the Repeater Bridge to have an IP in the hotspot's subnet; Configure the PC either to use DHCP to set its IP & DNS, or else configure it with a fixed IP in the hotspot's subnet.

Reply to
Java Jive

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.

Reply to
Java Jive

Patrick, 2024-02-21 06:31:

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:

formatting link
Reply to
Arno Welzel
<big snip>

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.

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.

Reply to
Char Jackson

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.

Reply to
Char Jackson

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.