Paolo Sammicheli’s Blog

Sex, Ubuntu and Rock and Roll!

G1 USB Tethering with Ubuntu

Posted by Paolo Sammicheli on August 10, 2009

Since the first day I got my G1 I installed the useful WiFi Tether. It’s very useful and it allow to be quickly in the net from any operative system. The bad side is that it drain quickly the battery charge and the phone start to be hot after few minutes.

Today I found a nice program which allow Tethering with USB cable. It don’t need rooted phones, and the phone doesn’t warm up during tethering. It’s called azilink and like WiFi Tether is released under GPL License.

Following few steps to quickly share the Internet connection with your Ubuntu.

  • You need an installed and working Android Developer Toolkit (1.1 or 1.5, I tested it with 1.5)
    • connect your phone and try “adb devices” you should find your device listed, otherwise check the installation.
  • Install azlink‘s apk  with adb
    • adb install azilink-2.0.2.apk
  • Install openVPN
    • sudo apt-get install openvpn
  • Forward port with adb
    • adb forward tcp:41927 tcp:41927
  • Start AzLink in your phone and check “Service active” option to activate it.
  • Start openvpn with provided option file
    • sudo openvpn –config azilink.ovpn
  • Add manually dns server 192.168.56.1 to resolv.conf
    • sudo vi /etc/resolv.conf # or with your favorite text editor, add “nameserver 192.168.56.1”

That’s all, Enjoy it.

Update: If you want a nice script to make easier VPN on and off take a look here

AzLink main page

AzLink main page

AzLink About

AzLink About

20 Responses to “G1 USB Tethering with Ubuntu”

  1. […] G1 USB Tethering with Ubuntu « Paolo Sammicheli’s Blog […]

  2. Nice. Now I seriously can’t wait until I can get an android phone.

    jpiche

  3. […] G1 USB Tethering with Ubuntu « Paolo Sammicheli’s Blog […]

  4. Vincenzo said

    Hi.
    I’m having some trouble with this under ubuntu. It seems that I can’t ping through the vpn tunnel.
    The azilink on the phone (mine is a Magic) shows “connected to host”, so everything comes up ok and the adb is correctly forwarding the right port..
    I can’t see a reason why it shoudn’t work, but it doesn’t..

    Can you help me?

    This is the azilink.ovpn:

    dev tun

    remote 127.0.0.1 41927 tcp-client

    ifconfig 192.168.56.2 192.168.56.1

    route 0.0.0.0 128.0.0.0

    route 128.0.0.0 128.0.0.0

    socket-flags TCP_NODELAY

    ping 10

    dhcp-option DNS 192.168.56.1

    This is the output from openvn –config azilink.ovpn:

    Wed Aug 19 17:57:53 2009 OpenVPN 2.1_rc11 x86_64-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Mar 9 2009
    Wed Aug 19 17:57:53 2009 WARNING: –ping should normally be used with –ping-restart or –ping-exit
    Wed Aug 19 17:57:53 2009 ******* WARNING *******: all encryption and authentication features disabled — all data will be tunnelled as cleartext
    Wed Aug 19 17:57:53 2009 TUN/TAP device tun0 opened
    Wed Aug 19 17:57:53 2009 /sbin/ifconfig tun0 192.168.56.2 pointopoint 192.168.56.1 mtu 1500
    Wed Aug 19 17:57:53 2009 Attempting to establish TCP connection with 127.0.0.1:41927 [nonblock]
    Wed Aug 19 17:57:53 2009 TCP connection established with 127.0.0.1:41927
    Wed Aug 19 17:57:53 2009 TCPv4_CLIENT link local: [undef]
    Wed Aug 19 17:57:53 2009 TCPv4_CLIENT link remote: 127.0.0.1:41927
    Wed Aug 19 17:58:03 2009 Peer Connection Initiated with 127.0.0.1:41927
    Wed Aug 19 17:58:04 2009 Initialization Sequence Completed

    This is the routing table once the vpn is up:

    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    192.168.56.1 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
    192.168.164.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet1
    192.168.170.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet8
    0.0.0.0 192.168.56.1 128.0.0.0 UG 0 0 0 tun0
    128.0.0.0 192.168.56.1 128.0.0.0 UG 0 0 0 tun0

    • did you add the DNS entry?

      • Vincenzo said

        Yes, I did.
        Still I can’t ping the phone by its IP (192.168.52.1) and the DNS isn’t even needed for that..

        PS: I apologize for my spaghetti-english😛

    • Scusa tu, non avevo notato che eri Italiano. Mi viene in mente che prima di provare io ho disabilitato la rete dal network manager. Vai sopra l’icona e deseleziona “Abilita Rete” dal menù tasto destro prima di lanciare lo script della vpn, forse gli da fastidio quello.

      Ciao

      • Vincenzo said

        Ci ho provato anch’io. Ho stoppato il servizio prima di aprire la vpn e l’ho restartato dopo.
        Niente.. Non pinga attraverso il tunnel. Neanche attraverso altri tunnel (ho provato con un pc in rete locale con su installato openvpn in ocnfigurazione server).

        Comunque ho deciso di lasciare perdere: periodicamente ogni circa 6-7 mesi faccio una prova a installare Ubuntu da qualche parte, per vedere se è vero che finalmente c’è un linux su cui va tutto al primo colpo, poi regolarmente torno a Gentoo perchè trovo qualcosa su cui sbattere la testa, che non va e lo fa senza ragione apparente..🙂 Ed anche questa volta è giunta l’ora..😦

        PS: la mia ipotesi è che per qualche ragione che non ho ben capito gli diano fastidio le schede virtuali di vmware. La stessa cosa mi dava problemi anche su windows. Lì ho risolto disattivando manualmente le schede di rete virtuali (quelle di vmware, appunto).
        Ho anche provato a stoppare i servizi di vmware, stoppare il network manager, aprire la vpn e poi restartarlo, senza successo.

    • Pensi dipenda da Ubuntu? Io ho qualche sospetto sul Magic a questo punto. Altra differenza che noto è che tu hai la distro a 64 bit ed io a 32. Sei su Jaunty, vero?

  5. Vincenzo said

    Yes. Jaunty a 64bit.

  6. […] Since the first day I got my G1 I installed the useful WiFi Tether. It’s very useful and it allow to be quickly in the net from any operative system. The bad side is that it drain quickly the battery charge and the phone start to be hot after few minutes. More here […]

  7. […] on tethering capabilities in a while.  So I did a bit of research and came across this site:  https://xdatap1.wordpress.com/2009/08/10/g1-usb-tethering-with-ubuntu/.  This was a very informative and complete set of instructions for setting up USB tethering on my […]

  8. Tripp said

    Great tutorial. I was on the road and stranded at an airport with bad wireless service. I did a bit of digging and found your post and was up and running within minutes. The only thing this lacked was a startup script, so I created one, which you can find on my website. Sadly the filter discards my post if I link back to my site.

  9. Mean-Machine said

    Hey Paolo,

    Thanks for the tutorial, will try it soon.

    G1, Android roxx!

  10. pyrolinux said

    It works fine. thanks for this tutorial.

  11. anthony said

    Anyone else have the guts to attempt to get this working, and then create an ad hoc network from your pc that shares this internet, while giving the connected computers dynamic ips…. on ubuntu 9.10…. i did😦

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: