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 About
This entry was posted on August 10, 2009 at 14:02 and is filed under Android, Free Software, Ubuntu. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackbackfrom your own site.
Michael B. Trausch (Mtrausch) 'S Status On Monday, 10-Aug-09 13:43:24 UTC - Identi.Ca said
[...] G1 USB Tethering with Ubuntu « Paolo Sammicheli's Blog [...]
Joseph Piché said
Nice. Now I seriously can't wait until I can get an android phone.
–
jpiche
Weekly Public Links (Weekly) « My Blog said
[...] G1 USB Tethering with Ubuntu « Paolo Sammicheli's Blog [...]
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
Paolo Sammicheli said
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
Paolo Sammicheli said
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.
Paolo Sammicheli said
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?
Paolo Sammicheli said