blog
LTE emergency link
In a few weeks, I may finally be able to switch from a slow DSL internet connection to a fiber-optic connection. Since we're in Germany, and the whole thing has already taken up more than two years now – yes, that's not a typo – it’s finally time to prepare for the migration. The last time I got into a similar situation was when a relative of mine had to upgrade their Telekom Magenta TV setup (which delivers TV via internet). The result was a complete breakdown of the entire Internet/Phone/TV service for over three weeks. Since I'm planning to change not only technologies, but also providers, I've decided that I definitely want some kind of fallback.
The plan was to set up a connection that uses a different medium than the one I'm currently using – copper DSL – and the one I'm switching to – the fiber connection. That leaves TV cable and mobile data. In the end I settled for a LTE connection.
Since I wanted not only to create a fallback for a single machine, but for the entire network at home, the plan was to have a Raspberry Pi 3 B+ acting as a central router. Looking around, there were several USB dongles which appeared to be working out of the box with Linux, and I went for a ZTE MF833U1, along with a cheap SIM card providing a small amount of data per month at minimal cost, but with an option to buy various data packages when they're actually required, which should allow me to use the backup connection for several days without major restrictions if the primary connection goes down.
After plugging the SIM into the dongle and the dongle into the Pi's
USB port, lsusb showed the following new line:
Bus 001 Device 005: ID 19d2:1706 ZTE WCDMA Technologies MSM DEMO Mobile Boardband
This wasn't the kind of usb device id I've expected to get after reading
several pages about the MF833 setup (especially the term “Boardband”).
Furthermore, ip -br a
surprisingly
had the following new entry:
eth1 UP 192.168.0.178/24 fe80::45bc:d61a:fd7e:fdf9/64
So, instead of having to fiddle around with usb_modeswitch
or other usb-related tools, I already had a new ip link set up. Even
more interesting were the contents of the routing table:
default via 172.16.0.1 dev eth0 proto static metric 100 default via 192.168.0.1 dev eth1 proto dhcp src 192.168.0.178 metric 101
The system had already added a new default route for the ZTE dongle –
thankfully it was using a metric value of 101, which means that by
default the route having the lowest metric, in this case the old
default route pointing to the DSL router at 172.16.0.1,
is still used. There is a tool named
ifmetric
which can be used to change a route's metric directly, and indeed,
an ifmetric eth0 102,
which causes the ZTE route to become the preferred default route,
directly results in the system using the LTE
route as the default route. Reverting the metric using
ifmetric eth0 100 re-enables the DSL default route.
For the moment, this is already all that I need for dial-out purposes: I'll simply keep the current setup so that I just have to add the ONT – “Optical Network Terminal”, aka fiber-optic “modem” – as the second default route. Since both internet uplinks are connected to the same device, and since I can simply select the active connections using metric changes, there's even no need for IP failovers or similar technical measures.
Over the next weekend I'll have to implement some way for dialing in from outside.