
Building an LTE Access Point with a Raspberry Pi - kingsomething
https://snikt.net/blog/2019/06/22/building-an-lte-access-point-with-a-raspberry-pi/
======
tjohns
Not mentioned in the article, but I'd also recommend force-setting DHCP Option
43 to "ANDROID_METERED" to let Android clients know you're on a metered
connection (hotspot) instead of a normal landline-based WiFi network. [1] This
inhibits some things like automatic updates.

I don't know of an equivalent for other OSes, unfortunately.

[1]: [https://www.lorier.net/docs/android-
metered.html](https://www.lorier.net/docs/android-metered.html)

~~~
voltagex_
[https://apple.stackexchange.com/questions/199163/how-does-
io...](https://apple.stackexchange.com/questions/199163/how-does-ios-and-os-x-
detect-when-a-wi-fi-network-is-a-personal-hotspot) seems to think it's in the
wifi beacon itself for OS X.

No detection method appears to be present in Windows 10, it's all geared
towards LTE modems integrated in the machine.

I really wish this had been standardised.

~~~
p_l
Windows 10 appears to support one of the newer standards for announcing su h
details in beacon

~~~
voltagex_
"Microsoft has defined a vendor extension to the 802.11 protocol."

[https://docs.microsoft.com/en-us/windows-
hardware/drivers/mo...](https://docs.microsoft.com/en-us/windows-
hardware/drivers/mobilebroadband/network-cost-information-element)

~~~
p_l
It also supports at the very least WiFi Alliance's Passpoint, based on
802.11u.

------
Spivak
I don't with to diminish the author's work but there's nothing all that
special about the LTE portion. From the perspective of the Pi it's just
another interface/network.

This is more akin to building a basic consumer all-in-one router -- which I
think actually sounds cooler.

So the pieces that this article puts together:

* Bridging the Pi's ethernet and wireless interface and setting up DHCP pointing to a forwarding DNS server on the bridge with dnsmasq.

* Setting up Linux IP forwarding and the iptables rules needed to perform NAT over the WAN.

* Setting up a wireless access point on the Pi with hostapd.

It really is super cool that for $35 and an hour you can have a functioning,
albeit not super fast, router that's basically ready to be plugged into a
modem and work.

~~~
KirinDave
Yeah, I did this myself not long ago as part of a mobile office rig and ... I
didn't write about it or share about it becuase it was mostly just putting USB
male connectors into USB female connectors and sourcing the right kind of
batteries to charge things.

Oh, and learning ethernet cables are a monstrous power draw and you're much
better off using wifi for everything.

I mean, yeah it's cool to have. But I can't help but feel like it's a bit
trivial.

~~~
voltagex_
Can you comment on Ethernet being more power hungry than Wifi? That's the
first time I've heard that.

~~~
eigenloss
Ethernet usually requires isolation magnetics and transformers, while WiFi is
basically just a wire sticking out of an RFIC.

~~~
pjc50
It's not so much that the transformers consume more power than just radiating
it into the air, but that Ethernet is not designed with power efficiency as a
goal. Ethernet devices that need more power usually get it from PoE instead.

Without doing any analysis at all, I suspect the idle behaviour is a big
difference; Wifi goes silent if there's no traffic, apart from AP beacons, but
Ethernet continuously transmits "fast link pulses" every 16 miliseconds to
maintain autonegotiation and detect connection lost.

~~~
KirinDave
Honestly I dunno why it was the case for me. What I know is that I thought I'd
save power pushing pulses over copper rather than using a radio. I didn't. In
fact it was consistently about 40% worse than wifi.

That might be unique to the RPi hardware I used. It might not.

Maybe I should have written that article. :)

~~~
londons_explore
The Pi does Ethernet with a seperate and pretty power hungry chip.

If the ethernet cable is disconnected, that chip mostly powers down.

I think it's a Pi related thing rather than being inherent to Ethernet. In
fact, if I were to guess, the energy per bit per meter of ethernet is probably
far far lower than WiFi.

------
penumbra_3
Title is missleading, i was hoping for
[https://bellard.org/lte/](https://bellard.org/lte/) :(

~~~
keithnz
yeah, likewise, I suddenly noticed it was just an access point, which seems a
bit trivial to be hitting the #1 spot on HN.

But I might be bias, I'd really ike a CAT-M1 and NB-IOT base station

------
josho
I had hoped this was a howto for building an LTE booster.

I know the spectrum isn’t licensed for us, but wouldn’t it be great if someone
figures out how to build a booster for those of us with a weak signal.

~~~
tsomctl
[https://duckduckgo.com/?q=wilson+lte+booster&atb=v173-2_j&ia...](https://duckduckgo.com/?q=wilson+lte+booster&atb=v173-2_j&ia=web)

------
dehrmann
I did something similar with OpenWRT and a MikroTik box. It works fine. The
interesting bits were getting OpenWRT to work on a then-unsupported device (it
was very similar to other devices, though), picking a modem with good support
for multiple US carriers, depending on the modem, disabling USB3 by taping
over those pins, flashing carrier-specific firmware, and getting the modem to
connect.

Then I went overboard and set up routing so bulk traffic (OS updates, backups)
go over a slower DSL connection, while other traffic goes over LTE. And if LTE
goes down, it switches to the DSL connection.

~~~
tau255
Your comment motivated me to check if I could make my home router fallback to
my second connection (I flashed it with OpenWRT). After fiddling with using
usb wifi dongle as second wan entry and looking over if any nearby electronic
shop has usb lan adapters in stock, I discovered that my router has vlans and
I can "rob" one switch port for second wan.

So I set up mwan3 and have more and more respect for what one can do with
Openwrt and off-the-shelf router.

------
mschuster91
As for the Huawei stick, most of them support being switched to modem mode
using usb-modeswitch. But I'd prefer the "virtual network interface" mode if I
had the choice, usb-modeswitch and modem stuff isn't exactly the best
documented thing on this planet.

~~~
lucb1e
What's the difference? From the sound of it, the VNI would be a USB device
identifying itself as an ethernet adapter and usb-modeswitch does... mode
switching, like the 'alternative protocol' thingy that USB3 can do?

~~~
mschuster91
The difference is that in VNI mode the stick runs its own OS including a
router and other crap while in modem mode it directly passes through the modem
to the host device, leading to better performance, working "server"
connectivity (assuming you can get a publically routed IPv4 address from your
provider, though) and less security issues as there is one stack less to worry
about.

~~~
lucb1e
Ah, now I understand, thanks!

------
ryanmarsh
Read it hoping to find use of an SDR or direct use of LTE modem instead it’s
basically what any Linux user would have to do to get a USB modem working.

For some reason doing anything a normal Linux user would do but on a raspberry
pi is instant clickbait.

------
surge
I have a iNet Slate, its effectively the same thing but a bit more purpose
built and has a switch on the outside (which can be configured to do different
things) that can turn on VPN so all connections are VPN'ed. It supports USB
tethering and a USB modem. For the money, after you're done buying a case,
you'd still need more ethernet ports, it probably doesn't work when borrowing
local wifi.

[https://www.gl-inet.com/products/gl-ar750s/](https://www.gl-
inet.com/products/gl-ar750s/)

------
ars
So how does it work? I assume the LTE USB modem operates on T-Mobile
frequencies, so does that mean it accepts all T-Mobile customers?

How's authentication done? How does T-Mobile permit you to use their
frequencies?

~~~
q3k
This is not about hosting an LTE 'access point'. It's about creating a access
point which uses an LTE uplink. I agree, the title is somewhat misleading.

~~~
kevml
Correct. If you were to create an actual “access point” you will have the FCC
and other agencies knocking on your door within minutes.

~~~
mindslight
I don't think their response time would be nearly that quick. All the stories
about Stingrays would imply that this actually isn't very well policed (FCC
enforcement is reactionary. The carriers could be proactive, but then would
discover the Stingrays. And if carriers were complicit with Stingrays, then
Stingrays themselves wouldn't be necessary).

I would also think the widespread deployment of legit femtocells would provide
a decent cover.

But yes, it is generally illegal. (Though this hasn't stopped OpenBTS from
being developed)

~~~
kevml
Yes, we had the FCC (via FBI) knocking on our door within 30 minutes. This was
about 10 years ago when we were doing research with an access point.

~~~
mindslight
Sheesh! Do you care to share any more details? How dense of an area? How was
it detected? If by "access point" you mean 2.4GHz, what was the actual
problem?

~~~
kevml
It was a GSM antenna that registered with I think AT&Ts network in
Philadelphia. It was part of a legitimate research project, so no charges or
fines were placed on us.

~~~
mindslight
Your description just makes me more curious! What do you mean by "GSM antenna"
?!

Should I really read that as you had a legitimate cell radio device, and just
attached an unauthorized antenna? Or was the radio itself
experimental/unapproved?

------
pcl
The author mentions power consumption issues in the post. I've seen the same
when running RPi access points. Definitely use a decent power brick if you're
going this route.

------
the_mitsuhiko
I would be more interested if someone managed to build a GRE tunnel bonding
solution with open source tools. Multiplexing a data stream over multiple LTE
uplinks would be nice.

~~~
tiernano
Holy grail stuff there. Would love that too.

------
pbhjpbhj
Nice clear instructions and presentation style, well done.

~~~
m_rn
I'm with you, it is a nice presentation and will follow it. Yanno' if you
could get the ARM version of pfSense on the pi this would eliminate the Huawei
modem, Maybe.

------
loose11
You should checkout EspressoBin, which should be more suitable for this task.
Hardware-Switch, WAN-Port and so on

~~~
dvfjsdhgfv
It has horrible reviews (booting by itself etc.). Any better alternative?

~~~
dehrmann
I've had decent luck with this:
[https://mikrotik.com/product/RBwAPR-2nD](https://mikrotik.com/product/RBwAPR-2nD)

~~~
alexeldeib
+1 for Microtik. They have their weird problems but are cheap and generally
fairly reliable for what you get. Have a bunch of their hardware around, all
served me pretty well.

------
sdrothrock
Is there no need to do additional handling for hung modems/connections and
safe reboots, or is all of that left as an exercise for the reader?

~~~
KirinDave
Usually you can just do this from the command line. With the right tuning Pi's
boot quite fast, so I just used a Pi reboot and a 4g gateway with no battery
to solve these issues.

~~~
sdrothrock
To me, the resilience in having that stuff automated is the difference between
"an access point" and "a computer that just happens to bridge connections."

~~~
KirinDave
True. I just didn't find that stuff very difficult. It almost never came up.

