We generally use USB tethering to share data connection of mobile device with laptop and desktop. Sometimes we don’t have access to Wi-Fi or 3G/4G data connection on our mobile device and we want to use desktop wired, wireless internet connection on our phone, this process of sharing desktop, laptop wired/wireless device on mobile device is called USB Reverse tethering.
Today we are going to share how to perform USB reverse tethering without installing any software. This trick will only work on rooted device running Android OS and you need to have Windows, Linux or Mac PC.
Getting Started with Reverse USB Tethering:
Things required to perform reverse USB tethering:
- PC with working internet connection
- Terminal Emulator or adb Android SDK on Android device
- USB cable to connect mobile with PC
Once done with pre-requisite items we are ready to go!
- Connect Android device with the PC using USB cable. Go to phone settings and enable USB tethering and also enable 3G/Wi-Fi option even it is not connected.
- After connecting the device with Windows based PC, it will automatically search and install necessary remote NDIS compatible device drivers. On Linux machine, go to Network Manager and check it is able to detect new device or not. If it will not show the Android device then open the cmd terminal and run following commands to enable USB com ports:
ifconfig usb0 10.42.0.1 netmask 255.255.255.0 [USB0, defines the port address at USB 1]
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
And on Mac PC, install HoRNDIS drivers after installing the drivers a pop-up will appear saying new network interface detected. Click on the Network Preferences and add it to known interface list.
3. In the third step, open Network Connections under control panel in Windows based PC, go to LAN connection->Properties->Sharing tab-> click “Allow other network users to connect through”-> select USB connection from the drop down box and hit apply. Windows will automatically detect the USB device connected and will assign an IP address to it.
For Linux user, go to Network Manger-> Edit Connections-> Wired->new established connection-> click “Edit”-> IPv4 settings-> Choose “Shared to other computers”-> Save.
On Mac PC, Open System preferences->Network->New network interface-> Using DHCP as configure IPv4->go back to system preferences-> click sharing->select “Internet Sharing”-> choose connection to share-> select USB connection interface-> an IP address will be assigned to the USB device.
4. Go to Android Emulator or ADB SDK command window and type:
netcfg rndis0 dhcp
If automatic dhcp does not work, type:
ifconfig rndis0 10.42.0.2 netmask 255.255.255.0
route add default gw 10.42.0.1 dev rndis0
if busybox fails then try:
busybox route add default gw 10.42.0.1 dev rndis0
- Once done with above code, close the emulator and start surfing tethered internet connection on the Android device using reverse USB tethering trick.
Do try the above trick and let us know your views about reverse USB tethering in your comments below.