📜 ⬆️ ⬇️

We get internet via USB from a computer on Android


The article is relevant for 2010, modern Android can do this in one “tick” in the settings

After buying the HTC Hero, I had a question: how to get internet on my device through a computer? With my previous Toshiba G900 communicator running Windows Mobile 6, everything was simple: I installed the “center of mobile devices” and the Internet appeared on the communicator. “This function is not needed,” you say, because now there are many Wi-Fi access points through which you can connect with two clicks. But personally, I do not have a Wi-Fi point (there is a laptop, but Android does not detect the Ad-ho network). Therefore, I was disappointed by the lack of this feature. All my attempts to find manuals on this topic were unsuccessful. So I decided it myself.
Note: For the operation of the sheath root user.

Installing the network between the communicator and the computer

There are two ways:

In this article I will consider the second method, since it is more versatile.
And so, we need the Wired Tether program, which can be downloaded by clicking on the QR code, or reading it from the phone:
(268 KB)
After clicking on the screen in the Wired Tether program, in Windows a new network connection to the communicator appears, and the settings obtained via DHCP:
For me, for example, the communicator's network is Android USB, and the Internet connection for sharing is the Internet. In the future I will use these notations.
We disconnect the Internet connection, in the connection properties we make it available for Android USB:
Go to the Android USB settings and change its IP and mask to /, and the rest is done empty:
The purpose of manually changing the IP address is to remove the default gateway.
We try Ping the communicator (it is under ip -
C:\Users\MainNika>ping 32 : =32 <1 TTL=128

Configuring Communicator

For the convenience of working with scripts, take the GScript Lite program:
(56.4 KB)

Create a new script in the GScript Lite program, write there:
ifconfig rmnet0 down
ifconfig usb0 up
route add default gw dev usb0
setprop net.dns1 is the google DNS server. I love to use it, so I use it here. You can use any DNS server that you want.
Setup is complete, you can test:
  1. USB plug
  2. Turn on the program Wired Tether, turn on the connection
  3. We include GScript Lite, we execute the script created by us
  4. ???
  5. PROFIT!

Well and to be convinced, we will come on 2ip.ru :
To disconnect, just restart the mobile connection.
Everything. Now you can easily climb in the market, Download from there a mountain of useful and not only software.

upd: For those who cannot cope with setting up routing on Windows, I can advise Kerio WinRoute. It also works through it, and the whole setup consists in specifying a network connected to the Internet. Screenshot

upd2: Rewrote the article, it became universal and without problems. Thanks to “Corwin” for pointing out an error in the script leading to the “invalid argument”

Source: https://habr.com/ru/post/101797/

All Articles