Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
executable file 25 lines (17 sloc) 0.718 kb
# Linux <-> Android Reverse Tethering Script
# This script tether the internet from your PC *to* the phone
# Some apps will not recognize the connection
# See
# Path to ADB
export ADB=/opt/android-sdk-linux_x86/platform-tools/adb
if [ $USER != "root" ]; then
echo "Please run this script as root"
echo "Enabling NAT on `hostname`..."
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -F
iptables -t nat -A POSTROUTING -j MASQUERADE
echo "Connecting to the phone via 'adb ppp'..."
$ADB ppp "shell:pppd nodetach noauth noipdefault defaultroute /dev/tty" nodetach noauth noipdefault notty
echo "Done."
Jump to Line
Something went wrong with that request. Please try again.