Skip to content

Instantly share code, notes, and snippets.

@nijave
Created June 20, 2021 21:03
Show Gist options
  • Save nijave/b41f3afcb9a45579898fe488f16451d5 to your computer and use it in GitHub Desktop.
Save nijave/b41f3afcb9a45579898fe488f16451d5 to your computer and use it in GitHub Desktop.
Android 10 Tethering Fix
#!/bin/sh
# Don't require DUN APN type
settings put global tether_dun_required 0
# use MagiskHide Props Config
# echo "net.tethering.noprovisioning=true" >> /system/build.prop
# iptables increment TTL for nat packets since carriers block these
# Requires kernel with CONFIG_IP_NF_TARGET_TTL enabled
# ElementalX (at least for Oneplus 6t) works
iptables -t mangle -A POSTROUTING -j TTL --ttl-set 65
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -I FORWARD -j ACCEPT
iptables -t nat -I POSTROUTING -j MASQUERADE
ip rule add from 192.168.43.0/24 lookup 61
ip route add default dev tun0 scope link table 61
ip route add 192.168.43.0/24 dev wlan0 scope link table 61
ip route add broadcast 255.255.255.255 dev wlan0 scope link table 61
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment