Skip to content

Instantly share code, notes, and snippets.

@gohilbhagirath90
Created May 7, 2015 07:46
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gohilbhagirath90/b1cac45178eb33f4e95d to your computer and use it in GitHub Desktop.
Save gohilbhagirath90/b1cac45178eb33f4e95d to your computer and use it in GitHub Desktop.
USB Reverse Tethering Android
[ work in only rooted android phone ]
Step 1: connect android via usb.
Step 2: enable usb tethering
GOTO : settings > more .. > Tethering & mobile hotspot > Usb tethering
Step 3: on Host Machine
$ ifconfig usb0 10.42.0.1 netmask 255.255.255.0
$ echo 1 > /proc/sys/net/ipv4/ip_forward
Command for sudo will be:
$ sudo 'echo 1 > /proc/sys/net/ipv4/ip_forward'
Step 4: on Android device [for this step you must install adb on host pc]
$ adb shell
$ su
$ netcfg rndis0 dhcp
if it not get ip address than assign manually
$ netcfg rndis0 10.42.0.2 netmask 255.255.255.0
$route add default gw 10.42.0.1 dev rndis0
Now iternet is working in android phone. check ping www.google.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment