Most people are aware that Android devices can be used as a USB tether for sharing mobile data to a computer, but a nifty trick is the same procedure in reverse – that is, sharing a computer’s internet connection with the Android device. It’s known as “reverse tethering”, and it’s a fairly easy thing to setup.
There are different ways to achieve this depending on your operating system, so I will share methods for Windows, Mac, and Linux systems.
- Download and install the Connectify Hotspot software on your computer, and proceed with the instructions on screen. Connectify Hotspot essentially creates a hotspot network through your computer’s WiFi antenna – of course, there’s a native Windows method of achieving this, but Connectify Hotspot is far less technical and more user-friendly.
- To configure Connectify Hotspot, you simply create a network by entering the desired name in the SSID field, and a password. Then you choose the connection you want to share, such as the Wi-Fi network your computer is connected to.
- In SSID type the connection name you want to give, this will be the wi-fi network name that you will see on your Android. Give your network a password if you want to use a secured network. Now select from the connection you want to share. i.e. This is the adapter which has the internet. Select the Wi-Fi network using which you will connect your Android Phone.
- Now enable your Android device’s WiFi, and click “Start Hotspot” in Connectify. You should be able to see the network on your phone’s list of available WiFi networks, so simply choose the SSID from Connectify, provide the password, and you’re all set.
- First go to System Preferences > Sharing.
- Click on Internet Sharing, and under the dropdown box for “Share your connection from:”, choose the network your Mac is connected to, such as Ethernet or WiFi.
- Now in the box for “To computers using”, choose either Bluetooth PAN or AirPort, depending on your Mac OS/X version. However, if you’re sharing a Mac’s internet to a non-Apple device through AirPort, Mac absolutely requires a 5 or 13 letter WEP key. No more, no less.
- After you’re broadcasting the SSID from your Mac, go ahead and connect to it under your Android device’s WiFi settings.
Please note this requires a rooted Android phone – you can search Appuals for Android root guides for your device.
You’ll also need ADB and Fastboot installed, which is easily obtained with:
sudo apt-get install android-tools-adb android-tools-fastboot
Finally, you should have a Terminal Emulator installed on your phone.
- If you meet those prerequisites, go ahead and connect your Android device to your PC over USB.
- Now launch a Linux terminal, and type the following commands:
- This should display the network interface from the connected Android device, typically usb0 but in some cases it can be something else. In the commands I am giving, make sure to change usb0 to the actual network interface being used.
- So now type in the terminal:sudo ifconfig usb0 10.42.0.1 netmask 255.255.255.0
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
sudo iptables -t nat -F
sudo iptables -t nat -A POSTROUTING -j MASQUERADE
- Now we have to type the next command on your Android’s terminal emulator :
adb shell busybox ifconfig
- After that last command, it should display a different network interface being used, for example So again, change the commands I am sharing to whatever is your actual network interface.
adb shell ifconfig rndis0 10.42.0.2 netmask 255.255.255.0
adb shell route add default gw 10.42.0.1 dev rndis0
- Now we can test the internet sharing by trying to send a ping from your phone’s Terminal Emulator, so type on your phone:
adb shell ping 22.214.171.124
If you get a successful ping, then you’re all set to go.