Hacker News new | past | comments | ask | show | jobs | submit login
OpenWrt: Smartphone USB Tethering (openwrt.org)
99 points by tosh on Nov 26, 2023 | hide | past | favorite | 28 comments



The first time I used USB tethering on a generic Android many years ago I was very pleasantly surprised how simple and straightforward it was. IMHO making it effectively become a generic USB Ethernet adapter (RNDIS) was a great idea as drivers for that are widely available.

...but of course the "security" BS has been used as an excuse to try to put an end to that recently.


I've done this many times. So many that I set up the hypervisor (fanless CompuLab PC) to bridge the WAN Ethernet, and all of the possible USB modems (multiple smart phones, and hotspots) on one interface which the OpenWRT VM uses as WAN. With it set up like this, I can simply plug in the correct device and then reboot. No configuration changes required. Over the years I did need to do some minor tweaks to get IPv6 working properly in all configurations, but it's been solid.

Note that doing it this way doesn't require most of the steps in the parent article document. The hypervisor recognizes the network hardware, assigns it to the bridge, and KVM/virt-manager assigns the bridge to the OpenWrt VM as a virtio network device. OpenWRT sees a plain vanilla virtio Ethernet device so it doesn't need any special drivers or configuration.


Beryl AX travel router is my this years best purchase.

USB tethering works really well with my iPhone.

https://www.gl-inet.com/products/gl-mt3000/


Heads up to anyone looking at Gl-inet's stuff: their Mediatek routers are good due to solid mainline kernel support. The Qualcomm stuff isn't nearly as good.


I have the mango router, it's a little older but very capable and it's got me out of a tight spot a number of times. Like when we've moved house but don't have an internet connection installed yet, just plug in a phone or 4G dongle and away you go.

Before that I had a little TP-Link portable router (MR3020?) that I'd flashed with ROOter - https://www.ofmodemsandmen.com/

I wanted to mention it because it's been a great plug-and-play openwrt derivative option with support for a lot of devices.


Another super interesting open source project without a screenshot to be found


How do you use this in practice?

Do you plug your phone in via USB-C and then use the WIFI off of that instead of the hotspot on your device?

Or do you go to hotels and use this to connect to their wifi and then use your own AP?


I have a cheapo Android phone I had laying around, used developer mode to make it always select tether instead of mass storage and I've got a (prepaid) data SIM in there.

When we travel the Beryl AX is our own hotspot, all devices can connect to its network. Then I just pick the best way to get the Beryl to the internet. Sometimes it's wired, sometimes it's connected to a WiFi, sometimes I need to plug in the phone and we use that.

And the best thing is that it can do failover, so I can have the hotel WiFi as the primary connection, but it'll fall back to the 4G phone connection if something goes wrong.


I used mine with the same SSID as my home network!

So when I travel I can either tether a phone and all the family devices just connect, or bridge it to the destination network and again let all the devices connect as if at home!


So could you explain the process by which you ‘tether a phone’? Is that don’t by plugging the phone in via usb? Is it paired via Bluetooth? Do you wifi the phone to it and spread the internet like that? I think some of us are quite curious about the specifics on that point :)

Sounds great!

P.s. I love (and am horrified) at how easy it is to ‘hijack’ a devices wifi just by making a network with the same name (and no password). I’ve done it myself over the years to make it easier for family or friends while travelling. But I always felt a bit ick about it working.


Hi,

I tether via a cable.

Because it's my work (Dev/Tech/Nerd) I have multiple phones with SIM cards.

So I physically tether a phone to the device.

I don't believe the device OP linked can a bridged WiFi network as such.

You can do a similar thing with a Mac:

Plug in your iPhone via a cable, then share the iPhone's tethered data connection over the Macs WiFi or ethernet port.

It's actually a good way to get around restrictions on some mobile SIM plans that don't allow them to be used as Data SIMs!


It shouldn't work if the security setup is different; if the home network is WPA2 then another open network with the same SSID should be ignored.


I have small case with this router, ethernet cable and usb cable for phone.

So it really depends where I am, so I can choose between USB, ethernet or wifi.

But I think most use for me have been USB tethering in my home country (unlimited mobile data).

I just like how router does adblocking (Adguard Home DNS) and VPN with wireguard/tailscale.


I have the previous gen, and it's still really good for use in hotels. But... I have been thinking of upgrading. :)


Yup! It's great! I've bought it this summer going to Europe and it's lovely!


I have one of these too. One of the best purchases I've made.


I do something like this, but I use a different method.

I simply use mwan3 with a separate USB-WiFi adapter exclusively for this use. That way, my main WiFi radios are not negatively affected when I activate the hotspot.

I already have my phone configured as a hotspot for when I travel, and I was already using mwan3 on my router already, so setting it up this way was easy and just made sense.

mwan3 is configured to use the regular wired connection whenever possible, but if it goes down, then it switches over to the hotspot radio. Both conditions must be met: Hotspot is on, and main internet is down. If my internet is down, all I have to do is press a button of two on my phone to turn on the hotspot and everything else happens automatically.

Another advantage of having a separate and different WAN interface is that I have ACLs on this interface which prohibit certain high-intensity types of traffic that I don't want transiting the hotspot.

I just have to remember to put a fan on the phone when I do this. It gets hot.


> has better performance (lower latency) than turning your smartphone into an access point and using that

Generally I've had good performance running an access point on my phone, this is the first time I've heard otherwise. I'd be interested in benchmarks if anyone knows of some?


On my iPhone I get about 70 Mbps tethering using Wi-Fi, 250 Mbps tethering using USB-C, vs about 400 Mbps running the speedtest on the phone itself.


A simpler setup (if it's supported, I have a USB-C one but haven't tried) would be to use an USB-to-go Ethernet adapter and share the phone's internet connection via a router's WAN port. Then any regular hardware router or OpenWrt could be used in a normal way.


I'm doing that right now. It works, but tethering limits are definitely enforced.


Have you tried modifying the TTL on the router? I can't give you all the information but it's a place to look. I believe dropping it by one is what's needed. I've used a Belkin router flashed with padavan firmware and it has an option to adjust TTL, just a checkbox, but it seems to enable unthrottled unlimited tethering as far as I can tell.


I believe you should add one, not subtract. E. g. if TTL on the phone is set to 64, you'll want router to send packets with TTL 65, so that one extra hop (from router to phone) brings it down to 64 and the carrier can't tell the difference.


Ah, makes sense!


Is there a way to determine if a phone supports this without just going ahead and trying it? I'd rather not spend the money if it won't work =)


In my case, I already had a USB-C hub/ports/adapter with Ethernet for my laptop as well as many routers around the house. You can also check phone specs for USB OTG (On-the-go, operating in host rather than device mode).


A lot of 4G modems connected via pcie still are USB interfaces internally. So the usb 2.0 limits on these are still there (though that is not much of a problem in general as 4G speeds are low). With 5G if you connect to a usb3 port for tethering I wonder if the speeds are above the usb2 limits or if this driver is still limited to usb2. Because with 5G modems, most of the devices that use it as a backup likely use pcie speeds. Would be a waste to use usb2 speeds


It recommends RDNIS still. Last I heard that was being disabled on Linux soon.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: