Requirements:
- Rooted Android device with "USB tethering" capability.
- Windows PC with a working Internet connection.
- USB cable to connect your Android to your PC.
- Terminal Emulator on your Android. If you don't want to type
commands on your touchscreen with Terminal Emulator, you can use
your PC keyboard to enter commands with
adb shell
. adb is a part
of Android SDK which is available for download from Google. To use
adb, you need to enable "USB debugging" on your Android.
- Optional, BusyBox on your Android.
Step 1:
Connect your Android to PC by USB cable and enable USB tethering
Windows will automatically search Windows Update and install driver
for you. You can skip Windows Update search and install manually an
already included driver from Microsoft.
- In Install Driver window, click
Browse My Computer, then Let me
pick...
, select Network Adapters
, uncheck Show Compatible
Hardware
, look at Microsoft Corporation
at the left column
- Choose
Remote NDIS Compatible Device
from the right column. You can
also install or update a driver from Device Manager in Windows.
Step 2:
Open Network Connections
in Control Panel
. Right click on an
Internet connection that you have.
select Properties
. In tab Sharing
(or Advanced
for Windows XP),
click Allow other network users to connect through...
, then select
the USB connection in dropdown list below. Click OK.
Windows will automatically setup your USB network connection and
assign to it an IP address, default for Windows 7: 192.168.137.1
,
default for Windows XP: 192.168.0.1
.
You can see your Internet connection is now "Shared" and your USB
connection is now Unidentified network
. Your PC setup is now done!
Step 3:
Open Terminal Emulator on your Android. Type:
su
netcfg rndis0 dhcp
(The name for usb interface inside Android may vary. It is usually rndis0 or usb0. Type busybox ifconfig
to identify the name.
When automatical dhcp method does not work.
Type:
ifconfig rndis0 192.168.137.2 (192.168.0.2 for Windows XP) netmask 255.255.255.0
route add default gw 192.168.137.1 (192.168.0.1 for Windows XP) dev rndis0
If route fails, try:
busybox route add default gw 192.168.137.1 (192.168.0.1 for Windows XP) dev rndis0 dev rndis0
Some applications (download in Google Play, GMail, Facebook...) don't recognize Internet connection. You can try this way
Enable temporarily 3G connection on your Android and type
ifconfig rmnet0 0.0.0.0
(The name for 3G interface inside Android may vary: ppp0
, rmnet0
... Type busybox ifconfig
to identify name)
Source: http://forum.xda-developers.com/showthread.php?t=2287494