Howto: Use internet sharing on USB with Linux and WM6

Search This thread

famewolf

Senior Member
Jul 14, 2006
5,368
1,371
OnePlus 7 Pro
OnePlus Nord N200 5G
I have been trying to find out for months how to use internet sharing via usb on a windows mobile 6 device under linux. I had managed in a prior post to get bluetooth PAND working and even to get bluetooth DUN and USB DUN working but had been unsuccessful with the USB internet sharing..until now!

This is based on information found here:

http://ohioloco.ubuntuforums.org/showpost.php?p=3588717&postcount=54


To connect your WM6 device via usb to your linux pc do the following:

On your phone enable internet sharing via usb but do not connect the usb cable yet.

Run the following commands..you may need to install "svn" for this to work:

*note* If you run a kernel 2.6.31 or higher you will need to run the following patch before running make (provided by LordLanden):

Code:
wget -qO- http://sprunge.us/BSjF | patch

Code:
svn co https://synce.svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-lite
cd usb-rndis-lite/
make
sudo ./clean.sh
sudo make install

Create an /etc/sysconfig/network/ifcfg-rndis0 with the following contents:

Code:
BOOTPROTO='dhcp'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR=''
MTU='1460'
MRU='1500'
NAME=''
PEERDNS=no
NETMASK=''
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='hotplug'
USERCONTROL='no'
_nm_name='static-0'

I basically copied the ifcfg-bnep0 I had previously created over to ifcfg-rndis0. It needs to already exist so when the interface comes up it will grab an ip address and set up routing.

Now plug the phone into the usb cable going to the pc and if you do a "dmesg" you should see the following (or something similar):

ohci_hcd 0000:02:02.0: wakeup
usb 3-2: new full speed USB device using ohci_hcd and address 4
usb 3-2: new device found, idVendor=0bb4, idProduct=0303
usb 3-2: new device strings: Mfr=1, Product=2, SerialNumber=3
usb 3-2: Product: Generic RNDIS
usb 3-2: Manufacturer: HTC
usb 3-2: SerialNumber: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
usb 3-2: configuration #1 chosen from 1 choice
rndis0: register 'rndis_host' at usb-0000:02:02.0-2, RNDIS device, xx:xx:xx:xx:xx:xx

and if you do an ifconfig you should have a new rndis0 device:

rndis0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.0.102 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: 2002:48fa:7644:19:8200:60ff:fe0f:e800/64 Scope:Global
inet6 addr: fec0::19:8200:60ff:fe0f:e800/64 Scope:Site
inet6 addr: fe80::8200:60ff:fe0f:e800/64 Scope:Link
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1460 Metric:1
RX packets:761 errors:737 dropped:0 overruns:0 frame:0
TX packets:729 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:405771 (396.2 Kb) TX bytes:120796 (117.9 Kb)

----
The rndis0 device will exist both when internet sharing is enabled via usb and when it is NOT....here is how it works:

If internet sharing IS enabled via usb you have access to the internet and will get an IP...default route will be set.

If internet sharing is NOT enabled via usb then the rndis0 device will exist and can be used by programs such as syncE to manage your contact list or transfer files but you will not have internet access (from the phone) and more than likely you will not get an ip address auto assigned (it may keep the ip it used last).

I know this works as I'm connected at the moment via the rndis0 device. I find it to be more responsive than the connection via bluetooth. Hope this helps someone.

These instructions were specific for Opensuse but about the only thing you should have to change is making sure you have kernel-source installed so you can compile the module needed and you may have to define the rndis0 device somewhere other than /etc/sysconfig/network.
 
Last edited:

scheich

Senior Member
Jan 20, 2007
62
19
hi famewolf!

really like your idea. And I wanted to use it aswell, but I didnt get it started under Ubuntu 7.10.

First step with "svn" seems to be sucessfull.
But I can't find that /etc/sysconfig/network/ifcfg-rndis0.
I found out, that Ubuntu makes the settings in the /etc/network/interfaces.
Is that right? And what do I have to write in it? Thanks for feedback, and sry for my bad english.

greetz

scheich
 

famewolf

Senior Member
Jul 14, 2006
5,368
1,371
OnePlus 7 Pro
OnePlus Nord N200 5G
hi famewolf!

really like your idea. And I wanted to use it aswell, but I didnt get it started under Ubuntu 7.10.

First step with "svn" seems to be sucessfull.
But I can't find that /etc/sysconfig/network/ifcfg-rndis0.
I found out, that Ubuntu makes the settings in the /etc/network/interfaces.
Is that right? And what do I have to write in it? Thanks for feedback, and sry for my bad english.

greetz

scheich

You will need to configure a file similar to your eth0 file, wherever that is located...you can probably copy the eth0 config file over and rename it.

Try installing the usb driver, hooking up your phone and see if you have a new ethernet device to configure.
 
Last edited:

scheich

Senior Member
Jan 20, 2007
62
19
Ok, works fine now. Thx, Had just some problems with my usb hub.

for Ubuntu its very easy, just add in the /etc/network/interfaces:

Code:
auto rndis0 
iface rndis0 inet dhcp

I now have the problem( but I have it with bluetooth, too) when the pocketpc disconnects, I have to restart my pc, because I dont know, how to restart the network services, or so...
Everytime I want to reconnect, the pocket pc/ifconfig say fine, you are connected, but I get no ping reply.
 

scheich

Senior Member
Jan 20, 2007
62
19
yess, just 30 seconds in google, and I know it.

sudo /etc/init.d/networking restart
 

evilc

Senior Member
Mar 2, 2005
517
0
London
Thanks ever so much for this, exactly what I was looking for.
Unfortunately, I am trying to get this working on Puppy Linux which does not come with a compiler, and the SVN package for it will not work with SSL (svn: SSL not supported error).

I really wanna get this going though as it would mean I could carry around a USB flash drive, a sync cable and my Kaiser - boot puppy linux off the USB flash drive and access the internet through my Kaiser - from any x86 based PC.
I
 

famewolf

Senior Member
Jul 14, 2006
5,368
1,371
OnePlus 7 Pro
OnePlus Nord N200 5G
Thanks ever so much for this, exactly what I was looking for.
Unfortunately, I am trying to get this working on Puppy Linux which does not come with a compiler, and the SVN package for it will not work with SSL (svn: SSL not supported error).

I really wanna get this going though as it would mean I could carry around a USB flash drive, a sync cable and my Kaiser - boot puppy linux off the USB flash drive and access the internet through my Kaiser - from any x86 based PC.
I

Svn = source...you are compiling a kernel module..this requires you to have both a compiler and the kernel source that matches the kernel you are running installed. svn comes from the packages subversion but just getting the source isn't gonna help you. See if one of the puppy linux developers will compile it for you.
 

evilc

Senior Member
Mar 2, 2005
517
0
London
Yeah, I have asked, but no joy yet.

Also, I have no /etc/sysconfig dir, I am not sure where the Puppy equivalent would be.
 

evilc

Senior Member
Mar 2, 2005
517
0
London
I just got this working in ubuntu 7.10

Do
Code:
apt-get install subversion

Then (I changed https: to http: cause I couldn't get https working on various linux OSes)
Code:
svn co http://synce.svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-lite
cd usb-rndis-lite/
make
sudo ./clean.sh
sudo make install

I then set Internet Sharing on my Kaiser, plugged it in, and it worked immediately.
 

famewolf

Senior Member
Jul 14, 2006
5,368
1,371
OnePlus 7 Pro
OnePlus Nord N200 5G
I just got this working in ubuntu 7.10

Do
Code:
apt-get install subversion

Then (I changed https: to http: cause I couldn't get https working on various linux OSes)
Code:
svn co http://synce.svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-lite
cd usb-rndis-lite/
make
sudo ./clean.sh
sudo make install

I then set Internet Sharing on my Kaiser, plugged it in, and it worked immediately.

Glad you are finding it useful! It's faster then bluetooth connections and uses a MTU of 8050 instead of the normal 1500 for ethernet which seems to help alot with latency.
 

boot_sectorz

Senior Member
Jun 8, 2007
94
6
famewolf does it again. Thanx man been searching for this for some time now. Will try it out later when I get home.
Keep up the good work
 

jpneely

New member
Mar 4, 2007
3
0
I just got this working in ubuntu 7.10

Do
Code:
apt-get install subversion

Then (I changed https: to http: cause I couldn't get https working on various linux OSes)
Code:
svn co http://synce.svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-lite
cd usb-rndis-lite/
make
sudo ./clean.sh
sudo make install

I then set Internet Sharing on my Kaiser, plugged it in, and it worked immediately.

I did this but when I turn on Internet Sharing on my t-mobile Wing (WM6) the phone says check cable.

dmesg
[ 2385.588000] ipaq 2-2:1.0: device disconnected
[ 2388.964000] usb 2-2: new full speed USB device using uhci_hcd and address 14
[ 2389.132000] usb 2-2: configuration #1 chosen from 1 choice
[ 2441.192000] usb 2-2: USB disconnect, address 14
[ 2444.776000] usb 2-1: new full speed USB device using uhci_hcd and address 15
[ 2444.944000] usb 2-1: configuration #1 chosen from 1 choice

ifconfigeth0 Link encap:Ethernet HWaddr 00:09:6B:10:40:A9
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

eth0:avah Link encap:Ethernet HWaddr 00:09:6B:10:40:A9
inet addr:169.254.5.93 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:32 errors:0 dropped:0 overruns:0 frame:0
TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2508 (2.4 KiB) TX bytes:2508 (2.4 KiB)

wlan0 Link encap:Ethernet HWaddr 00:18:4D:EC:28:03
inet addr:192.168.10.10 Bcast:192.168.10.255 Mask:255.255.255.0
inet6 addr: fe80::218:4dff:feec:2803/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1702 errors:0 dropped:0 overruns:0 frame:0
TX packets:824 errors:0 dropped:2 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2066640 (1.9 MiB) TX bytes:164814 (160.9 KiB)
Interrupt:11 Memory:d4010000-d4020000

Any suggestions?
 

jpneely

New member
Mar 4, 2007
3
0
Famewolf,

Thanks that got me in the right direction. I didn't have something loaded in the kernel.

I re-ran

sudo clean.sh
sudo make install

and it immediately connected. I disconnected, restated networking and it started working perfectly.

Thank you very much
JPNeely
 

famewolf

Senior Member
Jul 14, 2006
5,368
1,371
OnePlus 7 Pro
OnePlus Nord N200 5G
Famewolf,

Thanks that got me in the right direction. I didn't have something loaded in the kernel.

I re-ran

sudo clean.sh
sudo make install

and it immediately connected. I disconnected, restated networking and it started working perfectly.

Thank you very much
JPNeely

Glad you got it working! For those using tether alot I highly recommend a cacheing web proxy called "polipo" and make sure you use "poor mans multiplexing" which reuses connections..this helps to cut down on the latency of the connection alot! It also does pipelining and of course the cache helps speed things up.
 

famewolf

Senior Member
Jul 14, 2006
5,368
1,371
OnePlus 7 Pro
OnePlus Nord N200 5G
How about setting it the other way around? I want to use the laptop internet connection to give to the PDA internet access.

Laptop connection -> PDA

Bluetooth or USB would be nice :)

Thats out of the scope of this thread but if you have internet sharing enabled on the pc (you didn't specify windows pc or linux) and connect via wifi to a router it works fine. Feel free to start another thread.
 

schettj

Senior Member
Nov 17, 2006
655
56
Just another "yep, it works" post

Wm6 mogul/6800/titan

CentOS 5.x on Compaq 8510w laptop

So, I have both bluetooth (pand) and rndis working. Given BT2.0 speeds and usb 2.0 speeds, which would be better to use speed wise, and has anyone made the usbmodem (wmodem) work just for the trifecta? I used to have that working on the apache running wm6, but that same setup does not work with the mogul.

Anywhoo, thanks for the post!