From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A9D8413838B for ; Fri, 26 Sep 2014 10:24:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 935ACE0B15; Fri, 26 Sep 2014 10:24:22 +0000 (UTC) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2726BE09D6 for ; Fri, 26 Sep 2014 10:24:20 +0000 (UTC) Received: by mail-lb0-f170.google.com with SMTP id n15so2506170lbi.29 for ; Fri, 26 Sep 2014 03:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ZDeEzwraAuMPBQ76GtNdoCiLFNJ901fuRP7s7E1IsJc=; b=uztUXnTt75jsjUrsO9qly7OA9e9VzFlEJw01tkHb6WTpyKBgHNumX4a20vOKdqwM+f H1nMx9KMi5EBI04iu4S4u4S77H+AXX0swDKMlcFIGQZ4p99r8wrQHGuGFbWKVZQUF+Ze ZRvEXzWT5ddBUHwl+MKo2XIRg+mmBn1ddvCUI2Ba+JQY7GIHs7XjRweVLy7M+DCumh+k CUUpi5/SpdgHGOPdpJiL7Etah1yW3355X3Dp+N8oep0XBA7aae6qowSIh9bqVLAHnLXT kkxyFWE3QRPFX0bSGDBrZrSuz2fn12idUpqhul6Yxe5euIOAPIjBfjT9AczFaYQ/1eXx BTig== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 X-Received: by 10.112.218.70 with SMTP id pe6mr17477941lbc.65.1411727059373; Fri, 26 Sep 2014 03:24:19 -0700 (PDT) Received: by 10.25.137.3 with HTTP; Fri, 26 Sep 2014 03:24:19 -0700 (PDT) In-Reply-To: <1410947632.17613.4@numa-i> References: <1410945876.17613.2@numa-i> <108536650.T1azNxT1uh@andromeda> <1410947172.17613.3@numa-i> <4164351.texlbgRvRi@andromeda> <1410947632.17613.4@numa-i> Date: Fri, 26 Sep 2014 18:24:19 +0800 Message-ID: Subject: Re: [gentoo-user] Reverse Tethering - How to? From: Guillaume Poulin To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 X-Archives-Salt: 853ef0bf-2b36-4743-8a67-58b5babb0bd4 X-Archives-Hash: 14e7fa80dc0440e684740e3b0eb97005 2014-09-17 17:53 GMT+08:00 Helmut Jarausch : > 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' ```