Android OSinternet z pc skrz usb


GabriBor
Nové Androidě
Příspěvky: 2
Registrován: ned 21. lis 2010 15:24:26

Re: internet z pc skrz usb

Příspěvek od GabriBor » pát 26. lis 2010 11:31:17

Hledal jsem na Googlu "Reverse tethering" našel jsem tohle:
Here is below to do it manually. I hope I will have some time to develop a small app to automate all of this !

Requirements:

* Android 2.2 (or an older version with a root tethering app)
* ADB from Android SDK, or a rooted Android 2.2 with terminal in root mode

STEP 1:

For Windows: Install USB drivers from Android SDK
For Linux: Nothing to do

STEP 2:

On Nexus One: Connect USB cable and activate USB Tethering. You should see on linux or windows a new network interface.

STEP 3:

On Linux Computer, setup a bridge:

# usb0 is the new network intreface
# eth0 is the main interface connected to internet (or a gateway)
sudo ifconfig eth0 0.0.0.0
sudo ifconfig usb0 0.0.0.0
sudo brctl addbr br0
sudo brctl addif br0 eth0
sudo brctl addif br0 usb0
sudo ifconfig br0 up
sudo dhclient br0

See https://help.ubuntu.com/community/Netwo ... tionBridge to setup bridges

On windows, Bridge the 2 network interfaces

STEP 4:

Setup usb0 interface of your phone. You have to options:

1. From your computer, execute:

./adb shell netcfg usb0 dhcp

2. Or in a root terminal on your phone, type:

su
netcfg usb0 dhcp

You should now be able to connect to Internet on your phone using your computer's Internet connection.

Try to do a ping http://www.google.com to be sure !

STEP 5:

To shut down the reverse-tethering, first unbridge interfaces on your computer:

sudo ifconfig eth0 down
sudo ifconfig usb0 down
sudo ifconfig br0 down
sudo brctl delbr br0
sudo ifconfig eth0 up
sudo dhclient eth0

Then on your phone, uncheck the USB Tethering option !

-----------------------------------
Update 2010-07-21
-----------------------------------

I've tested on a Windows VM... Two problem occur:

1. When we activate USB Tethering on the phone, the ADB connection is dropped: Windows does not seem to be able to handle both the network connection and the Android debug bridge like Linux.
2. The Android interface that is installed does not seem to work like in Linux: we have no control about it and it only seems to work one-way... Even by setting manually the usb0 interface on the phone I wasn't able to activate the interface on Windows.

From what I see, it is related to a Windows issue, or a driver issue, since we do not seem to have the raw control we can have under Linux.

So... Windows users.... Perhaps it's time for you to switch to Ubuntu Linux ;-)
A pak ještě tohle:
I have just had a brain wave – Create a script on your sd card called usb0.sh

In that text file have the following lines.
#!/bin/bash
su
netcfg usb0 dhcp

Download the application "Scripter" from the market and execute your script and volah no need to use adb or going into terminal.
Jeké jsou možnosti - mohlo by to fungovat ? Jsem v androidu nováček a mám docela strach si telefon rootnout. :geek:

Pokud to někdo rozjedete, dejte prosím vědět.

Pak jsme ještě našel tuhle věc: (bohužel jen pro užvatele W7 - nemám je - nezkoušel jsem)
http://www.connectify.me/
LG Optimus One - Android 2.2 froyo


Uživatelský avatar

Krokodyl
Droid
Příspěvky: 2480
Registrován: úte 16. úno 2010 21:02:59
Typ mobilu / ROM: Honor 7
Tablet: Samsung T535 GALAXY Tab4 10.1
Bydliště: Porta Bohemica
Kontaktovat uživatele:

Re: internet z pc skrz usb

Příspěvek od Krokodyl » pát 26. lis 2010 11:52:26

Connectify je zbytečný. Nasdílení internetového spojení v PC pomocí wifi není problém již od doby Win-XP pomocí ad-hoc sítě. Ale to je už skutečně mimo toto téma, zde se řeší jak na net přes USB kabel.
HTC Desire HD má tuto vlastnost již v základu.
zálohovat ZálohovaT ZÁLOHOVAT

Odpovědět

Zpět na „Android OS“

Kdo je online

Uživatelé prohlížející si toto fórum: Žádní registrovaní uživatelé a 1 host