Bypass Hotspot 5Mbps Speed limit and Maximize LTE Bandwidth (7x More Bandwidth) without a VPN

Zach Mitchell
5 min readMay 16, 2021

--

TLDR; Adjusting the TTL on my router from allowed me 7x more bandwidth on my network.

Example Speedtest
Just and example speedtest.net

Recently I had to revisit Internet access at a remote home using a 4G modem and Visible Cellular carrier (Verizon Reseller). I found that the bandwidth was being capped on the hotspot or tether to about 5mbs download and 5mbs upload. Last year it was 10mbs and that was not an issue. Visible does not have any data caps so it has been a good choice for basic internet access for ~$25 a month (on party pay, which there are open groups you can join to save $15 a month).

Hardware

  • Netgear 4G LTE Modem LB2120
  • Ubiquity Unifi Security Gateway — USG (router)

First I thought maybe maybe there was a new policy that was limiting the bandwidth, but after discussing that first on chat with the carrier they said it shouldn’t be that low. After about an hour on chat with them and seeing no improvement from the 5mbs download they re-provisioned my SIM which required me to take the SIM out of the 4G Modem and check it on my cellphone again.

A quick speedtest on my phone with the Visible SIM installed showed 34mbs down and 12mbs up. Not what i was getting with the Netgear Modem. So down the rabbit hole I went.

I then installed the SIM back into the Modem and started testing on on some devices to see what was causing it. Tried a hotspot from the phone to my laptop, ethernet tethering, and USB tethering. All received the same speed of 5mbs down, vs the what i know i could get on the phone directly.

After some effort with my Google Fu I discovered that on a single device if the TTL if increase above 64 it appears that the Carriers restrictions on hotspots or tethering is circumvented.

So here is how I tested it and implemented it at my router so no configuration is required on all devices on the WIFI.

Start by getting a baseline of the bandwidth by using speedtest.net or whatever you prefer. I used speedtest.net as there was a CLI tool for my raspberry pi.

Speed Test

pip3 install speedtest-cli

Next find a local speedtest server to target the same server for each test

speedtest-cli --list

Run a test

speedtest-cli --server XXXXXX

Output

root@Pi:~# speedtest-cli --server XXXXXX
Retrieving speedtest.net configuration...
Testing from Verizon Wireless (IPADRESS)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by XXXXXXX (XXXX, XX) [XXXXX km]: 111.001 ms
Testing download speed................................................................................
Download: 5.17 Mbit/s
Testing upload speed......................................................................................................
Upload: 4.83 Mbit/s

Adjust TTL

Initial test confirms the tether speed cap. I adjusted the TTL using the following. You can do this on Windows or MacOS as well using slightly different settings

Try playing with the TTL number 50–100 and see if there is one that has less ping and more bandwidth. 66 worked from me from some time but i had to adjust it to 67 recently

Linux (this will be reset on reboot) otherwise edit /etc/sysctl.conf and add it permanently there.

sysctl net.ipv4.ip_default_ttl=66

Windows open regedit.exe

Nagivate to HKEY_LOCAL_MACHINE \SYSTEM\CurrentControlSet\Services\Tcpip\Parameters.Add the following REG_DWORD32DefaultTTL set it to 66Restart the computer and check the result.

MacOS (this will be reset on reboot) otherwise edit /etc/sysctl.conf and add it permanently there.

sudo sysctl -w net.inet.ip.ttl=66

Run speedtest again

Retrieving speedtest.net configuration...
Testing from Verizon Wireless (XXXXXXXXXX)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by XXXXXXX (XXXX, XX) [XXXXX km]: 108.831 ms
Testing download speed................................................................................
Download: 34.71 Mbit/s
Testing upload speed......................................................................................................
Upload: 10.35 Mbit/s

Yay it worked. A quick google search show that the maximum 4G speed on Verizon bands is 50Mbps. I tested a few different values in the TTL from 60–128 and the ping and speeds changed with each, the best i could find was 66. It was recommended to be change to 65 online but my speeds didn’t change from my original test.

Router configuration

Now let’s implement it at the network level so all devices on the network get the change. There are some directions on the internet on how to do with with DD-WRT and other Routers.

SSH into the Unifi Security Gateway and apply the following iptable rule and test from a device again (that hasn’t had the TTL manually been adjusted). Original instructions found here.

sudo iptables -I POSTROUTING -t mangle -o eth0 -j TTL --ttl-set 66

Next lets create a cronjob to apply this setting to the USG

sudo vi /config/scripts/ttlcheck.sh

Insert the following

#!/bin/bash
if ! /sbin/iptables -C POSTROUTING -t mangle -o eth0 -j TTL --ttl-set 66; then
/sbin/iptables -I POSTROUTING -t mangle -o eth0 -j TTL --ttl-set 66
fi

Make it executable

sudo chmod +x /config/scripts/ttlcheck.sh

Add the cronjob on the USG using the following commands in order

configureset system task-scheduler task ttlcheck executable path /config/scripts/ttlcheck.shset system task-scheduler task ttlcheck interval 1mcommitsave

That should do it. I removed all the manually configured TTL’s from my devices and they are all now able to get the full bandwidth.

I found that based on where my LTE’s hub was sometimes it would route me to somewhere else in the country so i improvised this script to set TTL based on the nearest state.

#!/bin/bashSPEEDTEST=/config/scripts/speedtest.py# Get speedtest.py
if [ ! -f $SPEEDTEST ]; then
curl -o $SPEEDTEST https://raw.githubusercontent.com/sivel/speedtest-cli/mas
chmod +x $SPEEDTEST
fi
# Set TTL based on speedtest nearby servers
# Set TTL based on speedtest nearby servers
if [ ! -f /tmp/.ttlset ] && [ `/sbin/iptables -L -n -t mangle` -eq 0 ]; then
NEAR=`$SPEEDTEST --list | head -2 | tail -1`
if [[ "$NEAR" == *" KS, "* ]]; then
/sbin/iptables -I POSTROUTING -t mangle -o eth0 -j TTL --ttl-set 84
elif [[ "$NEAR" == *" NY, "* ]] || [[ "$NEAR" == *" NJ, "* ]]; then
/sbin/iptables -I POSTROUTING -t mangle -o eth0 -j TTL --ttl-set 112
else
/sbin/iptables -I POSTROUTING -t mangle -o eth0 -j TTL --ttl-set 84
fi
touch /tmp/.ttlset
fi

--

--

Responses (1)