2014-09-17 17:53 GMT+08:00 Helmut Jarausch <jarau...@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'
```

Reply via email to