___           ___           ___           ___           ___           ___     
     /\  \         /\__\         /\  \         /\__\         /\  \         /\  \    
    /::\  \       /:/  /        /::\  \       /:/  /        /::\  \       /::\  \   
   /:/\:\  \     /:/  /        /:/\:\  \     /:/__/        /:/\:\  \     /:/\:\  \  
  /::\~\:\  \   /:/  /  ___   /:/  \:\  \   /::\__\____   /::\~\:\  \   /::\~\:\  \ 
 /:/\:\ \:\__\ /:/__/  /\__\ /:/__/ \:\__\ /:/\:::::\__\ /:/\:\ \:\__\ /:/\:\ \:\__\
 \/_|::\/:/  / \:\  \ /:/  / \:\  \  \/__/ \/_|:|~~|~    \:\~\:\ \/__/ \/_|::\/:/  /
    |:|::/  /   \:\  /:/  /   \:\  \          |:|  |      \:\ \:\__\      |:|::/  / 
    |:|\/__/     \:\/:/  /     \:\  \         |:|  |       \:\ \/__/      |:|\/__/  
    |:|  |        \::/  /       \:\__\        |:|  |        \:\__\        |:|  |    
     \|__|         \/__/         \/__/         \|__|         \/__/         \|__|    
       

Android USB reverse tethering

Summary

Introduction

This guide is intended to help you share Internet connection from your PC to your Android smartphone/tablet via USB cable. This technique is called USB reverse tethering. It is different from USB tethering in which you share Internet from your Android to your PC. There are many reasons why you need this technique working:

This method works following Internet connection sharing basics. If your Android device is able to do USB tethering, you will be able to do USB reserve tethering with this method! Advantages:

Requirements:

Step 1:

Connect your Android to PC by USB cable and enable “USB tethering”. You are still allowed to enable this option even when your 3g/wifi on your Android is off.

ifconfig usb0 10.42.0.1 netmask 255.255.255.0

(suppose that you don’t have any other USB network adapter, otherwise, your Android may be usb1, usb2…)

echo 1 > /proc/sys/net/ipv4/ip_forward

Command for sudo will be:

sudo 'echo 1 > /proc/sys/net/ipv4/ip_forward'

iptables -t nat -F
iptables -t nat -A POSTROUTING -j MASQUERADE

Step 2:

Your PC setup is now done!

Step 3:

Open Terminal Emulator on your Android. Type:

su

Type the following command in Terminal Emulator, the same for all PC operating systems:

netcfg rndis0 dhcp

The name for usb interface inside Android may vary. It is usually rndis0 or usb0. Type:

busybox ifconfig

to identify the name. Use OLD instructions below when automatical dhcp method does not work. [OLD]Type these following commands in Terminal Emulator: For Linux PC:

ifconfig rndis0 10.42.0.2 netmask 255.255.255.0
route add default gw 10.42.0.1 dev rndis0

If route fails, try:

busybox route add default gw 10.42.0.1 dev rndis0

For Windows PC, use the same above commands, replace 10.42.0.2 by 192.168.137.2 (192.168.0.2 for Windows 10), replace 10.42.0.1 by 192.168.137.1 (192.168.0.1 for Windows 10) For Mac PC, replace 10.42.0.2 by 192.168.2.2, replace 10.42.0.1 by 192.168.2.1 Now you can close Terminal Emulator and start the browser for Internet.

Some applications (download in Google Play, GMail, Facebook…) don’t recognize Internet connection. You can try this way (WARNING: NOT TESTED):

ifconfig rmnet0 0.0.0.0

The name for 3G interface inside Android may vary: ppp0, rmnet0… Type:

busybox ifconfig

to identify the name. before ifconfig rmnet0 ... above. This will make applications see your Internet connection via USB as 3G!

USB tethering settings on Android will be reverted automatically when you unplug USB cable. To revert back settings on PC, uncheck “Allow other network users to connect through…” on Windows, “Internet sharing” on Mac, change from “Shared to other computers” back to “Automatically (DHCP)”, or simply delete USB connection from NetworkManager on Linux.

Simplified instructions (Mac OSX):

Mac: Install HorNDIS package.
Device: Turn on USB tethering under Settings > More Settings > Tethering and portable hotspot > USB tethering
Plug in USB from device to computer.
Mac: Connect device under System Preferences > Network > SAMSUNG_Android
Mac: Add Internet Sharing under System Preferences > Sharing > Service > Internet Sharing
Device: Root your device
Device: “netcfg rndis0 dhcp”
Device: “netcfg” to see the ip address of rndis0
Mac: “ifconfig” to see the ip address of your computer; use this ip address as mc_creator’s url input