My latop is connected to a wired modem for internet. I want to access internet on my android phone.

Can i do it by connecting my Android to laptop via usb cable and then enabling tethering.


Operating System: Ubuntu 12.04

  • 1
    I forgot to mention: its ubuntu 12.04
    – Mohit
    Aug 1, 2013 at 12:43
  • @CharlieRB can you remove 'This question may have an answer here' banner as it is apparent that question has been edited to update the OS.
    – Mohit
    Aug 2, 2013 at 4:05
  • I removed my vote and comment related to being a duplicate. If my answer was correct, please select it as being the answer. Thank you.
    – CharlieRB
    Aug 2, 2013 at 11:56
  • Use this without root github.com/Genymobile/gnirehtet
    – Biswapriyo
    Nov 1, 2017 at 15:22

2 Answers 2


You will need do a reverse tether. As far as I know, the phone must be rooted for this to be done.

Here are instructions at XDA Developers - HOWTO: Ubuntu USB reverse tethering

  • If you are reading this in 2016, this no longer works for android v5 and above Sep 9, 2016 at 19:16

Here's the closest to a "one-click" solution that I got to.


  • Rooted Android device

  • Root access on the PC

  • ADB installed on the PC (apt-get install android-tools-adb on Debian-based distros)

  • USB Debugging enabled on Android


  1. Connect Android device to the PC via USB
  2. Enable USB tethering on the Android device (Settings)
  3. Run the following script:

    WAN="wlan1"       # interface providing internet connection on the PC
    LAN="usb0"        # usb interface on the PC
    AND="rndis0"      # usb interface on Android
    sudo su -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
    sudo iptables -F -t nat
    sudo iptables -F FORWARD
    sudo iptables -t nat -A POSTROUTING -o $WAN -j MASQUERADE
    sudo iptables -A FORWARD -i $WAN -o $LAN -m state --state RELATED,ESTABLISHED -j ACCEPT
    sudo iptables -A FORWARD -i $LAN -o $WAN -j ACCEPT
    sudo ifconfig $LAN $LAN_IP netmask $NETMASK up
    adb shell su -c busybox ifconfig $AND $AND_IP netmask $NETMASK up
    adb shell su -c busybox route add default gw $LAN_IP
    adb shell su -c ndc resolver setifdns $AND "" $DNS1 $DNS2
    adb shell su -c ndc resolver setdefaultif $AND
    adb shell ping -c4 $DNS1
    adb shell ping -c4 google.com
  4. Done!


  • You probably need to adjust the interface names LAN, WAN and AND.

  • I found that some apps would either not recognize the network connection or only work partially. I was able to fool them using Fake Wifi Connection module for the Xposed Framework

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.