Setup USB Tethering on your Android Phone, No Root Access Required


Initial Setup and Configuration

Download the current Android SDK (Linux version).
$ wget

Untar the SDK.
$ tar xvf android-sdk_r04-linux_86.tgz

Copy the “adb” application to your Ubuntu /usr/bin directory (sudo privs needed)
$ sudo cp android-sdk-linux_86/tools/adb /usr/bin/adb

Create a rules file called /etc/udev/rules.d/91-android.rules containing the information below. This will allow udev to see your device. Make sure you replace <username> with your username. This example shows the idVendor for the Motrola Droid “22b8”, if you are using a Nexus One change the idVendor to “18D1”, for the HTC Incredible use “0BB4”.
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", SYMLINK+="android_adb", MODE="0666", OWNER="<username>"
For other android devices you can use the lsusb command with your phone connected over USB. The vendor ID is the bold text. This example shows the Motrola Droid.
$ lsusb
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 22b8:41db Motorola PCS
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Change the file permissions.
$ sudo chmod a+r /etc/udev/rules.d/91-android.rules

Restart udev so that it uses the new rules.
$ sudo restart udev

On your phone enable “USB debugging” Settings -> Applications -> Development.

Connect your Droid to the computer with the USB cable and check that it recognizes the device.
$ adb devices

Install OpenVPN on Ubuntu.
$ sudo apt-get install network-manager-openvpn openvpn
$ sudo /etc/init.d/networking restart
$ sudo /etc/init.d/network-manager restart

Install OpenVPN on your Phone. The adb command will install the azilink app on your phone from your computer. Alternatively you can copy the azilink.apk to your phone and install it directly if you have the Settings -> Applications -> Unknown Sources option enabled.
$ wget
$ adb install azilink.apk
$ wget

Create a script called android_tether with the following code. This script handles .
adb forward tcp:41927 tcp:41927
sudo mv /etc/resolv.conf /etc/resolve.conf.backup
sudo echo "domain lan" > /etc/resolv.conf
sudo echo "search lan" >> /etc/resolv.conf
sudo echo "nameserver" >> /etc/resolv.conf
sudo openvpn --config azilink.ovpn

Set your new script to be executable.
$ chmod 755 android_tether

« IntroductionStart and Stop Tethering Service »

1 2 3

About Author

  • Shannon VanWagner

    Hello Ryan… Thanks for posting this! Just wanted to let everyone know that I’ve created a script to set this up for the Ubuntu 9.10+ machines … See it on my blog at, or use the direct link to it:
    Instructions here:


    • Ryan

      Thanks for the update!

    • Jim Bom

      Hey Shannon,

      Your script failed on my Fedora 14 install but I popped a livecd of Ubuntu 10.10 in my machine and it ran like a champ. thanks for throwing this together.

  • Jon

    Hi Ryan, I currently use a similar setup with Proxoid but it seems to only use 1 port (8080 by default). Does AziLink use multiple ports?

    • Ryan

      I don’t believe that it uses multiple ports. This line does port forwarding from host port 41927 to android port 41927.
      adb forward tcp:41927 tcp:41927

  • Pingback: Froyo (Android 2.2) update disables USB tethering - Android Forums()

  • Dodekane

    Hi Ryan

    You forgot to put /etc/resolv.conf instread of resolv.conf
    in the line :

    sudo echo "nameserver" >> resolv.conf

    Thanks for your tutorial it was very clear and helpfull to me !

    • Ryan

      Good catch thanks, fixed now.

  • Aaron


    Thanks for the info, this is the most straight forward setup I have seen to date to get this accomplished.

    Thanks again!

  • Mark

    Hi Ryan,

    Perhaps you can help me. I am using your script with limited success to tether my Fedora 13 workstation to my Evo 4G.

    The short story, I run the script, start AziLink on my Evo, and get ‘Status: Connected to host’ reported by AziLink. Unfortunately, AziLink also shows ‘Bytes received: 0, Bytes sent: 0, TCP connections: 0, NAT table size: 0’. I don’t get any indications of networking.

    More details

    Output from android_tether:

    # ./android_tether
    Fri Sep 3 15:36:35 2010 OpenVPN 2.1.1 x86_64-redhat-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Jan 5 2010
    Fri Sep 3 15:36:35 2010 WARNING: --ping should normally be used with --ping-restart or --ping-exit
    Fri Sep 3 15:36:35 2010 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
    Fri Sep 3 15:36:35 2010 ******* WARNING *******: all encryption and authentication features disabled -- all data will be tunnelled as cleartext
    Fri Sep 3 15:36:35 2010 TUN/TAP device tun0 opened
    Fri Sep 3 15:36:35 2010 /sbin/ip link set dev tun0 up mtu 1500
    Fri Sep 3 15:36:35 2010 /sbin/ip addr add dev tun0 local peer
    Fri Sep 3 15:36:35 2010 WARNING: potential route subnet conflict between local LAN [] and remote VPN []
    Fri Sep 3 15:36:35 2010 Attempting to establish TCP connection with [nonblock]
    Fri Sep 3 15:36:35 2010 TCP connection established with
    Fri Sep 3 15:36:35 2010 TCPv4_CLIENT link local: [undef]
    Fri Sep 3 15:36:35 2010 TCPv4_CLIENT link remote:
    Fri Sep 3 15:36:45 2010 Peer Connection Initiated with
    Fri Sep 3 15:36:45 2010 Initialization Sequence Completed

    Contents of resolv.conf after starting checks out:

    #cat /etc/resolv.conf
    domain lan
    search lan

    What can I see?

    # ping
    ping: unknown host

    Or, explicitly providing an IP address (for

    # ping
    PING ( 56(84) bytes of data.
    ping: sendmsg: Operation not permitted
    ping: sendmsg: Operation not permitted

    What about the device?

    # ping
    PING ( 56(84) bytes of data.
    ping: sendmsg: Operation not permitted
    ping: sendmsg: Operation not permitted

    # ping
    PING ( 56(84) bytes of data.
    ping: sendmsg: Operation not permitted
    ping: sendmsg: Operation not permitted

    # ping
    PING ( 56(84) bytes of data.
    64 bytes from icmp_seq=1 ttl=64 time=0.041 ms
    64 bytes from icmp_seq=2 ttl=64 time=0.021 ms

    Finally, for what it’s worth, here’s what ifconfig has to say:

    # ifconfig tun0
    tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
    inet addr: P-t-P: Mask:
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:100
    RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

    I’m not sure how to interpret this (I’ve little expertise on networking), but it seems that the host can talk with the device, but not the nameserver.

    Any suggestions?


  • Wezzy

    does this work for windows?