PDA

View Full Version : HOW-TO: USB Sharing a PC Internet connection to the tablet


anidel
2008-11-20, 16:23
Hi,

I am trying to share my work PC's internet connection to the N810 via the provided USB cable, with no external accessory.
From what I understood googling around the world, Maemo and here these should be the steps to do (as root on the tablet and on Linux/Unix machines, as Power user on Windows and Mac):

ON THE TABLET (Running Diablo 4.2008-35)

1) update the libicd-network-dummy package from the current v11 to v12 present in the repository (as for bug #3306 (https://bugs.maemo.org/show_bug.cgi?id=3306#c30))

2) check /etc/network/interfaces, it should have:

auto usb0
iface usb0 inet static
address 192,168.2.15
netmask 255.255.255.0
gateway 192.168.2.14

(someone uses "up route add default gw 192.168.2.14" as last line, the result should be the same)

3) Load the USB ether module:

insmod /mnt/initfs/lib/modules/2.6.21-omap1/g_ether.ko (do it twice, the first time it conflicts with g_file_storage)

4) load up the USB interface:

ifup usb0

These steps should be enough to have a Dummy internet connection directed over the USB cable.
We should configure the PC to actually share the Internet connection.

ON AN APPLE MAC HOST

1) it should suffice to go to Sharing->Internet and share the active connection to the ethernet device corresponding to the tablet

NOTE: I DIDN'T TRY THIS ONE YET, it just came up to my mind and wrote it here. It should work, I'll test it later at home and change this entry.
NOTE1: I just remembered I have my Mac with me today at work :-D
Tried, it recognized the tablet as ethernet device, but of course the tablet needs to be configured to look for a dynamic IP or the Mac has to be setup with a static IP (if this is even possible).
Gotta try later...I'll keep the post update.

ON A WINDOWS HOST

1) This old wiki http://maemo.org/community/oldwiki/usbnetworkingwinxp/ should help. I'll try to recap those steps here.

ON A LINUX MACHINE

It's a bit more complicated as it depends how you're firewall (if any) is configured and depends a lot from the distribution you're using.
More or less, on my Ubuntu 8.04:

1) Check/edit the /etc/network/interfaces

auto usb0
iface usb0 inet static
address 192.168.2.14
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
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


ONLY attach the tablet to the PC when everything is set up. Not before.

The main issue here is.. it doesn't work to me.
Probably because I miss a few packages (most notablet the updated libicd-network-dummy package).

As, of course, I do not have an Internet connection on the tablet at the moment, I am going to update and try to share my connection from the Mac tonight.

I will update this HOW-TO.

In the meanwhile I hope someone could help pointing up what I am doing wrong with my current configuration (N810 plain 4.2008-35 and plain Ubuntu 8.04).

Thanks!

PS: there are more sophisticated solutions (like using DHCP to have the tablet on the same network as the PC, so to be able to SMB share data), but I prefer to stick to the simple solution for now.
If this HOW-TO proves useful, we can update it.

The info on the web is sparse, rare and looks like it's outdated.
Mainly it refers on how to let developers access the tablet via USB so to have SSH on it and share development files.
Some other refers only to Maemo-PAN issues, but I couldn't fine anything on how to browse the Web from the Tablet connected to a PC via USB.

Anidel

gonzo1082
2008-11-20, 17:06
AWesome!! i've been looking for this... is there any way to package this so it's activated from the status bar?

anidel
2008-11-21, 09:26
I am still testing this stuff.. it doesn't work yet, but these look like they are the steps to be taken in order to share it.

Yesterday evening I forgot to update my tablet, I'll do tonight.

Any help/hint is welcome!

gonzo1082
2008-11-21, 16:50
awesome stuff... Is the connection supposed to say USB in connections manager? i have a dummy and USB. Also, if i'm using a windows machine would the device be recognized as an rndis device? I haven't done any trials yet. i'm just trying to see what i should be looking for.

anidel
2008-11-24, 10:54
I also noticed USB and Dummy, they should both work.
But I couldn't make it work yet. The Linux machine pings to the tablet, but not the other way around.
No Internet has been shared yet... not an Mac either.

I think Windows should see it as an rndis device, yes.

If tonight my GF give me 30mins to test this stuff I could test it on the Mac and on Windows (inside Parallels).

gonzo1082
2008-11-28, 19:15
Any developments? I don't know a lick about linux and programming. i wish i could help, i just read the how-tos and cross my fingers.

anidel
2008-11-28, 23:13
Yeah I am ... can't look at it the time I'd want to, but every now and then I give it a try.

No progress tho.. something I'm missing...

rps
2008-12-02, 12:14
Worked for me on Linux, but recently had some problems with the dummy AP (not sure of the current status) - the connection itself works. For Windows, there is an open bug (search for RNDIS in maemo bugzilla).

Regis
2008-12-02, 13:23
Very interesting post anidel, thanks.

In my case I don't need the pc to actualy share it's internet connection. All I need is the possibility for one of my application on the PC to communicate in TCP/IP to another of my application on the N800 thru the USB cable. Do you think it would work ?

gonzo1082
2008-12-04, 00:09
any luck with windows Anidel?

fragos
2008-12-04, 03:59
A much simpler solution is a wireless access point. No need to install software or do any configuration unless you want to implement wireless security. My TRENDnet wireless router cost $20.00 US on sale.

lardman
2008-12-04, 10:15
Note that for windows, you probably need to use the linux.inf driver (on the Windows side) to get a working RNDIS connection. This driver can be found in the kernel docs, or it's on the last link below too. Assuming it's still needed that is.

With Windows, the easiest thing to do is to bridge the two connections. This take your PC offline, and routes data directly from your real Ethernet connection to the fake Ethernet-over-usb connection.

Well that always used to be the case, but in the last years of the Zaurus (which had to use these techniques as no wifi out-of-the-box) the Windows XP connection sharing wizard used to do the job. Setup so you can ping both ways and the Ethernet-over-usb connection is working, then run the wizard. Hey presto!

For Linux, I'm a bit surprised it doesn't work, unless we're back to the problems of the old days where the gadget driver is broken for our processor...?

You might want to take a look at some of the Zaurus HowTos which were written for Ethernet-over-usb. E.g.
http://wiki.openzaurus.org/HowTos/USB_Networking
http://wiki.openzaurus.org/HowTos/Bridging_with_Gentoo
http://wiki.openzaurus.org/HowTos/Bridging_with_Ubuntu
http://wiki.openzaurus.org/HowTos/USB_Networking_Without_Bridging

There's lots of info on the old Zaurus OESF forum.
E.g.: http://www.oesf.org/forum/index.php?showtopic=11785

rps
2008-12-05, 19:06
@fragos:
I don't know which kind of place Anidel is working at, but I know of some where connecting an unsecured wireless access point to the company LAN is quickly increasing your chances of getting fired (or at least get your *** chewed out).

@all:
The XP-Connection does not work for me - if you experience the same, maybe you want to vote for bug 3243. https://bugs.maemo.org/show_bug.cgi?id=3243

@Anidel:
The connection with a Linux desktop is working for me (Debian testing and current Maemo Diablo, router as firewall, no firewall rules on the desktop).
To separate issues between the network layer making the network available for the hildonized applications (and e.g. asking you if you want to connect to the network etc.) and the real tcp/ip connection: did you try to ping from the tablet or did you try to use a connection e.g. in the browser?

- if pinging works, it is a problem of the dummy internet access point

- if pinging does not work, i would suggest to disconnect the Linux box from the network, deactivate the firewall and retry without the firewall rules on the desktop setup

good luck

jpramlak
2009-02-25, 16:01
Came across this (http://usb.brando.com.hk/prod_detail.php?prod_id=00805) via Engadget.
"not only a data transfer cable but also an internet connection sharing dongle". No Drivers required for Windows.

jondonnis
2011-10-09, 19:17
A much simpler solution is a wireless access point. No need to install software or do any configuration unless you want to implement wireless security. My TRENDnet wireless router cost $20.00 US on sale.

That's not going to work in an office environment. I'm also looking for a solution to this as have no SIM in my phone just using it as a device. Being an IT Engineer I want to use it at work but know I'd be shot if I installed a WIFI access point.

trisha02
2011-10-10, 00:37
how to do it for n900?