tethering eth0 interface

245 views
Skip to first unread message

Pavan Savoy

unread,
Mar 15, 2011, 7:31:39 AM3/15/11
to android-porting
I am trying (what others have already done) - i.e to tether other
interfaces via the eth0 interface.
i.e to share the eth0 interface unlike the current 3G/GPRS (ppp0 interface).

But I am trying to do that from the framework - Tethering.java
As I understand - The lower layer NETD @ /system/netd/ doesn't put a
restriction as to which interface can be shared.

So when currently I enable USB tethering - which module is placing a
restriction to use the 3G/GPRS connection or the ppp0 interface?
I want modify the framework (say add a new menu entry under some
BoardConfig.mk macro - if BOARD_HAVE_ETHERNET) and
allow the usb0 or the wifi0 to tether the local eth0 connection ...

So, please provide some pointers - as to which modules forces usage of
ppp0 interface,
and is it possible to set up the Tethering via frameworks - without
writing a new EtherController.cpp sort of handler for NETD (Since I
don't think anything is necessary to be done to setup eth0 to start
sharing...)

Thanks & Regards,
--
--Pavan Savoy

Robert Greenwalt

unread,
Mar 15, 2011, 12:31:30 PM3/15/11
to pavan...@gmail.com, android-porting
Did you add "eth\d" to config_tether_upstream_regexs in framework/base/core/res/res/values/config.xml?

Tethering.java uses that to decide what it can tether to.  You shouldn't have to modify code to make this work.


Robert Greenwalt

unread,
Mar 15, 2011, 12:40:40 PM3/15/11
to Narseo Vallina Rodriguez, pavan...@gmail.com, android-porting
Sure - if you have network access over bluetooth you could tether other devices via cable or wifi and share the link.  BT links are pretty slow though.

R

On Tue, Mar 15, 2011 at 9:36 AM, Narseo Vallina Rodriguez <nar...@gmail.com> wrote:
Might be possible to follow this approach to tether via Bluetooth as well?
--
Narseo

Pavan Savoy

unread,
Mar 15, 2011, 12:54:23 PM3/15/11
to Robert Greenwalt, Narseo Vallina Rodriguez, android-porting
On Tue, Mar 15, 2011 at 10:10 PM, Robert Greenwalt

<rgree...@google.com> wrote:
> Sure - if you have network access over bluetooth you could tether other
> devices via cable or wifi and share the link.  BT links are pretty slow
> though.
> R
>
> On Tue, Mar 15, 2011 at 9:36 AM, Narseo Vallina Rodriguez <nar...@gmail.com>
> wrote:
>>
>> Might be possible to follow this approach to tether via Bluetooth as well?
>>
>> On Tue, Mar 15, 2011 at 4:31 PM, Robert Greenwalt <rgree...@google.com>
>> wrote:
>> > Did you add "eth\d" to config_tether_upstream_regexs in
>> > framework/base/core/res/res/values/config.xml?
>> > Tethering.java uses that to decide what it can tether to.  You shouldn't
>> > have to modify code to make this work.

So, config_tether_upstream_regexs is an array and if I add an <item>
to it, that interface's network can be shared...
Ok, I understand this...

but as of now - I expected to see atleast ppp0 as one of those array
items.. - Am I wrong somewhere?
Also is there diagram/note somewhere suggesting the use of
dnsmasq/iptables via NETD - instead of traditional linux's
(ubuntu/meego) BRIDGE ioctl ?

--
--Pavan Savoy

Robert Greenwalt

unread,
Mar 15, 2011, 1:34:01 PM3/15/11
to Pavan Savoy, Narseo Vallina Rodriguez, android-porting

So, config_tether_upstream_regexs is an array and if I add an <item>
to it, that interface's network can be shared...
Ok, I understand this...

but as of now - I expected to see atleast ppp0 as one of those array
items.. - Am I wrong somewhere?

The default is an empty array - it is replaced at build time for most products using the resource overlay feature of the build system.  If you had access to the product-specific files you'd see these are filled in.  If your build is tethering over ppp0, then that is getting added sometime during your build process.
 
Also is there diagram/note somewhere suggesting the use of
dnsmasq/iptables via NETD - instead of traditional linux's
(ubuntu/meego) BRIDGE ioctl ?

No, there's no diagram or note.  As I understand it, bridging is extending the network to include the bridged nodes.  Since the user doesn't control the carriers network they shouldn't/can't add nodes to the carriers network.  We're doing NAT instead.  In a BT or LAN environment bridging may work well, but our main use case was getting internet access remotely (mobile data) and for that NAT was needed.

Note that we will be doing bridging in ipv6 environments in the future. 

R

Narseo Vallina Rodriguez

unread,
Mar 15, 2011, 12:36:12 PM3/15/11
to rgree...@google.com, pavan...@gmail.com, android-porting
Might be possible to follow this approach to tether via Bluetooth as well?

--
Narseo

Pavan Savoy

unread,
Mar 15, 2011, 2:33:14 PM3/15/11
to Robert Greenwalt, Narseo Vallina Rodriguez, android-porting

Yes, found the xml under device/...
Anyway i expected something like rmnet to be added there, but since this is a development platform eth//d makes sense too....

Thanks for the info..

Narseo Vallina Rodriguez

unread,
Mar 17, 2011, 8:31:10 AM3/17/11
to Pavan Savoy, Robert Greenwalt, android-porting
I was looking at the code and it looks like it only supports tethering
via USB. I can imagine that sharing 3G over BT will be slowl but I was
looking at the code of Tether WiFi application (that also supports BT)
and it is not as neat as this one ("Tethering.java") and I would like
to have something in the OS capablo of changing the network interface
and activates Bluetooth tethering as a new wireless interfaces to
access the Internet. I know there are apps that already support it but
I would like to have it available in the OS.

Could any of you provide me any hints about how to do it?

Many thanks,

--
Narseo

Robert Greenwalt

unread,
Mar 17, 2011, 12:19:03 PM3/17/11
to Narseo Vallina Rodriguez, Pavan Savoy, android-porting
I think future releases do support tethering over BT, wifi and usb.

R
Reply all
Reply to author
Forward
0 new messages