LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 03-16-2013, 04:24 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,335

Rep: Reputation: 83
Configuration Debian to give internet (ether) to Android Tablet ?


Hi,

I have installed ether usb on the tablet.

When I run the ether on the tablet, it would be capable
to get internet from plugin the usb cable to the usb
of the debian machine.

/etc/network/interfaces has to changed for that.
my debian machine is: 192.168.1.120

Would you know if it exists a configuration to gw / give
internet to the tablet in a method that is universal?


I tried several codes changing the /etc/network/interfaces , rebooted, and I havent been successful.

I talk about a config that is very surely working and correct.

Looking forward to hearing you

Kind regards



On your Target:
# modprobe g_ether
ether gadget: using random self ethernet address
ether gadget: using random host ethernet address
usb0: Ethernet Gadget, version: May Day 2005
usb0: using imx_udc, OUT ep2out-bulk IN ep1in-bulk STATUS ep4in-int
usb0: MAC be:df:31:95:16:e0
usb0: HOST MAC 3e:86:1e:94:eb:84
usb0: RNDIS ready
Now an IP address has to be assigned to the USB0 ethernet port
# ifconfig usb0 192.168.10.1

On your PC:
On Linux systems:
$ sudo modprobe cdc_ether

(https://www.ridgerun.com/developer/w...ice_networking)

Last edited by Xeratul; 03-16-2013 at 06:59 AM.
 
Old 03-16-2013, 07:46 PM   #2
yowi
Member
 
Registered: Dec 2002
Location: Au
Distribution: Debian
Posts: 209

Rep: Reputation: 52
That page you linked has instructions for completing the setup of the bridge and from a quick glance they at least appear to be barking up the right tree, did you follow them?
 
Old 03-17-2013, 12:15 AM   #3
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,335

Original Poster
Rep: Reputation: 83
Quote:
Originally Posted by yowi View Post
That page you linked has instructions for completing the setup of the bridge and from a quick glance they at least appear to be barking up the right tree, did you follow them?
Yes completely 1:1
https://www.ridgerun.com/developer/w...ice_networking

But it does not work.
It all work until the last command route:

On the target device
HOST_USB_IP=10.0.1.1
TARGET_USB_IP=10.0.1.2
ifconfig usb0 $TARGET_USB_IP netmask 255.255.255.0
route add default gw $HOST_USB_IP
route

At that command, it tells no network.

(I note: My cdc_ether and g_ether are enabled and working into the kernel)

Best Regards
 
Old 03-18-2013, 09:52 AM   #4
yowi
Member
 
Registered: Dec 2002
Location: Au
Distribution: Debian
Posts: 209

Rep: Reputation: 52
What do "ifconfig usb0" and "dmesg | grep usb0" tell you?
 
Old 03-21-2013, 01:10 PM   #5
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,335

Original Poster
Rep: Reputation: 83
I will post you soon those info. I must put those dats on usb pendrive

it returned the informations that are on teh website: https://www.ridgerun.com/developer/w...ice_networking

I would be soo soooo much happy that it worked to get internet !!

thx
 
Old 04-01-2013, 05:58 AM   #6
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,335

Original Poster
Rep: Reputation: 83
Finally after lot of days of investigating and testing....

this is the only one that worked !!!

Quote:
HOWTO: Set Up USB Networking With Debian

Introduction

This document describes how you can set up USB networking between your host machine with Debian and your device with a Debian-like distribution. Following this document you can easily transfer data between these two entities and log on as root to the device.

First, you need to follow the HowDoiBecomeRoot document. The commands executed on the device need to be done as root.

Setting up your environment and device

You need to take these steps:

1 .#1 Disconnect the device from the USB connection 1 .#2 Make sure that the PC's kernel has usbnet Support.

With “lsmod | grep usbnet” you should find that the module was loaded (if you don’t have it compiled in kernel on desktop).

~# lsmod | grep usbnet
usbnet 18888 0
1 .#3 Then add networking information at the end of /etc/network/interfaces on the PC:

allow-hotplug usb0

mapping hotplug
script grep
map usb0

iface usb0 inet static
address 192.168.2.1
netmask 255.255.255.0
broadcast 192.168.2.255
up iptables -I INPUT 1 -s 192.168.2.2 -j ACCEPT
1 .#4 Check if module g_ether is loaded on the device. In case it is not loaded, check if it is included in the modules directory of your shipped version of Nokia 770 and load it, so you will not need to flash a development root filesystem really. This sets the device to networking-mode, it will no longer work as a mass-storage device. See the last section on how to get it back.

Execute the following command on the device:

lsmod | grep g_ether
If output is empty then You need to load g_ether.ko:

insmod /mnt/initfs/lib/modules/`uname -r`/g_ether.ko
1 .#5 Now you need to configure the network on the device. Add the following lines to /etc/network/interfaces on the 770 and comment out or delete the existing usb0-entry:

iface usb0 inet static
address 192.168.2.2
netmask 255.255.255.0
broadcast 192.168.2.255
up route add default gw 192.168.2.1
1 .#6 Connect device to usb

1 .#7 If you want comfortable browsing, you need a name-server. I recommend setting up pdnsd on your PC and entering the following line at the end of /etc/resolv.conf on the 770:

nameserver 192.168.2.1
1 .#8 Final step: fire up the interfaces! Do the following command on the PC and the 770:

/sbin/ifup usb0
Testing the connection

To test that the USB connection between your host and device works you can follow these simple steps.

2 . Attach the USB cable to the device 2 . The device should now be connected. You can check this with ifconfig, where you should see the device "usb0" in the list 2 . Now you can try to ping the device over the network with the address 192.168.2.15 2 . If the ping answers, log into the device as root. The root password is rootme

ssh root@192.168.2.15
Setting the device back into mass-storage-mode

unload the g_ether module:

rmmod g_ether
and replug the USB cable.

Sharing internet

It should be possible to share internet over USB, either from desktop to Nokia, or reversed.

Host as a gateway

If your host has no firewalling rules, you can set the gateway rules by modifying /etc/interfaces file.

iface usb0 inet static
address 192.168.2.1
netmask 255.255.255.0
up echo 1 > /proc/sys/net/ipv4/ip_forward
up iptables -P FORWARD ACCEPT
up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.2.0/24
down echo 0 > /proc/sys/net/ipv4/ip_forward
down iptables -t nat -F POSTROUTING
Else add the necessary MASQUERADE rules to normal firewall rules.

If you get the following error:

iptables v1.2.11: can't initialize iptables table `NAT': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.
You need verify that your kernel has the relevant iptables modules included, and hotplug or udev is set up properly on your computer.

Nokia as a gateway

Frst you need to build and install nat kernel modules. Follow HowTo KernelCompilation instructions to build kernel, but just before building kernel add more modules in, and copy the modules over to the device, instead of flashing the kernel.

# echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables -P FORWARD ACCEPT
# iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.2.0/24
Could someone just post a link to that module here so that people without a Scratchbox can use this as well?
Recommended

link:http://maemo.org/community/oldwiki/h...workingdebian/
 
Old 04-04-2013, 01:23 AM   #7
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,335

Original Poster
Rep: Reputation: 83
Hi

Nope Internet does not work.

The ping 192.168.2.2 works from the debian pc. The archos has well the ip 192.168.2.2 and pc 192.168.2.1.

I did this on the debian pc for /etc/network/interfaces:

debian pc
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

#auto usb0
#iface usb0 inet dhcp



# very basic without internet
# ls added
allow-hotplug usb0

mapping hotplug
        script grep
        map usb0

iface usb0 inet static
       address 192.168.2.1
       netmask 255.255.255.0
       broadcast 192.168.2.255
       up iptables -I INPUT 1 -s 192.168.2.2 -j ACCEPT
You just plug, and on the Archos, you do :
Code:
ifconfig usb0 192.168.2.2
ifup usb0
And that's it.


Regarding Internet, the masquarade didnt work
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem installing Debian on my Android tablet. odiseo77 Linux - Mobile 7 08-12-2012 06:19 PM
LXer: Android Shmandroid. Give me Apple support or give me nothing. LXer Syndicated Linux News 0 02-16-2012 03:50 PM
LXer: Bodhi Linux Powered Tablet/Netbook Give Away LXer Syndicated Linux News 0 09-15-2011 11:50 AM
android tablet sherwiner Linux - Newbie 1 04-19-2011 06:21 PM
LXer: Archos launches Android 'Internet tablet' LXer Syndicated Linux News 0 09-17-2009 06:12 AM


All times are GMT -5. The time now is 09:28 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration