Reverse Tether from Linux to Android

0
1095

We all have heard the name of tethering, right? It’s the method using which an Android device can work as the source of internet connection to a system. It’s super useful for situations when your system doesn’t have a Wi-Fi adapter (rare case, of course) or for some other reasons, you need your phone’s connectivity on your desktop/laptop/notebook etc.

Reverse tethering, as the name suggests, is the opposite of tethering. In this scenario, the Android phone is there to enjoy the internet connectivity from the desktop/laptop. Previously, it was super difficult as we had to undergo a seriously complex procedures using iptables, bridged connections etc. Thanks to the hard work of a developer, there’s an easy tool for Linux systems to reverse tether without any of those complexities. The tool has a nice, difficult name – Gnirehtet.

Important – Before going further, make sure that your Android has root unlocked. This is a must or much of the tool’s functionalities won’t work. Rooting an Android device, in many cases, will cause warranty void and other possible issues like bricking the phone. Check out your phone model on XDA Developers forum for a reliable method to root.

Don’t forget to check out this Android threat ADB.Miner that uses the open ADB ports.

Preparing the system

It’s time to setup Gnirehtet. First, we need the essential Android tools. Run the following command –

  • Ubuntu

  • Debian

  • OpenSUSE

  • Fedora

  • Arch Linux

  • Generic Linux instructions

If your system isn’t listed above, you have to get the compressed package of the command line tools only. Then, extract the folder to a suitable place and add the path to the system’s environment variable.

Check out your ADB version –

Installing Gnirehtet

It’s finally time to get the tool. Run the following command –

Note that there’s also a Java version, but it’s not recommended. It will cause higher CPU and memory usage and may not work properly.

After downloading, extract the archive.

Switch the working directory to the Gnirehtet directory.

Configuring Android for reverse tethering

At first, from the Android device, go to Settings >> Developer options and enable “USB Debugging”.

Connect the device via USB and run the command on Linux terminal –

Once your device is unlocked, return to the terminal and run this command –

Using Gnirehtet

Start the terminal and run the following commands –

You’ll get this notification in the Android phone. Allow the connection.

You’ll notice this icon at the top.

Re-connecting Android

Sometimes, the USB port may disconnect without warning or you may have to disconnect it as well. In that case, reconnect the device via USB and run these commands –

Stopping Gnirehtet

If you want to stop the reverse tethering connection, run this command –

Sometimes, this command won’t kill the reverse tethering programs properly. You have to run the following commands for properly killing the tool –

Enjoy!

Spread the love
  • 10
    Shares

PS. If you like this post please share it with your friends on the social networks using the buttons above.Thanks.

LEAVE A REPLY

Please enter your comment!
Please enter your name here