[REQ] Reverse wired tethering - G1 Android Development

Before i start i want to let people know YES I DO HAVE A WIRELESS ROUTER!! So please do not respond telling me to just go buy a router.
REQUEST - Reverse wired tethering. I.E. Sharing PC's iNet connection with your phone via USB.
REASON - My university's wireless is locked down and does not allow mobile phones, pda's to connect up to our wireless without submitting MAC for approval. Looking to sync certain apps without using my data connection.
I dont know if anyone has played around with trying to get this working or not. I know its a small market of people who may be interested in this, but for certain places (CANADA) where data charges are WAY to expensive this could be handy for students at UNI where wireless is not an option.

get a second wifi adapter on your laptop, and share your uni wireless network connection with the second wifi adapter. Use a hidden SSID, then no one will know what is going on

This was asked a couple of times before here and I remember people saying you couldn't reverse the tethering.You could try though.

alexperkins said:
get a second wifi adapter on your laptop, and share your uni wireless network connection with the second wifi adapter. Use a hidden SSID, then no one will know what is going on
Click to expand...
Click to collapse
Thats a good idea xD

Hey guys,
I have been trying to find a way to do this for a long time.
The best solution i have found (actually the only solution) is Connectify. The only downside is you must have Win7.
What it does is turns your wifi adapter into a HotSpot, even if you are using wifi to get the net in the first place. Its a great tool and should be what your after.
http://www.connectify.me/

memphisraynz said:
Hey guys,
I have been trying to find a way to do this for a long time.
The best solution i have found (actually the only solution) is Connectify. The only downside is you must have Win7.
What it does is turns your wifi adapter into a HotSpot, even if you are using wifi to get the net in the first place. Its a great tool and should be what your after.
http://www.connectify.me/
Click to expand...
Click to collapse
thank you so much for this

Your best solution is the WiFi adapter. You could most likely get away with a SOCKS proxy over USB, possibly using adb, but it would be complicated, unstable, and messy.

I still don't know you just don't use your wireless router. I assume they have wired. Clone your PC's mac address and hook it up. Universities are retarded with that crap. They have the worst networks and security.
If no wired, then what podunk place is it? haha
Even if they had only wireless , you could set up a wlan client and repeat it. DDWRT, etc, ftw.

Just get backtrack for your laptop and spoof your mac to all 0 then grab connect to the network at your school the spoofed mac will allow you to browse so long as no other encyption is on the network such as WEP or WPA.
then you can try to flood all the ports on the network so no one else can connect then spoof your phones mac by conneecting to your laptop through wireless as an adhoc connection and while staying connected through adhoc load a second server through the same wireless network card and you can connect to the achools network again. and walla...

death1246 said:
Just get backtrack for your laptop and spoof your mac to all 0 then grab connect to the network at your school the spoofed mac will allow you to browse so long as no other encyption is on the network such as WEP or WPA.
then you can try to flood all the ports on the network so no one else can connect then spoof your phones mac by conneecting to your laptop through wireless as an adhoc connection and while staying connected through adhoc load a second server through the same wireless network card and you can connect to the achools network again. and walla...
Click to expand...
Click to collapse
so simple, i dunno why i didnt think of that. thanks! lol

Well its quit simple once you learn your way around linux...

If you have any experience with *nix, you may want to look at Cyanogen's original usb tether shell script:
http://github.com/cyanogen/android_vendor_cyanogen/blob/master/bin/usb-tether
Basically you could use the internet connection sharing function that comes with all popular OSes and access your uni's network on your phone. You must have Cyanogen mod or another mod using his kernel. Not yet working on OSX for some reason. Tested under Windows 7.
First you'll need to figure out what IP address range your computer's DHCP server is using. This is normally fixed for each OS. For Windows 7, it's always 192.168.137.0/24.
For OSX or Linux, you can setup connection sharing (for some other connection because we don't have the USB interface yet) and ifconfig.
Second is to enable the USB connection on the phone's side. Type the following command in any console program, like Connectbot. (You must use a console program as opposed to adb because you will lose USB debugging once the USB network interface is enabled.)
Code:
su
cd /sys/devices/virtual/net/usb0
ifconfig usb0 192.168.137.200 mask 255.255.255.0
echo 1 > enable
The first line makes you the superuser. (Skip if the command prompt is #)
The second line land you in usb0's directory under sys. We'll need to type the disable command later, so it's easier if we're here.
The third line brings up the virtual usb network interface and sets its IP address.
The IP address should be in the same network (i.e. IP address range) you obtained in step 1. Say if the original is 192.168.137.1 in a /24, you can use 192.168.137.2 through 192.168.137.254
This actually enables the usb interface.
You will now see a new network adapter is recognized by your computer. Set up connection sharing to share your internet TO that adapter.
Make sure you have connection by pinging your computer from your phone.
For example:
ping 192.168.137.1
Now you'll have to change the routes so traffic go through the USB cable instead of the mobile network.(# is the command prompt, do not enter)
# busybox route
check the line starting with "default". Write down the ip address after it; call it IP1.
# getprop net.dns1
Call the IP returned IP2.
Code:
busybox route del default gw IP1
busybox route add -host IP2 rmnet0
busybox route add default gw 192.168.137.1
The first line deletes the old default route via the mobile network.
The second line adds an "exception" for your carrier's DNS server.
The third line adds the new route via USB. You should replace the address at the end with the IP address from the first step.
Your network should be working now. Test by visiting some website that is only available on campus or by traceroute.
You must make sure the mobile network is always connected though. This is because domain names are still resolved by your mobile carrier. If you ever lose your mobile connection, the routing table will be changed as well.
To disconnect:
Make sure you're still in /sys/devices/virtual/net/usb0.(Use pwd if unsure.)
Code:
netcfg usb0 down
echo 0 > enable
The usb interface will disappear on your computer.
Now switch the phone to airplane mode and back to re-enable mobile network.
The disconnect step should always restore your phone's state.
// This is written at 3am, so use it at your own risk...

help?
look at this
http://superuser.com/questions/91699/spoof-mac-address-from-ip-command
bg

It's really sad that Android can't reverse tether. If you want to use your laptop's AdHoc connection you have to do serious hacking to the tiwlan.ini and the wpa_supplicant.conf. There is no way to connect via bluetooth ar USB.
I'm seriously considering WP7 now for my next OS of choice... A nd for everyone saying "go buy a router" - go buy a router and stick it up your .... nose.

Hi,
I have the same problem. No WiFi in my work and no WiFi in my current home (a Resident Hall). There's no possibility to buy a WiFi router, of course. I tried to hack the system to connect ad-hoc networks but it didn't work.
I have found some interesting resources:
sluniverse.com/php/vb/blogs/psyke+phaeton/1042-making-android-phone-use-your.html
letsgoustc.spaces.live.com/blog/cns!89AD27DFB5E249BA!877.entry
I have a HTC Magic with the ADP-DRC83 hacked ROM with Usb tethering integrated. But usb0 interface in the mobile is configured to provide Internet connection (as gateway) to the PC, not the reverse functionality: connecting the mobile to Internet through the PC. So, all I need is to change the gateway in Android and then configure a NAT-DNS in my linux PC (easy with iptables and dnsmasq). But, I don't know how automatize the process exactly.

digitaljeff said:
but for certain places (CANADA) where data charges are WAY to expensive this could be handy for students at UNI where wireless is not an option.
Click to expand...
Click to collapse
Wind will be launching in vancouver soon.
$35 unlimited data.

Silly ragin' cajun.

Ok, now it works. Here it's my procedure for a HTC Magic (Sapphire) without any APN previously configured from Telecom provider and ROM CSDIv4.
In the mobile by using Better Terminal:
Code:
su
cd /sys/devices/virtual/net/usb0
echo 1 > enable
ifconfig usb0 192.168.2.2 mask 255.255.255.0
busybox route add default gw 192.168.2.1
setprop net.dns1 8.8.8.8
In the linux computer:
Code:
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i usb0 -j ACCEPT
sudo ifconfig usb0 192.168.2.1 netmask 255.255.255.0
Android Market downloads and location service don't work but I think is possible if you switch on the WiFi.
Update: Syncronization, Android Market downloads and location service don't work even the WiFi antenna is switched on. I have added the iptables commands also.

Well gosh, reverse wireless tethering is so much simpler

There are another similar thread: http://forum.xda-developers.com/showthread.php?t=522498

Related

Windows Mobile 6, "internet Sharing", Bluetooth And Suse (linux)

To those that might not know one of the major changes to windows mobile 6 from windows mobile 5 was the removal of bluetooth DUN (dial up networking) which has worked quite well under linux forever and the addition of a new tool called "Internet Sharing" which uses bluetooth pan. Linux has a tool called PAND which is supposed to allow us to use bluetooth pan but previously I had not had success in making it work. Recently I read the following page and used it as a guide and was able to get it working on Suse. http://klamstwo.org/evad/archives/40
Steps:
0) Run the kde bluetooth server (system, desktop applet, kbluetoothd) because when you run the pand command the first time the phone is going to prompt you for the "access code" you assigned on the pc and then the pc is going to ask you for the SAME access code to pair them. In yast under hardware, bluetooth you can set the access code it will expect. Make sure bluetooth is on and phone can be found by other devices.
1) Go into Yast, Network cards and create a Bluetooth network card..this should be "bnep0" when all is said and done..this has to be setup ahead of time because it won't exist until pand is called. My /etc/sysconfig/network/ifcfg-bnep0 looks like this:
-----
BOOTPROTO='dhcp'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR=''
MTU=''
NAME=''
NETMASK=''
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='hotplug'
USERCONTROL='no'
_nm_name='static-0'
--------
2)On the command line type "sdptool search NAP" and write down the device address which is in the format xx:xx:xx:xx:xx:xx
Example output:
--------
Inquiring ...
Searching for NAP on XX:121:2A:XX:XX ...
Service Name: Network Access Point
Service Description: Bluetooth NAP Service
Service RecHandle: 0x10000
Service Class ID List:
UUID 128: 00001116-0000-1000-8000-00805f9b34fb
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 15
"BNEP" (0x000f)
Version: 0x0100
SEQ8: 0 6 dd
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Network Access Point" (0x00001116-0000-1000-8000-00805f9b34fb)
Version: 0x0100
--------
3)On the command line type "pand --role PANU --connect xx:xx:xx:xx:xx:xx" replacing the XX's with your actual device address. (In my example that would be XX:121:2A:XX:XX) Pair the device when prompted. You will only have to pair it once..after that connects will be automatic.
4) On the command line type "route add default gw 192.168.0.1" and hit enter.
If you run ifconfig you should see the bnep0 device..on mine it gave me IP 192.168.0.85 and the phone is 192.168.0.1.
You should now have a bnep0 interface..and it should be the default route for internet....if you are running a firewall make sure it is the external zone..
Example ifconfig:
------
bnep0 Link encap:Ethernet HWaddr XX:11:F6:05:XX:XX
inet addr:192.168.0.85 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: 2002:48fa:6048:8:211:f6ff:fe05:7e97/64 Scope:Global
inet6 addr: fec0::8:211:f6ff:fe05:7e97/64 Scope:Site
inet6 addr: fe80::211:f6ff:fe05:7e97/64 Scope:Link
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:427958 errors:0 dropped:0 overruns:0 frame:0
TX packets:354277 errors:0 dropped:0 overruns:0 carrier:0
-------
Advantages of Internet sharing over bluetooth dun...one big one...bluetooth dun would drop connection about every 20 minutes and have to be manually reconnected..or it would hang and have to be manually dropped and reconnected....Internet sharing creates an "always on" device and I've been connected for the last 6 hours without a hitch.
I hope this helps someone else and if it does please let me know
...and for further "tinkering" your phone now has an actual IP address... 192.168.0.1 so theoretically you can run software such as ssh server's and proxies on the phone and access it from the pc...an example would be running the compressing proxy toonel from toonel.net. The phone version acts as both a http proxy and a socks proxy and compresses text to speed up surfing. The linux/windows versions only acts as a http proxy.
I tried to use Internet sharing via USB but it does not carry the proxy server I have on the phone. I have to add proxy address manually to my laptop IE. Is there ant way that my phone acts as proxy server?
Thanks
hey fame, you find a working version of linux for our phones yet? lol
Shabe_syah said:
I tried to use Internet sharing via USB but it does not carry the proxy server I have on the phone. I have to add proxy address manually to my laptop IE. Is there ant way that my phone acts as proxy server?
Thanks
Click to expand...
Click to collapse
What your asking has nothing to do with the original topic and should be in it's own thread. That being said..even if you ran a proxy on your pocketpc you would still have to point to THAT proxy on the pc so whats the difference in that and pointing to the isp one?
nottoosmart said:
hey fame, you find a working version of linux for our phones yet? lol
Click to expand...
Click to collapse
I wouldn't bet my retirement on it.
well, ive been trying to watch the linux thing in the forum but no one seems to be updating. im kinda depressed lol
famewolf said:
To those that might not know one of the major changes to windows mobile 6 from windows mobile 5 was the removal of bluetooth DUN (dial up networking) which has worked quite well under linux forever and the addition of a new tool called "Internt ...... proxy.
Click to expand...
Click to collapse
What kernel are you using with that version of SuSe?
The reason I ask, is that I'm using Debian Etch with a 2.6.18 kernel, and I get connected fine.. however...
I can't ping anywhere, or connect in any fashion anywhere, unless I first run tcpdump or ngrep on bnep0. Once I've done that, I can do a few things, for example, I seem to get DNS queries through (and with my own DNS on the net at large).
However, I can't seem to connect to anywhere, although oddly tcpdump seems to show packets coming in.
Anyone have any ideas. There is zero in the way of an iptables firewalling on this box...
BRad Barnett said:
What kernel are you using with that version of SuSe?
The reason I ask, is that I'm using Debian Etch with a 2.6.18 kernel, and I get connected fine.. however...
I can't ping anywhere, or connect in any fashion anywhere, unless I first run tcpdump or ngrep on bnep0. Once I've done that, I can do a few things, for example, I seem to get DNS queries through (and with my own DNS on the net at large).
However, I can't seem to connect to anywhere, although oddly tcpdump seems to show packets coming in.
Anyone have any ideas. There is zero in the way of an iptables firewalling on this box...
Click to expand...
Click to collapse
I have a handful of cheap chinese knockoff bluetooth dongles that I got for $5 each..they ALL have mac id's of all 11:11:11:11:11:11 and will not work with internet sharing..they can get an ip address but even with default route they don't seem to be able to get anywhere...the good news is bluetooth dun has been hacked BACK into wm6 and those same cheap dongles work fine using bluetooth DUN because it doesn't care about the mac id.
I have one airnet $15 bluetooth adapter I got from buy.com...this is the one dongle which I have that will work with internet sharing and it has a real mac id....I have used the same dongle on both a desktop and laptop to verify the dongle is the issue and not the pc's....so make sure you get a name brand dongle with it's own mac id and not a cheap clone....hope this helps.
famewolf said:
I have a handful of cheap chinese knockoff bluetooth dongles that I got for $5 each..they ALL have mac id's of all 11:11:11:11:11:11 and will not work with internet sharing..they can get an ip address but even with default route they don't seem to be able to get anywhere...the good news is bluetooth dun has been hacked BACK into wm6 and those same cheap dongles work fine using bluetooth DUN because it doesn't care about the mac id.
I have one airnet $15 bluetooth adapter I got from buy.com...this is the one dongle which I have that will work with internet sharing and it has a real mac id....I have used the same dongle on both a desktop and laptop to verify the dongle is the issue and not the pc's....so make sure you get a name brand dongle with it's own mac id and not a cheap clone....hope this helps.
Click to expand...
Click to collapse
That's it.. thanks.
Crappy chinese garbage!!!
Internet Sharing vs Bluetooth DUN
BRad Barnett said:
That's it.. thanks.
Crappy chinese garbage!!!
Click to expand...
Click to collapse
The specific model of bluetooth dongle I have is the Airnet ABT101..it's about $15 on ebay..there is also the ABT201 which is $9 on ebay but it has the shorter range.
Internet sharing has some definite pluses over bluetooth dun....for one it doesn't drop the connection every 20 minutes like dun did..for another your phone still has access to the internet while you do...so it can still sync..get email etc....lastly your phone has a real ip address (192.168.0.1) so you can run sync software like finchsync under linux to sync to thunderbird etc where previously you had to have a wifi connection.

Internet on G1 via USB cable (Reverse Tethering)?

Would it be possible to get Internet on the device, through PC, instead of Internet on PC, through device?
Is there any way to do this its very important as I live in India, there is no 3g and edge is very slow so can't download themes, updates directly on my g1
Sure there is a way, WiFi
No you cannot give the phone internet via USB
Can you be more specific on how to do it with WiFi? And without a router
I tried using the AdHoc connection created for the Tethering (Internet from G1's 3G/EDGE to PC), but with no luck.
The laptop and phone can ping each other, I have done all the necessary steps to share my LAN and WiFi connection, remounted the /system partition as rw, edited /etc/resolv.conf (/etc is in fact on /system/etc and if not remounted as rw you cannot edit /etc/resolv.conf), added the IP of the laptop, but then I have some trouble adding default route to it. No matter what settings I try "route add ...", they change nothing...
No internet, no ping.
Did you set the gateway?
You have the SDcard that you can use to move files to the phone, I don't see any need to download directly to the sdcard, especially if you have the phone hooked up via USB anyways.
Kind of pointless no>?
@ncoop23
but then I had some trouble adding default route to it. No matter what settings I try "route add ...", they change nothing...
Click to expand...
Click to collapse
So, I have tried at least.
How do you do it without Wi-Fi, over the USB cable? I can't set up a Wi-Fi node at work or the network security guys will send a SWAT team after me.
If you have access to a computer that has internet, and you have your usb cable, why don't you just download whatever theme/update to the computer, then plug in the usb cable and transfer it to your phone?
You have a PC or laptop with access to the internet. Why not just download stuff on to the PC/Laptop and move onto SD card.
If you want it to get on the market or watch youtube to test it out etc then join the laptop/PC's connection. Simple.
There is no solution for getting internet from laptop to the phone....
I wonder that with technology improving at such a fast pace, why any developer at corporations or independently hasnt thought about it yet. Any app, gadget or software providing a solution for this problem will sell like a hot cake especially in developing countries like south asia, middle east and africa.
Brock Samson said:
If you have access to a computer that has internet, and you have your usb cable, why don't you just download whatever theme/update to the computer, then plug in the usb cable and transfer it to your phone?
Click to expand...
Click to collapse
But how do I sync my Gmail and Contacts without a Wi-Fi or data connection?
dilwaladoctor said:
There is no solution for getting internet from laptop to the phone....
Click to expand...
Click to collapse
Are you sure? There is a solution for getting internet from phone to laptop over USB, so why not from laptop to phone? This blog post claims it can be done, but I haven't ever seen it working: http://blog.mycila.com/2010/06/reverse-usb-tethering-with-android-22.html
I wonder that with technology improving at such a fast pace, why any developer at corporations or independently hasnt thought about it yet. Any app, gadget or software providing a solution for this problem will sell like a hot cake especially in developing countries like south asia, middle east and africa.
Click to expand...
Click to collapse
This isn't a matter of "technology improving". Other phones already have it. Windows Mobile has had it for years.
dilwaladoctor said:
There is no solution for getting internet from laptop to the phone....
Click to expand...
Click to collapse
You have no idea what you're talking about.
http://forum.xda-developers.com/showpost.php?p=5242264&postcount=17
I have know idea if this will work or not, but I have found this on a few different forum all posted by Diyism, so if it does work he deserves all the credit.
Code:
My android os is CyanogenMod 4.2.14.1,
1.Enable "Settings\Wireless controls\Internet tethering"
2.Install HTC Remote NDIS based Device driver([url]http://forum.xda-developers.com/attachment.php?attachmentid=277122&d=1265356413[/url])
3.Set the HTC adapter as: IP:192.168.2.1, Mask:255.255.255.0
4.Set the PC ethercard as shared connection
5.Run these codes in terminal:
su
ifconfig usb0 192.168.2.2 netmask 255.255.255.0
busybox route delete default
iptables -F
iptables -F -t nat
busybox route add default gw 192.168.2.1
setprop net.dns1 8.8.8.8
setprop "net.gprs.http-proxy" ""
6.Now your g1 could open browser to view any web pages on the internet, and update apps in the Market.
highlandsun said:
You have no idea what you're talking about.
http://forum.xda-developers.com/showpost.php?p=5242264&postcount=17
Click to expand...
Click to collapse
Those instructions are only for a Linux computer, though?
I have used the setups as Brock Samson has indicated and it works for me.
I was asking the same question one year ago and I think I've posted somewhere a similar method to Brock Samson's, so it will definitely work.
In fact it will be less hussle if you don't enable internet tethering in settings and just bring usb0 up using ifconfig. You must set a correct IP address and netmask before the port is up though. Otherwise the driver on the PC end will freak out.
Generally Android never uses /etc/resolv.conf. Only console programs originated from Linux use it. DNS server must be set through setprop and has to be set everytime network status changes (e.g. mobile data network reconnect, etc).
Some programs will also use Android API to detect network availability and will back out if neither mobile data nor Wi-Fi is connected, so make sure you don't turn both of them off.
http://forum.xda-developers.com/showthread.php?t=793102

Join Bluetooth PAN as client? (reverse tether)

How can I join an Android device to a Bluetooth PAN (Personal Area Network) as a client? In some areas, the only internet connection available would be to tether it through another cell phone via bluetooth PAN (other phone has no wifi).
Solutions that require rooting or config file editing are OK.
I've searched alot, but all results are about going the other way - tethering other devices through the Android.
Soundman6 said:
How can I join an Android device to a Bluetooth PAN (Personal Area Network) as a client? In some areas, the only internet connection available would be to tether it through another cell phone via bluetooth PAN (other phone has no wifi).
Solutions that require rooting or config file editing are OK.
I've searched alot, but all results are about going the other way - tethering other devices through the Android.
Click to expand...
Click to collapse
It's Linux, man, all you need is setting network config I was using reverse tethering for some time, this is my script (run on PC):
Code:
sudo pand --listen --role NAP
adb shell pand --connect XX:XX:XX:XX:XX:XX
sudo ifconfig bnep0 192.168.101.1
adb shell ifconfig bnep0 down 192.168.101.2 up
adb shell route add default gw 192.168.101.1 dev bnep0
adb shell setprop net.dns1 192.168.101.1
Of course you should omit 1st and 3rd lines.
Are you sure second phone supports PAN connections, not DUN? PAN is quite complicated for phone, because it requires full NAT.
And you will have problems with Android Market and some other apps. Internet is configured at linux level, Android OS don't know about it, so if application asks: "Do we have internet connection?", Android replies: "No". Android Market will wait for connection even if there is one.
Brut.all said:
And you will have problems with Android Market and some other apps. Internet is configured at linux level, Android OS don't know about it, so if application asks: "Do we have internet connection?", Android replies: "No". Android Market will wait for connection even if there is one.
Click to expand...
Click to collapse
I believe that is a valid concern. Anyone know how to deal with this? Thanks.
Soundman6 said:
I believe that is a valid concern. Anyone know how to deal with this? Thanks.
Click to expand...
Click to collapse
But most of the apps don't check internet status and just use it - they will work. AFAIR I couldn't use Market, GTalk and syncing feature, but Browser, Gmail and many, many more was working.
If you have any WiFi device then you could connect Android to it. Even if it doesn't share internet connection, Android OS will think, that it does (but will use BT connection configured at linux level ) - then any app should work.
At work I got a laptop with windows XP, There's a wireless network but it's EAP secured and I can't connect to it with the phone (Motorola Milestone - Android 2.1).
Did you manage to make internet work through Bluetooth PAN? I just need to use the borwser, so It's not important if market or other apps don't work.
I have android sdk with adb on my laptop and terminal emulator with busybox on my phone. I'm kind of a newbie in this so some hints would be nice. I think many people like me would be gratefull
haxxy said:
Has anybody got it working?
At work I got a laptop with windows XP, There's a wireless network but it's EAP secured and I can't connect to it with the phone (Motorola Milestone - Android 2.1).
Did you manage to make internet work through Bluetooth PAN? I just need to use the borwser, so It's not important if market or other apps don't work.
I have android sdk with adb on my laptop and terminal emulator with busybox on my phone. I'm kind of a newbie in this so some hints would be nice. I think many people like me would be gratefull
Click to expand...
Click to collapse
And my first post was about what, you think? I don't use it now, but I was reverse-tethering through BT for several months, until I bought some data plan.
Above commands should work for you, but... they will let you connect your phone to PC, but I don't know, how to share internet connection on Windows XP. AFAIR I tried to do it, but failed.
There's a bluetooth network icon. I know it's possible to share the internet connection from my ethernet to the other network cards. So this should work also with the bluetooth network.
I will try the commands and see how it goes.
haxxy said:
it's possible to share the internet connection from my ethernet to the other network cards. So this should work also with the bluetooth network.
Click to expand...
Click to collapse
Unfortunately not ;-) It is a cost of easy-clicking-configuration that Windows has - it's very limited, don't work for BT connections. I guess there is some professional software for internet sharing on Windows, but I don't know one.
Brut.all said:
Unfortunately not ;-) It is a cost of easy-clicking-configuration that Windows has - it's very limited, don't work for BT connections. I guess there is some professional software for internet sharing on Windows, but I don't know one.
Click to expand...
Click to collapse
I did this with my symbian phone. I managed to share internet to the bluetooth network, but the phone had a bluetooth PAN profile that connected to my laptop.
No! Already I have a bluetooth network set up on my Ubuntu Laptop - pand is running and there is a dhcp server monitoring the interface. What I need is not the below advice, which are commands to run on the PC, but an application / utility / instructions for enabling BLUETOOTH PAN CLIENT on Android. That is what the original question was too! Anybody?
Paul Beardsell
Brut.all said:
It's Linux, man, all you need is setting network config I was using reverse tethering for some time, this is my script (run on PC):
Code:
sudo pand --listen --role NAP
adb shell pand --connect XX:XX:XX:XX:XX:XX
sudo ifconfig bnep0 192.168.101.1
adb shell ifconfig bnep0 down 192.168.101.2 up
adb shell route add default gw 192.168.101.1 dev bnep0
adb shell setprop net.dns1 192.168.101.1
Of course you should omit 1st and 3rd lines.
Are you sure second phone supports PAN connections, not DUN? PAN is quite complicated for phone, because it requires full NAT.
Click to expand...
Click to collapse
psb777 said:
What I need is not the below advice, which are commands to run on the PC, but an application / utility / instructions for enabling BLUETOOTH PAN CLIENT on Android.
Click to expand...
Click to collapse
4 of 6 lines of my instructions were for setting Android client: connecting, setting IP, routing and DNS. And yes, they are run on Android, not on PC - I thought you will notice "adb shell" prefixes... You can also use dhcpcd instead of last 3 lines, but if you don't understand, what are you doing, you will have problems anyway.
Maybe anyone with Froyo can confirm that there's still no official option for joining a Bluetooth PAN from Android there?
@Brut.all So I guess there's currently no way to kind of telling Android there's a configured connection on Linux level?
By the way, every Mac allows the creation of a Bluetooth PAN with one click so this would be my usage scenario ;-)
This seems like it should work, and indeed I can use a similar technique from an ubuntu laptop to connect to another device, but my HTC Hero doesn't seem to have hcitool or pand installed on it. I downloaded some prebuilt binaries for them but they don't seem to be able to access the bluetooth device:
# /data/tmp/pand --role PANU --connect 00:17:83:0F:0F:C7 -n
pand[5083]: Bluetooth PAN daemon version 3.36
pand[5083]: Connecting to 00:17:83:0F:0F:C7
pand[5083]: Connect to 00:17:83:0F:0F:C7 failed. No route to host(113)
Do all versions of Android come with pand and hcitool? I'm on 1.5 although I'll be reflashing to 2.1 soon.
"find / -name pand" yields no results
trphunk said:
Do all versions of Android come with pand and hcitool? I'm on 1.5 although I'll be reflashing to 2.1 soon.
Click to expand...
Click to collapse
No, it was added by rom cookers and I don't know how they did this. I think there are missing some kernel modules or something like that.
trphunk said:
This seems like it should work, and indeed I can use a similar technique from an ubuntu laptop to connect to another device, but my HTC Hero doesn't seem to have hcitool or pand installed on it. I downloaded some prebuilt binaries for them but they don't seem to be able to access the bluetooth device:
# /data/tmp/pand --role PANU --connect 00:17:83:0F:0F:C7 -n
pand[5083]: Bluetooth PAN daemon version 3.36
pand[5083]: Connecting to 00:17:83:0F:0F:C7
pand[5083]: Connect to 00:17:83:0F:0F:C7 failed. No route to host(113)
Do all versions of Android come with pand and hcitool? I'm on 1.5 although I'll be reflashing to 2.1 soon.
"find / -name pand" yields no results
Click to expand...
Click to collapse
Brut.all said:
No, it was added by rom cookers and I don't know how they did this. I think there are missing some kernel modules or something like that.
Click to expand...
Click to collapse
Thanks, I've got the FroydVillain ROM installed now and can confirm that it comes with pand and hcitool compiled and working.
Reverse tether does seem to work, the method that's worked for me has been to use:
Code:
pand --connect <remote BT device hex address>
ifconfig bnep0 down
dhcpcd bnep0
setprop net.dns1 8.8.8.8
This allows the device to access the internet, and you can ping www . google . com and get a response etc.
However, a lot of android apps (including the built-in google apps for gmail etc) use the ConnectivityService (see source code here) to access the net, and since this method of reverse tethering doesn't change the connectivity state within this service, those apps still believe that there is no internet connection on the device.
I can't see an easy way of "tricking" the ConnectivityService as it appears to have been hard coded to only cater for WIFI and 3G connectivity. So perhaps the only way is to rewrite it.
I've found a few cases of others going through the same issues online, although I think the getMobileDataEnabled return value is a red herring:
(I'm not allowed to post links, so you will need to add http : // www to these
superuser.com/questions/188636/close-connect-android-to-internet-using-usb-tether-through-laptops-newtwork
forceclose.com/questions/2669/connect-android-to-internet-using-usb-tether-through-laptops-newtwork
Looking at the code in ConnectivityService.java it seems that apps must subscribe to this service via getInstance() and then wait for a sendConnectedBroadcast() to occur, triggering them into action (e.g. the gmail app will attempt to sync to the gmail server etc).
Anyone got any ideas for an easier route than rewriting ConnectivityService.java to add an additional connectivity type?
Edit to add:
Found another related discussion at the following site. Seems to suggest modifying the ConnectivityService is the way to go:
comments.gmane.org/gmane.comp.handhelds.android.porting/12028
Based on the posts I've seen in this thread, I'm guessing I can't use BlueTooth PAN tethering from my rooted Dinc to provide internet access to a Samsung Galaxy Tab???
So has anyone tried to Bluetooth tether a Galaxy tab with a phone?
Thanks for this thread! I just successfully Tethered both internet+gps over bluetooth from my G1 to my AdventVega tablet.
For now I am using GScript lite with the following script commands:
Code:
pand --connect {my phones BT hex address}
ifconfig bnep0 down
dhcpcd bnep0
setprop net.dns1 8.8.8.8
dhcpcd bnep0
(for some reason the first dhcpcd command always says permission denied, but the last one always works)
So...
1) Get in to car with Android phone and Vega Tablet.
2) On phone: Enable GPS/Bluetooth, click GPS2Bluetooth widget button, click WiFi Tether (configure for BT), press to start tethering.
3) On tablet: Enable Bluetooth, click Bluetooth GPS Provider, click Start, click Back or Home, click GScript Lite, click "Connect to BT-PAN" (above script)
4) Run GoogleMaps/Navigation on tablet and enjoy using your tablet as the ultimate GPS navigation system (while streaming Pandora in the background)!
I am very happy. I just wish I could make step 2 & 3 be a single click instead of so many.
NOTE: Must have "Allow mock locations" enabled in Settings->Applications->Development
NOTE2: You must pair your phone and tablet in BT settings (it will never say "connected" though, which is fine)
I tried this, but still no connection between my android phone and the other phone. Is there some other method?

Motorola Milestone Ad-hoc wifi for the needed

After trying several methods (tiwlan.ini, wpa_supplicant.conf, wpa_supplicant patch) to get my Motorola Milestone to connect to my Laptop's Adhoc wifi network with no success, i finally come up with a solution. Now I am sharing it here hoping it will help those with the same problem.
The idea is to use Barnacle (on Market) to first setup a connection with the laptop, then re-config it to make the sharing work in the reverse direction.
Steps are as followed:
1. Start Barnacle (you may check "Local Mode" in Settings to go ahead without a data connection in phone), then connect your laptop to the wireless network it creates (named milestones or so). After this step, your phone's IP will be something like :192.168.5.1, and your Laptop's IP will be something like: 192.168.5.100
2. Start sharing your data connection from Laptop, in doing that, your Laptop's IP will be forcibly set to 192.168.0.1 (yours may be different, just note that this IP will be used as default gateway we use in the next step)
3. Now the configuration part:
//Start adb shell by entering at Cmd prompt
adb shell
$
su
#
//mannualy set IP for your phone, can be anything in form of 192.168.0.xxx
# ifconfig tiwlan0 192.168.0.2 netmask 255.255.255.0
//manually set the default gateway of the phone to the Laptop's IP at this time
# route add default gw 192.168.0.1 dev tiwlan0
After these steps, the phone can access the internet via the Laptop's connection. We will complete the remaining by manually specifying a DNS for the phone
# setprop net.dns1 #.#.#.# (here you should replace the #.#.#.# to a known IP address of your ISP's DNS, in worst case you may use Google's DNS)
//Now test with ping to see if we receive any response:
# ping -c 4 192.168.0.1 => the Laptop should answer
# ping -c 4 191.168.0.2 => phone are pinging itself, the phone should answer
# ping -c 4 209.85.175.106 => some server in the Internet should answer
# ping -c 4 www dot google dot com => Google should answer
If the tests above are all OK, you are done, enjoy the internet from your phone !
have tried :
+ Mail OK
+ Browser OK
+ Internet radio OK
+ Market nearly OK (in here the app browsing is OK, but download seem stuck)
Please confirm your result,
Codelavie
not working. i follow your guide exactly, but it didn't work. how can you do that? where am i wrong?
Didn't work for me either. After quite a hard experience I've managed to compile a wpa_supplicant with adhoc support for Milestone 2.1-update1 after applying szym's patch, and so far it works fine. The only thing you need to do is substituting the original system/bin/wpa_supplicant for the patched one, and restart wifi. I cant post the link yet because I'm new in the forums, but I'll post it as soon as i can.

[Q] moto g - using PC broadband on moto g

Hi,
I own a moto g and I have a broadband connection on my PC. Is there any way I use that to access internet on my moto g ?
If there is please explain.
Thanks & Regards
Gilagamesh
gilagamesh said:
Hi,
I own a moto g and I have a broadband connection on my PC. Is there any way I use that to access internet on my moto g ?
If there is please explain.
Thanks & Regards
Gilagamesh
Click to expand...
Click to collapse
do you have a desktop or a laptop ..
if desktop then you should try some apps like reverse USB tethering ..which are very simple to use ..
there are too many apps like this which you can find on the play store ..
Sent from my GT-I9300 using XDA Premium 4 mobile app
Thru Ethernet cable? If so change your modem to WiFi modem if using from data card use WiFi dongle search ebay
Sent from my XT1033 using Tapatalk
Well if you are on laptop...you can use this software known as Connectify to set up a Hotspot on ur laptop
You can do that with a wifi adapter on a PC too
jaspreet997 said:
Well if you are on laptop...you can use this software known as Connectify to set up a Hotspot on ur laptop
You can do that with a wifi adapter on a PC too
Click to expand...
Click to collapse
By the way I am using a Desktop PC and I don't have a Wifi adapter. But can't I use usb cables for connecting internet on my mobile? I that mandatory that I purchase a Wifi adapter?
gilagamesh said:
By the way I am using a Desktop PC and I don't have a Wifi adapter. But can't I use usb cables for connecting internet on my mobile? I that mandatory that I purchase a Wifi adapter?
Click to expand...
Click to collapse
Not at all
There are some reverse tethering apps to get ur pc's internet just by USB cable but they need a rooted phone!
Search on play store " reverse tethering"
If you don't wanna root....invest in a router...they are pretty cheap nowdays!
Sent from Samsung Chat
@gilagamesh
You can do it without using any apps ...u just have to enter some commands in ur PC and ur phone by terminal emulator.. Will help u PM me..
NOTE:: Root is required .
Sent from my XT1033 using xda premium
You can setup an ad hoc wifi network and share the internet connection to connected devices.
You can do it using the Control Panel or using the CMD.
In Windows 8 this functionality ist not available anymore using the GUI.
These commands should work on all windows pc's.
Replace ssid and key with your own if wanted.
Remember to open CMD with admin rights.
To configure adhoc network typ in CMD:
netsh wlan set hostednetwork mode=allow ssid=NameForMyNetwork key=MySecurityKey
Click to expand...
Click to collapse
To start adhoc network type in CMD:
netsh wlan start hostednetwork
Click to expand...
Click to collapse
To stop adhoc network type in CMD:
netsh wlan stop hostednetwork
Click to expand...
Click to collapse
Open properties of your network adapter on PC and you'll find an option to share the internet connection of connected devices of the specific adapter.
Connect your Android over wifi to your PC, voila, you should be done if i did not forget something.......
EDIT:
Aaaargh.....just saw it by reading it the thread a second time....you have no wifi.
But anyway, maybe it helps somebody else.
mokkami said:
You can setup an ad hoc wifi network and share the internet connection to connected devices.
You can do it using the Control Panel or using the CMD.
In Windows 8 this functionality ist not available anymore using the GUI.
These commands should work on all windows pc's.
Replace ssid and key with your own if wanted.
Remember to open CMD with admin rights.
To configure adhoc network typ in CMD:
To start adhoc network type in CMD:
To stop adhoc network type in CMD:
Open properties of your network adapter on PC and you'll find an option to share the internet connection of connected devices of the specific adapter.
Connect your Android over wifi to your PC, voila, you should be done if i did not forget something.......
EDIT:
Aaaargh.....just saw it by reading it the thread a second time....you have no wifi.
But anyway, maybe it helps somebody else.
Click to expand...
Click to collapse
A simpler way to go at it is a software called Connectify....completely gui based...I used to use it all the time on my laptop.....works on windows xp sp3 and up....
Sent from Samsung Chat
@mokkami
This is to create a wifi hotspot ...and as i see the person is using a desktop he might not have a wifi card...and even if u dn have wireless network connection 2 adapter you would notbe able to even create Wifi hotspot from a laptop ....and it does need service pack3 for windows 7
---------- Post added at 02:27 PM ---------- Previous post was at 02:23 PM ----------
I Dont remember the original thread but here are the contents i got fromthat link a while ago...
@gilagamesh
Step 1: Connect your Android to PC by USB cable and enable "USB tethering". You are still allowed to enable this option even when your 3g/wifi on your Android is off.
- If you are using Linux (Ubuntu), you don't need to install anything. NetworkManager applet will try to establish a connection on the new detected wired network device.
- If you are using Windows, 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, and choose Remote NDIS Compatible Device from the right column. You can install or update a driver from Device Manager in Windows.
- If you are using Mac, install driver HoRNDIS. You will be notified about a new network interface. Click "Network Preferences" in the dialog to add it to known interfaces list. Then "Apply".
- If you are using Linux without GUI or NetworkManager, run these commands as root (or use sudo):
Code:
ifconfig usb0 10.42.0.1 netmask 255.255.255.0
(suppose that you don't have any other USB network adapter, otherwise, your Android may be usb1, usb2...)
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
Command for sudo will be:
Code:
sudo 'echo 1 > /proc/sys/net/ipv4/ip_forward'
Code:
iptables -t nat -F
iptables -t nat -A POSTROUTING -j MASQUERADE
Step 2:
- If you are using Linux, click on NetworkManager applet at the top right of your screen, select "Edit Connections...". In tab "Wired", choose the new established connection (be careful, not Ethernet LAN connection) and click "Edit..." In tab "IPv4 Settings", choose "Shared to other computers" as Method. Click "Save". NetworkManager will reestablish the connection and assign to your PC an IP address on this USB network connection, default: 10.42.0.1. Leave Internet connections (wired or wireless) untouched.
- If you are using Windows, open "Network Connections" in Control Panel. It is somewhat different from setup in Linux. Right click on an Internet connection that you have. I assume that you are using a desktop which doesn't have any wifi adapter, so right click on LAN Ethernet connection with Internet, and 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".
- If you are using Mac, open System Preferences - Network. If you installed HoRNDIS, you will see a new network interface corresponding to your USB connection. With "Using DHCP" as Configure Ipv4, it may be already connected. Go back to System Preferences, click "Sharing". Select "Internet Sharing". Choose the Internet connection (Ethernet or Airport...) in "Share your connection from", and choose USB connection interface in "To computers using". Mac will assign to your USB connection interface an IP address, default: 192.168.2.1.
- If you are using Linux without GUI or NetworkManager, you have done all PC setup in step 1.
Your PC setup is now done!
Step 3:
Open Terminal Emulator on your Android. Type:
Code:
su
The command prompt must change from $ to #. If it does not, check to ensure that your device is rooted properly.
[UPDATED]Type the following command in Terminal Emulator, the same for all PC operating systems:
Code:
netcfg rndis0 dhcp
The name for usb interface inside Android may vary. It is usually rndis0 or usb0. Type
Code:
busybox ifconfig
to identify the name.
Use OLD instructions below when automatical dhcp method does not work.
[OLD]Type these following commands in Terminal Emulator:
For Linux PC:
Code:
ifconfig rndis0 10.42.0.2 netmask 255.255.255.0
route add default gw 10.42.0.1 dev rndis0
If route fails, try:
Code:
busybox route add default gw 10.42.0.1 dev rndis0
For Windows PC, use the same above commands, replace 10.42.0.2 by 192.168.137.2 (192.168.0.2 for Windows XP), replace 10.42.0.1 by 192.168.137.1 (192.168.0.1 for Windows XP)
For Mac PC, replace 10.42.0.2 by 192.168.2.2, replace 10.42.0.1 by 192.168.2.1
Now you can close Terminal Emulator and start the browser for Internet.
Some applications (download in Google Play, GMail, Facebook...) don't recognize Internet connection. You can try this way (WARNING: NOT TESTED):
- Enable temporarily 3G connection on your Android
- Type:
Code:
ifconfig rmnet0 0.0.0.0
The name for 3G interface inside Android may vary: ppp0, rmnet0... Type
Code:
busybox ifconfig
to identify the name.
before ifconfig rmnet0 ... above.
This will make applications see your Internet connection via USB as 3G!
And it works !!!
Yes it is to create a hotspot. And i wrote already that i read it to late that he has no wifi available.
prachetas13 said:
and even if u dn have wireless network connection 2 adapter you would notbe able to even create Wifi hotspot from a laptop
Click to expand...
Click to collapse
I do not understand what you mean. I created a wifi hotspot sucessfully on my netbook which was also connected via network cable.
mokkami said:
Yes it is to create a hotspot. And i wrote already that i read it to late that he has no wifi available.
I do not understand what you mean. I created a wifi hotspot sucessfully on my netbook which was also connected via network cable.
Click to expand...
Click to collapse
Its like most of them dn have those adapters ...i have thinkpad L430 but nt able to share internet ...but on my dell laptop it was easier ...i havetried a lot but netsh wlan commands doesnot work ...not even by connectify ...in the other hand it works good on my other laptop ...
well not losing the oroginal topic ...i have provided a method of reverse tethering ..

Categories

Resources