Skip to content

Remove speed restrictions on your hotspot internet (iOS, iPadOS, Android, Quectel), and allows hotspots on any plan (rooted Android & Quectel only).

License

Notifications You must be signed in to change notification settings

fawyrad/unlimited-hotspot

Repository files navigation

About

Compared to PDANet, FoxFi, NetShare, EasyTether, Wi-Fi Tether Router, and sshuttle tunneling:

On Android
  1. + Fully open-source and free of charge.

  2. + More reliable and has higher internet speeds.

  3. + Within reason, grants you unlimited data. This depends on the telecom and your plan.

  4. + Bypasses limited video quality on YouTube or other streaming services, and other DPI firewall rules.

  5. - Only works on "bootloader unlocked" Android devices.

    • A bootloader unlocked Google Pixel 4A (5G) can be had for ~$80 USD, and has very fast mobile data. Buy a Pixel 6 instead if ~$210 USD is still reasonable to you.

ℹ️
iOS and iPadOS are TODO; I am currently trying out some ideas I have to successfully pull it off, and all without jailbreaking.
I doubt it’ll be as fast as the methods used on Android, but the slowdown should be minimal.
On iOS and iPadOS
  1. + Fully open-source and free of charge.

  2. + Within reason, grants you unlimited data. This depends on the telecom and your plan.

  3. + Bypasses limited video quality on YouTube or other streaming services, and other DPI firewall rules.

1. Preparation

Android
🔥
Some OSes block Android snitching by default, such as GrapheneOS. If so, please skip to section 3; do not unlock your bootloader, and do not install Magisk.
  1. Unlock the bootloader if you haven’t already.

  2. Install Magisk; read "Getting Started", then "Patching Images".

  3. On the hotspot/tethering device, install NetMonster for its network monitoring. Without NetMonster, you are blind to what bands are used, and their signal strength.

== 2. Fully blocking Android snitching to your telecom . Download our Unlimited Hotspot Magisk module. . Open Magisk → Modules → Install from storage → Select the "unlimited-hotspot-v6.zip" that was downloaded. . Reboot.

iOS and iPadOS
  1. Open the Terminal, and run: brew install wireguard-tools .

3. Moving past a DPI firewall’s throttle triggers

macOS
ℹ️
Tested on Ventura 13.5.2.
  1. Open Unlimited Hotspot’s "macOS" folder in Finder.

  2. Open Terminal.

  3. Type sudo -i, enter your login password, then press Enter.

  4. Type cp then drag the set-ios-tcp-stack.sh file in, press Space, type in /var/root and press Enter.

  5. Type cp then drag the com.felikcat.set.ttl.plist file in, press Space, type in /Library/LaunchDaemons and then press Enter.

  6. chmod +x /var/root/set-ios-tcp-stack.sh

  7. launchctl load -w /Library/LaunchDaemons/com.felikcat.set.ttl.plist.

Now we need to add three Packet Filter rules and enable PF.
  1. nano /etc/pf.conf

  2. Add the following three lines before nat-anchor:
    pf rules

  3. pfctl -f /etc/pf.conf then pfctl -e.


Routers

If the hotspot device is plugged into a router, likely through USB, additional steps are required:

Asuswrt-Merlin
  1. Advanced Settings - WAN → disable Extend the TTL value and Spoof LAN TTL value.

  2. Advanced Settings - Administration

    • Enable JFFS custom scripts and configs → "Yes"

    • Enable SSH → "LAN only"

  3. Replace the LAN IP and login name if needed: $ ssh 192.168.50.1 -l asus

    • Use other SSH clients if preferred, such as MobaXterm or Termius.

  4. # nano /jffs/scripts/wan-event

#!/bin/sh
# shellcheck disable=SC2068
Say() {
  printf '%s%s' "$$" "$@" | logger -st "($(basename "$0"))"
}
WAN_IF=$1
WAN_STATE=$2

# Call appropriate script based on script_type
SERVICE_SCRIPT_NAME="wan${WAN_IF}-${WAN_STATE}"
SERVICE_SCRIPT_LOG="/tmp/WAN${WAN_IF}_state"

# Execute and log script state
if [ -f "/jffs/scripts/${SERVICE_SCRIPT_NAME}" ]; then
  Say "     Script executing.. for wan-event: $SERVICE_SCRIPT_NAME"
  echo "$SERVICE_SCRIPT_NAME" >"$SERVICE_SCRIPT_LOG"
  sh /jffs/scripts/"${SERVICE_SCRIPT_NAME}" "$@"
else
  Say "     Script not defined for wan-event: $SERVICE_SCRIPT_NAME"
fi

##@Insert##

# nano /jffs/scripts/wan0-connected

#!/bin/sh

# HACK: I am unsure of what to check.
## Do this too early and the TTL & HL won't be set.
sleep 5s; modprobe xt_HL; wait

# Removes these iptables entries if present.
# WARNING: Only removes these entries once, and never assumes the same entries are present twice.
iptables -t mangle -D PREROUTING -i usb+ -j TTL --ttl-inc 2
iptables -t mangle -D POSTROUTING -o usb+ -j TTL --ttl-inc 2
ip6tables -t mangle -D PREROUTING ! -p icmpv6 -i usb+ -j HL --hl-inc 2
ip6tables -t mangle -D POSTROUTING ! -p icmpv6 -o usb+ -j HL --hl-inc 2

# TTL & HL hotspot detection bypass.
## Increments the TTL & HL by 2 (1 for the router, 1 for the devices connected to the router).
iptables -t mangle -A PREROUTING -i usb+ -j TTL --ttl-inc 2
iptables -t mangle -I POSTROUTING -o usb+ -j TTL --ttl-inc 2
ip6tables -t mangle -A PREROUTING ! -p icmpv6 -i usb+ -j HL --hl-inc 2
ip6tables -t mangle -I POSTROUTING ! -p icmpv6 -o usb+ -j HL --hl-inc 2

Now, set permissions correctly to avoid this error: custom_script: Found wan-event, but script is not set executable!
# chmod a+rx /jffs/scripts/*
# reboot


GoldenOrb or OpenWrt via LuCI
  1. GoldenOrb specific: NetworkFirewallCustom TTL Settings

    • Ensure its option is disabled.

  2. NetworkFirewallCustom Rules

# Removes these iptables entries if present; only removes once, so if the same entry is present twice (script assumes this never happens), it would need to be removed twice.
iptables -t mangle -D PREROUTING -i usb+ -j TTL --ttl-inc 2
iptables -t mangle -D POSTROUTING -o usb+ -j TTL --ttl-inc 2
ip6tables -t mangle -D PREROUTING ! -p icmpv6 -i usb+ -j HL --hl-inc 2
ip6tables -t mangle -D POSTROUTING ! -p icmpv6 -o usb+ -j HL --hl-inc 2

# TTL & HL hotspot detection bypass.
## Increments the TTL & HL by 2 (1 for the router, 1 for the devices connected to the router).
iptables -t mangle -A PREROUTING -i usb+ -j TTL --ttl-inc 2
iptables -t mangle -I POSTROUTING -o usb+ -j TTL --ttl-inc 2
ip6tables -t mangle -A PREROUTING ! -p icmpv6 -i usb+ -j HL --hl-inc 2
ip6tables -t mangle -I POSTROUTING ! -p icmpv6 -o usb+ -j HL --hl-inc 2

4. Confirm the hotspot is un-throttled

💡
After enabling USB hotspot, enable "Data Saver". This tells Android to restrict data to USB hotspot and what app is at the forefront only.
  1. Use Netflix’s Speedtest, then compare that result to Waveform’s Bufferbloat Test.
    This tests for throttling of streaming servers (Netflix), various forms of data fingerprinting, and hotspot/hotspot detections.

5. Improving internet speeds

  1. Search for "Roaming" in the Settings app, then disable it.

    • Context: Roaming to a different telecom usually has unavoidable throttling. Roaming kicks in when signal strength is either very poor or non-existent from your telecom. In T-Mobile USA’s case, they roam on AT&T with only up to 250kbps download & upload speeds on AT&T’s towers.

  2. Install Network Signal Guru then use it to set the allowed LTE bands to only the "LTE 4x4 Bands" listed on cacombos.com for your device. This could stabilize your speeds, and can potentially increase speeds.

    • If the ads bother you, enable Systemless Hosts in Magisk’s settings, then install AdAway and use its Root method; do not use its VPN method.

  3. Only if you have high ping or ping spiking issues: try disabling "hotspot hardware acceleration" in the Settings app.

Appendices

Resources used

You’ve reached the end of this guide. Star it if you liked it.


Tip me if you want more telecoms tested, such as AT&T, Verizon, and third-party MVNOs using say AT&T’s network like Cricket Wireless. As of Sep 10 2023, I’ve only tested with a Magenta T-Mobile plan.

Scan this image, or click on it to tip me on Ko-fi:

kofi qrcode

About

Remove speed restrictions on your hotspot internet (iOS, iPadOS, Android, Quectel), and allows hotspots on any plan (rooted Android & Quectel only).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%