USB tethering an Android phone to an OpenWRT router

Now that I’ve got OpenWRT 10.03 “Backfire” running on my DIR-825, I decided to take advantage of the new USB tethering feature of Android 2.2 “Froyo”.  I connected my Nexus One phone to the USB port of the DIR-825, and installed the following packages:

  • kmod-nls-base
  • kmod-usb2
  • kmod-usb-core
  • kmod-usb-net
  • kmod-usb-net-cdc-ether
  • kmod-usb-net-rndis
  • kmod-usb-ohci
  • kmod-usb-uhci

Once these were installed, I edited /etc/config/network, and under “config interface wan” replaced “option ifname eth1″ with “option ifname usb0″.

I enabled USB tethering on the phone, and upon rebooting the router, it successfully set up the usb0 network interface and obtained its IP address, netmask, default gateway, etc. from the phone via DHCP.

At this point the only problem is that if I disconnect the phone (or disable tethering), then reconnect, the usb0 interface appears, but does not get configured by dhcp.

This entry was posted in Android, OpenWRT. Bookmark the permalink.

10 Responses to USB tethering an Android phone to an OpenWRT router

  1. Alex says:

    Hi!

    This is such a great idea.
    I am wondering, why nobody else is intersted in this topic! I am using a Netgear WNR3500L but I did not yet find a firmware.

    Alex

  2. gabriel says:

    rebooting the modem! that’s what was missing from me.

    This makes a great backup uplink for the times cable/dsl are down.

    Anyone want to take a shot at how to enable hotplugging the usb0 interface with udev rules? i’m failing miserably.

  3. Pingback: Usando el anclaje de red (tethering) de Android en OpenWrt | El Blog de Luis

  4. Nikolas Britton says:

    Hi,

    You can solve that problem by installing udev and usbutils packages… read more about it here: https://forum.openwrt.org/viewtopic.php?pid=146384

  5. Ben says:

    Thanks for this guide!
    Wish it could help me though, since the latest version in trunk is missing the modules kmod-usb-net-cdc-ether & kmod-usb-net-rndis. And I need the trunk version for other options added since last release :(

  6. Eric says:

    I think newer OpenWRT is supposed to be more easily configured for 3G modems and such, but I haven’t yet tried it. If it doesn’t have those particular modules, that functionality has probably been moved into other modules.

  7. Ben says:

    It was just a temporary screwup from buildbot, modules are back now :)

  8. Bruce says:

    I got all needed packages installed and phone shows USB tether ON and interface comes up but then no IP is obtained by OpenWRT and I get the following erros (usb disconnected) continuously:

    root@OpenWrt:~# dmesg |grep usb
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    usb usb1: configuration #1 chosen from 1 choice
    usb 1-1: new high speed USB device using ehci_hcd and address 2
    usb 1-1: configuration #1 chosen from 1 choice
    usb usb2: configuration #1 chosen from 1 choice
    usbcore: registered new interface driver cdc_ether
    usbcore: registered new interface driver rndis_host
    usb 1-1: USB disconnect, address 2
    usb 1-1: new high speed USB device using ehci_hcd and address 3
    usb 1-1: configuration #1 chosen from 1 choice
    usb0: register ‘rndis_host’ at usb-0000:00:0f.5-1, RNDIS device, 52:01:e2:2f:a3:9f
    usb 1-1: USB disconnect, address 3
    usb0: unregister ‘rndis_host’ usb-0000:00:0f.5-1, RNDIS device
    usb 1-1: new high speed USB device using ehci_hcd and address 4
    usb 1-1: configuration #1 chosen from 1 choice
    usb 1-1: USB disconnect, address 4
    usb 1-1: new high speed USB device using ehci_hcd and address 5
    usb 1-1: configuration #1 chosen from 1 choice
    usb0: register ‘rndis_host’ at usb-0000:00:0f.5-1, RNDIS device, 52:01:e2:2f:a3:9f

    Please guide.

    Thanks

  9. Franziska says:

    I see you share interesting things here, you can earn some extra cash, your website has
    big potential, for the monetizing method, just search in google –
    K2 advices how to monetize a website

  10. Bridgette says:

    I read a lot of interesting content here. Probably you spend a lot of time writing, i know how to save you a lot of time, there is an online tool
    that creates high quality, SEO friendly articles in minutes, just type in google – laranitas free content
    source

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>