Difference between revisions of "Android tethering"

From ArchWiki
Jump to: navigation, search
m (What is Tethering)
(added openvpn method for USB tethering)
Line 33: Line 33:
 
ifconfig usb0 up && dhcpcd usb0
 
ifconfig usb0 up && dhcpcd usb0
 
</pre>
 
</pre>
 +
 +
==USB tethering with openvpn==
 +
 +
This method works for any old Android version and does not requires root access nor modifications in the phone (it is also suitable for Android 2.2 and later, but no longer required).
 +
 +
It does not requires changes to your browser; in fact transparently handles all network traffic for any PC application (except ICMP pings). It is somewhat CPU intensive in the phone at high usage rates (a 500 kbyte/sec data transfer rate may take more than 50% of phone CPU in a powerful Acer Liquid).
 +
 +
===Tools Needed===
 +
In Arch you need to install the [https://www.archlinux.org/packages/?q=openvpn openvpn] package. Is is also required the Android SDK installed (which can be obtained [http://developer.android.com/sdk/index.html here]). In the phone, the [http://code.google.com/p/azilink/ azilink] application, a Java-based NAT that will communicate with OpenVPN in your computer.
 +
 +
===Procedure===
 +
Run the AziLink application in the phone and select "About" at the bottom to receive instruccions, which basically are:
 +
 +
# You'll have to enable USB debugging on the phone if it was not already enabled (usually in Settings -> Applications -> Development -> USB debugging).
 +
# Connect the phone with the USB cable to the PC.
 +
# Run AziLink and make sure that the '''Service active''' option at the top is checked.
 +
# Run the following commands in your linux PC:
 +
##As plain user: '''adb forward tcp:41927 tcp:41927'''
 +
##As root: '''openvpn AziLink.ovpn'''
 +
 +
{{File|name=AziLink.ovpn|content=
 +
<nowiki>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
 +
keepalive 10 30
 +
dhcp-option DNS 192.168.56.1</nowiki>
 +
}}
 +
  
 
==Tethering with proxy==
 
==Tethering with proxy==

Revision as of 20:17, 21 November 2010

What is Tethering

Tethering is a way to have Internet access on your PC through your smartphone using it's network connection. Usb and wifi access point tethering is natively supported from Android Froyo ( 2.2 ). Older versions of the Android OS, mostly unofficial roms have this option enabled.

Wifi access point

Since Froyo ( Android 2.2 ), wifi access point ( use 3G ) is accessible by default, without the need to root the phone. Moreover, this method will not discharging battery too fast like USB. See : menu/wireless & networks/Internet tethering/Wifi access point

USB tethering

Tools Needed

  • Root access to the PC ( for old Androids, Froyo ( Android 2.2 ) can do it natively )
  • Usb connection cable from your phone to pc

Procedure

  1. Enable the the tethering option from your phone. This is usually done from

Settings --> Wireless & Networks --> Internet tethering

  1. Disconnect from for current wifi or ethernet network
  2. Load the usbnet module(if it's not already loaded). You will need root access to do that
modprobe usbnet
  1. Connect the phone to the pc via the usb cable.
  2. Make sure that the usb interface is recognized by the system by using the following command
ifconfig -a

you should be able to see a usb0 device listed.

  1. Configure the new network device via dhcp using the following command
ifconfig usb0 up && dhcpcd usb0

USB tethering with openvpn

This method works for any old Android version and does not requires root access nor modifications in the phone (it is also suitable for Android 2.2 and later, but no longer required).

It does not requires changes to your browser; in fact transparently handles all network traffic for any PC application (except ICMP pings). It is somewhat CPU intensive in the phone at high usage rates (a 500 kbyte/sec data transfer rate may take more than 50% of phone CPU in a powerful Acer Liquid).

Tools Needed

In Arch you need to install the openvpn package. Is is also required the Android SDK installed (which can be obtained here). In the phone, the azilink application, a Java-based NAT that will communicate with OpenVPN in your computer.

Procedure

Run the AziLink application in the phone and select "About" at the bottom to receive instruccions, which basically are:

  1. You'll have to enable USB debugging on the phone if it was not already enabled (usually in Settings -> Applications -> Development -> USB debugging).
  2. Connect the phone with the USB cable to the PC.
  3. Run AziLink and make sure that the Service active option at the top is checked.
  4. Run the following commands in your linux PC:
    1. As plain user: adb forward tcp:41927 tcp:41927
    2. As root: openvpn AziLink.ovpn

Template:File


Tethering with proxy

With this method tethering is achieved by port forwarding from the phone to the pc. This is suitable only for browsing. For firefox, you should set network.proxy.socks_remote_dns to true in about:config ( adress bar )

Tools Needed

  • Root access to the PC
  • Android SDK which can be obtained here
  • Usb connection cable from your phone to pc
  • Proxoid application(free download from the Android market)


Instructions

Follow the instructions demonstrated in the following link