☕ Blog of Stephan Höhn

How I Built a Self-Made LTE Router for Cheap

  ·   8 min read

Introduction

To connect my home network to the internet, I currently rely on an LTE connection. For this, I use an Alcatel HH40V router paired with a Freenet Internet plan, which theoretically provides download speeds of up to 100 Mbps and upload speeds of up to 40 Mbps. The reason I’m still using a mobile network connection for my home is that it was the only option available in my previous apartment, and I’ve continued to use it in my current residence.

Old LTE Router

Unfortunately, the Alcatel router has several significant drawbacks. Its configuration options are very limited, and it no longer receives software updates. As a result, the built-in modem has several security vulnerabilities, such as hardcoded SSH passwords and an exploitable dnsmasq component (see https://github.com/froonix/HH40V).

Additionally, I’d like to have the ability to automatically adjust DNS settings for my DHCP clients, but this isn’t supported. Also currently I only get speeds of around 30–40 Mbps over the Router.

When looking into alternatives, I found that LTE routers supporting at least LTE CAT 6 typically start at prices between 100 and 150 euros. While this is reasonable, most of the available models have failed to fully convince me, mainly due to what appears to be poor update policies for LTE routers, unless they are flagship models from brands like AVM or MikroTik.

Inspired by Wolfgang’s YouTube channel, where he demonstrated how to build a DIY router, I realized that creating my own LTE router could be a possible solution!

Requirements

Hardware

I knew that some business laptops do have built-in LTE modems, so it should be in general possible, to install them like Wifi cards. For my setup, I also need a Mini PC that can accommodate these modules and allow for the installation of LTE antennas.

So i need:

  • LTE Module (at least CAT 6 with Carrier Aggregation Support)
  • LTE Antennas
  • SIM Card Adapter
  • x86 Mini PC

Mini PC

After researching various options, I was searching Mini PCs that include a Mini PCIe or M.2 slot and are relatively affordable. One promising option is the Fujitsu Futro S520, which i bought used from an online reseller for around 12,99€. It features a compact form factor, includes a free Mini PCIe slot, and comes with a soldered 4GB eMMC chip, eliminating the need for an additional storage drive. This specifically one came also with 4GB of RAM, the AMD GX-212ZC should also be capable of handling some router workloads. By the data sheet, the device is also just consuming around 6 watts!

LTE Modem

I did some research on LTE modules and discovered that Sierra Wireless modems offer kinda strong Linux support. Specifically, I came across a GitHub repository from danielewood (kudos for that!) containing useful information about certain Sierra Wireless LTE modems, including guidance on how to use and flash them. As a result, I decided to purchase a used Sierra Wireless EM7455 from eBay for about 10 Euros and go with the flashing instructions on the GitHub repo.

Adapter and antennas

The LTE modem I’m using comes in an M.2 form factor, while my mini PC is equipped with a Mini PCIe socket. To make the connection work, I also needed a way to attach the SIM card to the LTE modem. To address this, I ordered an NGFF-to-Mini-PCIe adapter that includes a SIM card slot. In addition to that, i also orderer some antennas.

Unfortunately, the first adapter I purchased didn’t work as expected. After some troubleshooting, I decided to buy another adapter with a different design, which resolved the issue. Also ive managed to buy the wrong antenna adapter. M.2 form factor wifi and lte chips do use the MHF4 adapter, but i bought firstly UFL1 adapter (see Wikipedia article).

Software

There are several free router software options available on the market, such as pfSense, OPNsense, VyOS, and OpenWrt. For now, I’ve decided to stick with OpenWrt. Its configuration process appears straightforward, thanks to the graphical web interface, and the user documentation for adding LTE modems seemed more “convenient”.

Initialize Thin-Client and Modem

To install OpenWrt, ive followed the OpenWrt on x86 hardware on the wiki. For the default packages i also used the installation instruction from TekLager. Ive booted up Ubuntu as live disk via an Ventor stick, unpacked the OpenWrt image and flashed it via dd onto the internal 4GB flash storage.

As metioned previously in LTE Modem section, the repository also contains good instructions and an script, to reflash the modem with generic firmware and also enables the Mobile Broadband Interface Model (MBIM). For reflashing, ive also booted into an Lubuntu live disk, downloaded and ran the automatic script from the repo.

At first run, the download of the Sierra Wireless firmware did not work, so ive had to make some adjustments in the script. Ive downloaded the firmware manually and hardcoded it into the bash script.

After rebooting again (and using the second adapter from aliexpress) i could connect to the internet over the Lubuntu live disk!

Detail of the changed bash script

The first assemble of the parts

Screw holes

As the Fujitsu Futro S520 does not have any bulkhead SMA connectors, i’ve decided to drill two holes and insert two SMA connectors for the LTE modem. To keep it simple, ive put some tape onto the position where i want the holes, pressed the end of the SMA connector onto the tape to have an roughly estimation which drill i need to use and drilled two holes.

Taping and imprinting
Holes drilled

Using OpenWrt

After booting into OpenWrt, i found out that the modem was not loaded by the kernel. So i had to install the kmod-usb-net-sierrawireless as kernel module.

After restarting again, ive installed ModemManager and the Luci addon luci-proto-modemmanger by the instruction on the OpenWrt wiki. Then i could setup my LTE Modem under Network -> Interfaces by clicking on Add new interface... and choosing ModemManager as protocol.

After that, a new mobile wan decide should show up. By clicking on Edit, i can assign the LTE Modem under Modem device and inserting my credentials of the SIM card (which you can find easily at the Providers Help Page).

ModemManager configuration over Luci

Also i had to assign both interfaces to the preconfigured firewall zones. By default, OpenWrt is configured to block WAN access from outside sources, so i only needed to assign the correct zones to the correct interfaces. In this case, ive assigned the wan-Zone to my wwan interface, the lan zone to my bridge interface in the Firewall Settings tab of each interface.

Working interfaces

Finally, i had a working connection when i connected my pc to the ethernet output of the thin client!

ModemManager “code” adjustments

After using my new router for 1-2 days, i found out, that for some reason at around 6PM, the connection to the internet was lost. Seems like o2 does an disconnect at my place at this time. After searching for this issue, i found one open GitHub issue with the exact same disconnect message from my logs. A solution for this issue, was solved in this pull request, by reconnecting the interface, when a disconnect is connected.

As the code change was only merged to the master branch of the openwrt packages, but not added to the current stable release (to the time of the writing 23.05.5), i’ve adjusted the bashscript on my router as it was done on the master branch. Ive replaced following lines at /usr/lib/ModemManager/connection.d/10-report-down:

logger -t "modemmanager" "interface ${CFG} (network device ${INTERFACE}) ${STATE}"
proto_init_update $INTERFACE 0
proto_send_update $CFG

with

IFUP=$(ifstatus "${CFG}" | jsonfilter -e "@.up")

[ "${IFUP}" = "true" ] && {
        mm_log "info" "Reconnecting '${CFG}' on '${STATE}' event"
        ubus call network.interface down "{ 'interface': '${CFG}'}"
        ubus call network.interface up "{ 'interface': '${CFG}'}"
}

After this change, when another disconnect happend, ModemManager was now able to reconnect again without noticeable internet loss.

Conclusion

This project was both an interesting and rewarding experience. Along the way, I gained a deeper understanding of LTE modems and network connections, which turned out to be much easier to grasp than I initially expected.

By the end of the process, I had successfully set up a solution that resolved potential issues with routers lacking ongoing support. With the ability to reflash firmware, installing additional packages and sufficient CPU and memory resources, this setup proved to be a good option.

Load of the 2 hours

In terms of speed, depending of the usage of our cell tower, i get speeds between 30-70 mbits. I guess, there is also more possible, by positioning the antennas directly to the cell tower.

In terms of costs, everything would also be within reasonable limits:

  • Fujutsu Futro S520: 12,99€ + 5,49€ shipping
  • Sierra Wireless EM7455: 9,90€
  • M.2 to Mini-PCI-E Adapter: 8,69€ + 4,21€
  • 2x MHF4 to RP-SMA Pigtail Antennas: 3,09€ + 1,99€ shipping

Total: 46.36€

Router at its current place

The only thing i should have thought about differently was the position of the holes for the antennas. unfortunately, they are a bit too close together, so i can only set them up either parallel to each other or orthogonal to each other 😁.