What is Tethering

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

Wi-Fi access point

Using an Android phone as a Wi-Fi access point (using 3G) has been accessible by default since Froyo (Android 2.2) without needing to root the phone. Moreover, this method will discharge the battery rapidly and tends to cause intense heating, unlike USB.
See : menu/wireless & networks/Internet tethering/Wi-Fi access point

USB tethering

Tools Needed

Root access to the phone (for old Android versions, Froyo (Android 2.2) and beyond can do it natively)

USB connection cable from your phone to PC

Procedure

Enable USB Debugging. This is usually done from Settings --> Applications --> Development --> USB debugging. Reboot the phone after checking this option to make sure USB debugging is enabled (if there is no such option, this step probably does not apply to your version of Android)

Disconnect your computer from any wireless or wired networks

Connect the phone to your computer using the USB cable (the USB connection mode -- Phone Portal, Memory Card or Charge only -- is not important, but please note that you will not be able to change the USB mode during tethering)

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 on 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.

Configuring the phone connection in Arch Linux

Once you have installed the Android SDK, in order to use the provided tools your phone must be properly set up in udev and your Linux user needs to be granted rights. Otherwise you may need root privileges to use the Android SDK, which is not recommended. To perform this configuration, turn on USB debugging on the phone (usually in Settings -> Applications -> Development -> USB debugging), connect it to the PC by the USB cable and run the lsusb command. The device should be listed. Example output for the Acer Liquid phone:

Bus 001 Device 006: ID 0502:3202 Acer, Inc.

Then, create the following file, replacing ciri by your own Linux user name, and 0502 by the vendor ID of your own phone:

/etc/udev/rules.d/51-android.rules

SUBSYSTEM=="usb", ATTR(idVendor)=="0502", MODE="0666" OWNER="ciri"

As root run the udevadm control restart command (or reboot your computer) to make the change effective.
Now run in your linux PC the adb shell command from the Android SDK as plain (non root) user: you should get a unix prompt in your phone.

Procedure

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

You will 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.

Troubleshooting

DNS

NetworkManager

If you're running NetworkManager, you may need to stop it with systemctl stop NetworkManager before running OpenVPN.

Tethering with SOCKS 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 ( address bar )