* Re: [gentoo-user] Reverse Tethering - How to?
2014-09-17 9:53 ` Helmut Jarausch
@ 2014-09-17 10:14 ` J. Roeleveld
2014-09-17 11:34 ` Mick
2014-09-17 11:05 ` Stroller
` (2 subsequent siblings)
3 siblings, 1 reply; 17+ messages in thread
From: J. Roeleveld @ 2014-09-17 10:14 UTC (permalink / raw
To: gentoo-user
On Wednesday, September 17, 2014 11:53:52 AM Helmut Jarausch wrote:
> On 09/17/2014 11:50:58 AM, J. Roeleveld wrote:
> > On Wednesday, September 17, 2014 11:46:12 AM Helmut Jarausch wrote:
> > > On 09/17/2014 11:43:28 AM, J. Roeleveld wrote:
> > > > On Wednesday, September 17, 2014 11:24:36 AM Helmut Jarausch
> >
> > wrote:
> > > > > Hi,
> > > > >
> > > > > how do I need to configure my Gentoo box to allow for reverse
> > > >
> > > > tethering
> > > >
> > > > > from my (rooted) Android phone?
> > > > >
> > > > > Many thanks for a hint,
> > > > > Helmut
> > > >
> > > > What do you mean with "reverse tethering"?
> > > > That your mobile uses the network connection of your Gentoo box,
> >
> > or
> >
> > > > your
> > > > Gentoo box the network connection of your mobile?
> > >
> > > My mobile should be able to use the (wired) network connection of my
> > > Gentoo box.
> >
> > Ok, I assumed that was the case, but wanted to be sure.
> >
> > > > Generally, the device sharing the connection needs to play WIFI
> > > > Access Point.
> > >
> > > How to do that on Gentoo?
> >
> > If your Gentoo box has a wired connection and a wireless one.
> > The wired is currently used and the wireless is not.
> > Then you need to get your wireless card to function as an access
> > point.
> > (Google for "Gentoo Linux Howto WIFI Access Point" or similar) and
> > you should
> > find some information on how to do this.
>
> I should have made it more clear.
> My GenToo box doesn't have a wireless card.
> I'd like to connect my mobile to the USB port of my Gentoo box and get
> access
> to the (wired) network.
There I can not help.
I am not aware of Android supporting that option.
Linux might be able to, if the USB connection acts like a NIC. But the phone
needs to then use the USB line for it's own internet link.
You might want to check on Android forums to see if anyone there has done it.
--
Joost
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Reverse Tethering - How to?
2014-09-17 10:14 ` J. Roeleveld
@ 2014-09-17 11:34 ` Mick
0 siblings, 0 replies; 17+ messages in thread
From: Mick @ 2014-09-17 11:34 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: Text/Plain, Size: 3330 bytes --]
On Wednesday 17 Sep 2014 11:14:28 J. Roeleveld wrote:
> On Wednesday, September 17, 2014 11:53:52 AM Helmut Jarausch wrote:
> > On 09/17/2014 11:50:58 AM, J. Roeleveld wrote:
> > > On Wednesday, September 17, 2014 11:46:12 AM Helmut Jarausch wrote:
> > > > On 09/17/2014 11:43:28 AM, J. Roeleveld wrote:
> > > > > On Wednesday, September 17, 2014 11:24:36 AM Helmut Jarausch
> > >
> > > wrote:
> > > > > > Hi,
> > > > > >
> > > > > > how do I need to configure my Gentoo box to allow for reverse
> > > > >
> > > > > tethering
> > > > >
> > > > > > from my (rooted) Android phone?
> > > > > >
> > > > > > Many thanks for a hint,
> > > > > > Helmut
> > > > >
> > > > > What do you mean with "reverse tethering"?
> > > > > That your mobile uses the network connection of your Gentoo box,
> > >
> > > or
> > >
> > > > > your
> > > > > Gentoo box the network connection of your mobile?
> > > >
> > > > My mobile should be able to use the (wired) network connection of my
> > > > Gentoo box.
> > >
> > > Ok, I assumed that was the case, but wanted to be sure.
> > >
> > > > > Generally, the device sharing the connection needs to play WIFI
> > > > > Access Point.
> > > >
> > > > How to do that on Gentoo?
> > >
> > > If your Gentoo box has a wired connection and a wireless one.
> > > The wired is currently used and the wireless is not.
> > > Then you need to get your wireless card to function as an access
> > > point.
> > > (Google for "Gentoo Linux Howto WIFI Access Point" or similar) and
> > > you should
> > > find some information on how to do this.
> >
> > I should have made it more clear.
> > My GenToo box doesn't have a wireless card.
> > I'd like to connect my mobile to the USB port of my Gentoo box and get
> > access
> > to the (wired) network.
>
> There I can not help.
> I am not aware of Android supporting that option.
> Linux might be able to, if the USB connection acts like a NIC. But the
> phone needs to then use the USB line for it's own internet link.
>
> You might want to check on Android forums to see if anyone there has done
> it.
Unless anyone suggests differently, I have tried something similar, using a
different device with IrDa, years ago. As far as the Linux PC is concerned it
needs to be able to forward packets from the Android to the ethernet NIC.
That's a case of setting up packet forwarding as if the Linux box were a
NATing router. Going from memory and assuming that your Android shows up as
usb0, when you run ifocnfig -a, you can try something like this:
ifconfig usb0 172.16.1.1 netmask 255.255.255.0
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -F
iptables -t nat -A POSTROUTING -j MASQUERADE
Then on the Android you will need to have enabled the USB tethering or some
such and use ifconfig or equivalent to set up an IP address within the above
IP subnet and your PC's 172.16.1.1 address as the gateway. I think that the
Android may use rndis0 as a network interface but I'm not sure and don't have
access to an android device to check.
I seem to recall tightening up the iptables rules after I got it to work, so
that only the particular incoming device would be forwarded to the Internet,
but details presently escape me.
HTH.
--
Regards,
Mick
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Reverse Tethering - How to?
2014-09-17 9:53 ` Helmut Jarausch
2014-09-17 10:14 ` J. Roeleveld
@ 2014-09-17 11:05 ` Stroller
2014-09-17 11:31 ` J. Roeleveld
2014-09-17 12:31 ` [gentoo-user] " James
2014-09-26 10:24 ` [gentoo-user] " Guillaume Poulin
3 siblings, 1 reply; 17+ messages in thread
From: Stroller @ 2014-09-17 11:05 UTC (permalink / raw
To: gentoo-user
On Wed, 17 September 2014, at 10:53 am, Helmut Jarausch <jarausch@igpm.rwth-aachen.de> wrote:
> …
>>> My mobile should be able to use the (wired) network connection of my Gentoo box.
>
> My GenToo box doesn't have a wireless card.
> I'd like to connect my mobile to the USB port of my Gentoo box and get access
> to the (wired) network.
I'm sure this must be possible.
Isn't it a standard thing to connect laptop and phone by USB and share the phone's 3G connection with the laptop?
This document seems to describe that setup: http://wiki.gentoo.org/wiki/Android_USB_Tethering
In this case the USB is being used as an ethernet connection - you're simply asking for the routing to occur in the opposite direction.
Loads of hits on Google for "tether android usb".
Stroller.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Reverse Tethering - How to?
2014-09-17 11:05 ` Stroller
@ 2014-09-17 11:31 ` J. Roeleveld
2014-09-18 11:41 ` Stroller
0 siblings, 1 reply; 17+ messages in thread
From: J. Roeleveld @ 2014-09-17 11:31 UTC (permalink / raw
To: gentoo-user
On Wednesday, September 17, 2014 12:05:37 PM Stroller wrote:
> On Wed, 17 September 2014, at 10:53 am, Helmut Jarausch <jarausch@igpm.rwth-
aachen.de> wrote:
> > …
> >
> >>> My mobile should be able to use the (wired) network connection of my
> >>> Gentoo box.>
> > My GenToo box doesn't have a wireless card.
> > I'd like to connect my mobile to the USB port of my Gentoo box and get
> > access to the (wired) network.
>
> I'm sure this must be possible.
>
> Isn't it a standard thing to connect laptop and phone by USB and share the
> phone's 3G connection with the laptop?
>
> This document seems to describe that setup:
> http://wiki.gentoo.org/wiki/Android_USB_Tethering
>
> In this case the USB is being used as an ethernet connection - you're simply
> asking for the routing to occur in the opposite direction.
>
> Loads of hits on Google for "tether android usb".
>
> Stroller.
Stroller,
Helmut is trying to do the opposite.
He wants the mobile phone to use the internet connection of his desktop.
--
Joost
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Reverse Tethering - How to?
2014-09-17 11:31 ` J. Roeleveld
@ 2014-09-18 11:41 ` Stroller
2014-09-18 12:57 ` J. Roeleveld
0 siblings, 1 reply; 17+ messages in thread
From: Stroller @ 2014-09-18 11:41 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1379 bytes --]
On Wed, 17 September 2014, at 12:31 pm, J. Roeleveld <joost@antarean.org> wrote:
>> ...
>> In this case the USB is being used as an ethernet connection - you're simply
>> asking for the routing to occur in the opposite direction.
>
> Helmut is trying to do the opposite.
> He wants the mobile phone to use the internet connection of his desktop.
That's what I wrote - that he's "simply asking for the routing to occur in the opposite direction".
My Android appears to allow networking over its USB connection in both directions - I attach two screenshots.
The first attached screenshot is of the "Wireless and networks" menu, which is accessed directly from "Settings".
As you can see there is a "Tethering & portable hotspot" submenu (second attached screenshot), but at the bottom there is also a tickbox "USB Internet - Sharing Windows PC internet via USB cable".
If you look also at the second attached screenshot, "Tethering & portable hotspot", you will see that "USB tethering - USB connected, tick to tether" is a separate menu item.
When I initially read your email and glanced at my phone, the "Sharing Windows PC internet via USB cable" item was greyed out. The words became solid when I plugged the USB cable in. I have not tested it further, but I have to assume that these two menu options perform reciprocal functions.
Stroller.
[-- Attachment #2.1: Type: text/html, Size: 2224 bytes --]
[-- Attachment #2.2: 1 - Wireless and networks menu.png --]
[-- Type: image/png, Size: 37076 bytes --]
[-- Attachment #2.3: 2 - Tethering and portable hotspot menu.png --]
[-- Type: image/png, Size: 30959 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Reverse Tethering - How to?
2014-09-18 11:41 ` Stroller
@ 2014-09-18 12:57 ` J. Roeleveld
2014-09-18 13:59 ` Stroller
2014-09-18 14:00 ` Peter Humphrey
0 siblings, 2 replies; 17+ messages in thread
From: J. Roeleveld @ 2014-09-18 12:57 UTC (permalink / raw
To: gentoo-user
On Thursday, September 18, 2014 12:41:52 PM Stroller wrote:
> On Wed, 17 September 2014, at 12:31 pm, J. Roeleveld <joost@antarean.org>
wrote:
> >> ...
> >> In this case the USB is being used as an ethernet connection - you're
> >> simply asking for the routing to occur in the opposite direction.
> >
> > Helmut is trying to do the opposite.
> > He wants the mobile phone to use the internet connection of his desktop.
>
> That's what I wrote - that he's "simply asking for the routing to occur in
> the opposite direction".
>
> My Android appears to allow networking over its USB connection in both
> directions - I attach two screenshots.
>
> The first attached screenshot is of the "Wireless and networks" menu, which
> is accessed directly from "Settings".
>
> As you can see there is a "Tethering & portable hotspot" submenu (second
> attached screenshot), but at the bottom there is also a tickbox "USB
> Internet - Sharing Windows PC internet via USB cable".
>
> If you look also at the second attached screenshot, "Tethering & portable
> hotspot", you will see that "USB tethering - USB connected, tick to tether"
> is a separate menu item.
>
> When I initially read your email and glanced at my phone, the "Sharing
> Windows PC internet via USB cable" item was greyed out. The words became
> solid when I plugged the USB cable in. I have not tested it further, but I
> have to assume that these two menu options perform reciprocal functions.
Which phone is that?
On my Galaxy S4, that option does not exist. Not even when connected via USB.
--
Joost
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Reverse Tethering - How to?
2014-09-18 12:57 ` J. Roeleveld
@ 2014-09-18 13:59 ` Stroller
2014-09-18 14:00 ` Peter Humphrey
1 sibling, 0 replies; 17+ messages in thread
From: Stroller @ 2014-09-18 13:59 UTC (permalink / raw
To: gentoo-user
On Thu, 18 September 2014, at 1:57 pm, J. Roeleveld <joost@antarean.org> wrote:
>> ...
>> My Android appears to allow networking over its USB connection in both
>> directions - I attach two screenshots.
>> ...
>
> Which phone is that?
>
> On my Galaxy S4, that option does not exist. Not even when connected via USB.
THL W200, a Chinese cheapie.
I would guess that its version of Android (4.2.1) is pretty vanilla.
I would also guess that there are apps to enable reverse tethering if it's commonly disabled or unavailable - if you can run TCP/IP over the USB cable one way, then it's only a network setting or two to run it the other way.
Stroller.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Reverse Tethering - How to?
2014-09-18 12:57 ` J. Roeleveld
2014-09-18 13:59 ` Stroller
@ 2014-09-18 14:00 ` Peter Humphrey
1 sibling, 0 replies; 17+ messages in thread
From: Peter Humphrey @ 2014-09-18 14:00 UTC (permalink / raw
To: gentoo-user
On Thursday 18 September 2014 14:57:13 J. Roeleveld wrote:
> On my Galaxy S4, that option does not exist. Not even when connected via
> USB.
It's present on my Nexus 5, but it's under Settings > More... (in the Wireless
& Networks section of Settings) > Tethering & portable hotspot.
--
Regards
Peter
^ permalink raw reply [flat|nested] 17+ messages in thread
* [gentoo-user] Re: Reverse Tethering - How to?
2014-09-17 9:53 ` Helmut Jarausch
2014-09-17 10:14 ` J. Roeleveld
2014-09-17 11:05 ` Stroller
@ 2014-09-17 12:31 ` James
2014-09-17 13:35 ` Mick
2014-09-26 10:24 ` [gentoo-user] " Guillaume Poulin
3 siblings, 1 reply; 17+ messages in thread
From: James @ 2014-09-17 12:31 UTC (permalink / raw
To: gentoo-user
Helmut Jarausch <jarausch <at> igpm.rwth-aachen.de> writes:
> > > > > how do I need to configure my Gentoo box to allow for reverse
> > > > tethering from my (rooted) Android phone?
PPP over usb is the most probable route. PPP is basically
TCP/IP (usually over a serial link/prototol_carrier).
This might help: "How to set up Android ppp over usb with adb"
http://www.xinotes.net/notes/note/1500/
You still ahve to set up NAT ont he linux box, probable with
iptalbes. MIcks post looks reasonable, but there may (will)
be addtional issues; just flesh them out, one at a time.
All of this over a serial (RS232_C) link between the phone
and the PC is old stuff and may best to get working first,
then migrate it over USB.
Also find a good usb_sniffer so you can ensure the bits are bidirectional
across the usb ports.
Last. There is a "GentRoid" project and I'm quite certain that (gentoo)
embeded dude, will be a fantastic resource, if all else fails.
Also one of the main devs for Selinux (Russell Coker) is a great
help as he has wrote of the early Selinux and put it on an Android phone.
It takes him a while to respond, but that info might aid your google
searches for solutions too. Use Russell as a last resort.
PPP/USB is what you are talking about. USB chips confiturations
inside a specific Android phone, might be limited (locked to keep
cpu cycles down) so you might also have to find an app that allows
you to "change settings" on the usb port on your Android phone. You
may have to "root" your Android phone to get this working.....
Last, you might have to "tweak" your gentoo linux kernel (usb, ppp,
iptables) etc etc. It'd be great when you get it working to put
something up on wiki.gentoo.org.
good hunting!
James
PS: my challenge word, via gmane posting, today is "posers"
I guess gmane knows today is an *ebuild hackfest day* for me....
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Re: Reverse Tethering - How to?
2014-09-17 12:31 ` [gentoo-user] " James
@ 2014-09-17 13:35 ` Mick
0 siblings, 0 replies; 17+ messages in thread
From: Mick @ 2014-09-17 13:35 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: Text/Plain, Size: 2558 bytes --]
On Wednesday 17 Sep 2014 13:31:53 James wrote:
> Helmut Jarausch <jarausch <at> igpm.rwth-aachen.de> writes:
> > > > > > how do I need to configure my Gentoo box to allow for reverse
> > > > >
> > > > > tethering from my (rooted) Android phone?
>
> PPP over usb is the most probable route. PPP is basically
> TCP/IP (usually over a serial link/prototol_carrier).
> This might help: "How to set up Android ppp over usb with adb"
>
> http://www.xinotes.net/notes/note/1500/
>
> You still ahve to set up NAT ont he linux box, probable with
> iptalbes. MIcks post looks reasonable, but there may (will)
> be addtional issues; just flesh them out, one at a time.
>
> All of this over a serial (RS232_C) link between the phone
> and the PC is old stuff and may best to get working first,
> then migrate it over USB.
>
>
> Also find a good usb_sniffer so you can ensure the bits are bidirectional
> across the usb ports.
>
> Last. There is a "GentRoid" project and I'm quite certain that (gentoo)
> embeded dude, will be a fantastic resource, if all else fails.
>
> Also one of the main devs for Selinux (Russell Coker) is a great
> help as he has wrote of the early Selinux and put it on an Android phone.
> It takes him a while to respond, but that info might aid your google
> searches for solutions too. Use Russell as a last resort.
>
> PPP/USB is what you are talking about. USB chips confiturations
> inside a specific Android phone, might be limited (locked to keep
> cpu cycles down) so you might also have to find an app that allows
> you to "change settings" on the usb port on your Android phone. You
> may have to "root" your Android phone to get this working.....
>
>
> Last, you might have to "tweak" your gentoo linux kernel (usb, ppp,
> iptables) etc etc. It'd be great when you get it working to put
> something up on wiki.gentoo.org.
>
>
> good hunting!
> James
>
> PS: my challenge word, via gmane posting, today is "posers"
> I guess gmane knows today is an *ebuild hackfest day* for me....
PPP would be necessary if authentication, compression, et al. is required, but
I think that in this case none of this is necessary, at least as far as the
Linux PC is concerned. The incoming usb0 interface (or whatever the Android
is recognised as) will be seen as an ethernet interface by the PC and good ol'
NAT will forward it out via the PC's default NIC. I could be wrong, but
without access to Helmut's phone I can't speak with any certainty.
--
Regards,
Mick
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Reverse Tethering - How to?
2014-09-17 9:53 ` Helmut Jarausch
` (2 preceding siblings ...)
2014-09-17 12:31 ` [gentoo-user] " James
@ 2014-09-26 10:24 ` Guillaume Poulin
3 siblings, 0 replies; 17+ messages in thread
From: Guillaume Poulin @ 2014-09-26 10:24 UTC (permalink / raw
To: gentoo-user
2014-09-17 17:53 GMT+08:00 Helmut Jarausch <jarausch@igpm.rwth-aachen.de>:
> On 09/17/2014 11:50:58 AM, J. Roeleveld wrote:
>>
>>
>> On Wednesday, September 17, 2014 11:46:12 AM Helmut Jarausch wrote:
>> > On 09/17/2014 11:43:28 AM, J. Roeleveld wrote:
>> > > On Wednesday, September 17, 2014 11:24:36 AM Helmut Jarausch wrote:
>> > > > Hi,
>> > > >
>> > > > how do I need to configure my Gentoo box to allow for reverse
>> > >
>> > > tethering
>> > >
>> > > > from my (rooted) Android phone?
>> > > >
>> > > > Many thanks for a hint,
>> > > > Helmut
>> > >
>> > > What do you mean with "reverse tethering"?
>> > > That your mobile uses the network connection of your Gentoo box, or
>> > > your
>> > > Gentoo box the network connection of your mobile?
>> >
>> > My mobile should be able to use the (wired) network connection of my
>> > Gentoo box.
>>
>> Ok, I assumed that was the case, but wanted to be sure.
>>
>> > > Generally, the device sharing the connection needs to play WIFI
>> > > Access Point.
>> >
>> > How to do that on Gentoo?
>>
>> If your Gentoo box has a wired connection and a wireless one.
>> The wired is currently used and the wireless is not.
>> Then you need to get your wireless card to function as an access point.
>> (Google for "Gentoo Linux Howto WIFI Access Point" or similar) and you
>> should
>> find some information on how to do this.
>>
>
> I should have made it more clear.
> My GenToo box doesn't have a wireless card.
> I'd like to connect my mobile to the USB port of my Gentoo box and get
> access
> to the (wired) network.
>
> Thanks,
> Helmut
>
>
I had the same issue. I wrote a small script for that. If my memory is
good, it was working pretty good apart for the google play (don't
remember the reason thou).
```
#!/bin/bash
ifconfig usb0 192.168.42.135 up
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
adb start-server
adb shell su -c '/system/xbin/busybox ifconfig usb0 192.168.42.130 up'
adb shell su -c '/system/xbin/busybox route add -net default gw
192.168.42.135 usb0'
adb shell su -c 'setprop net.dns1 8.8.8.8'
adb shell su -c 'setprop net.dns2 8.8.8.4'
```
^ permalink raw reply [flat|nested] 17+ messages in thread