azilink adb forward

http://www.rail.co.il/HE/DrivePlan/Pages/DrivePlan.aspx?DrivePlanPage=true&OriginStationId=9200&DestStationId=5410&OriginStationName=%u05d4%u05d5%u05d3+%u05d4%u05e9%u05e8%u05d5%u05df+-+%u05e1%u05d5%u05e7%u05d5%u05dc%u05d5%u05d1&DestStationName=%u05d9%u05d1%u05e0%u05d4&HoursDeparture=18&MinutesDeparture=0&HoursReturn=18&MinutesReturn=0&GoingHourDeparture=true&ArrivalHourDeparture=false&GoingHourReturn=true&ArrivalHourReturn=false&IsReturn=false&GoingTrainCln=2010-08-30&ReturnningTrainCln=2010-08-30&IsFullURL=true


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

Ads by Google
USB Basics Guide
Simple Tutorial on USB Nuts & Bolts 4 Page Paper - Free PDF Download
www.bb-europe.com



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 :P

    • 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?

Comments