Logo
ZTE

Guide to ZTE MF 823 USB dongles with OpenWrt and Gargoyle Routers

TBD Productions was recently asked to research how the Telstra ZTE MF823 USB Dongle would work with OpenWrt and Gargoyle routers. It turns out that these particular dongles are too smart for their own good. They have a nasty habit of switching modes based on what they want, not what you want.

After some playing around, we have figured out how to make each element work together!

Backstory

While most 3G/4G dongles show up as a modem, ZTE has taken a different approach. ZTE dongles like the MF823 have multiple USB modes, each doing something slightly different.

We noticed early on that the MF823 dongle kept slipping into mode 1403, which is a good default, but simply did not work in the situation we wanted. Instead, we needed the dongle to show up as an ethernet device. On this device, that meant mode 1405.

The key to this is the usb_storage kernel module. If this module was installed, the dongle would stay in mode 1405 - exactly where we wanted it.

OpenWrt

OpenWrt was simple as it already has everything in place.

SSH into the OpenWrt device as root and run:
opkg install kmod-scsi-core kmod-usb-storage kmod-usb-net-cdc-ether kmod-usb-net

Once you have done this, reboot and plug the dongle in.

Run "ifconfig /all" and the device "usb0" should be listed. You can then use DHCP to assign yourself an IP address.

Gargoyle Routers

We had a lot more trouble getting the Gargoyle router to work the way we wanted. Due to the way the company does its packaging, we had trouble installing kernel modules. Every time we tried, we were fed the following message:

ERROR: Dependency kernel (= 3.3.8-1-d6597ebf6203328d3519ea3c3371a493) of package kmod_usb_storage is installed, but has incompatible version 3.3.8-1-6b8bf9865b836dada69c247eeaf2dc49 and is marked as 'hold'

Trying to fix this error lead us down a rabbit hole, and eventually we decided to just rebuild Gargoyle. Hopefully this will be a non-issue in the future and we could treat it the same as OpenWrt.

For now, you'll need to build ar71xx on a Ubuntu Linux box. (Instructions on building it on other hardware can be found here.)

Steps

  1. Install Ubuntu dependencies:
    sudo apt-get install jam build-essential g++ libgtk2.0-dev libsdl-sound1.2-dev libsdl-dev libjpeg-dev libsdl-mixer1.2-dev xorg-dev libpng12-dev
     
  2. Use Git to install Gargoyle source:
    git clone http://github.com/ericpaulbishop/gargoyle.git
     
  3. Edit kernel config to build scsi-core, usb-storage, net-cdc-ether, usb-net:
    vi gargoyle/targets/ar71xx/profiles/default/config

    Add to the bottom of the file:
    CONFIG_PACKAGE_kmod-usb-net-cdc-ether=m
     
  4. Make Gargoyle (this will take a while):
    cd gargoyle && make ar71xx
     
  5. Install the correct image for your device located in "gargoyle/images/ar71xx/". You can follow normal OpenWrt or Gargoyle install instructions for this. For example
    cd /tmp && scp root@192.168.1.250:/files/gargoyle_1.6.x-ar71xx-generic-tl-mr3420-v2-squashfs-sysupgrade.bin
     
  6. After installing the new image, you will need to change the wan address. On the device:
    vi /etc/config/network

    Change:

    ________________________________

    config interface 'wan'

    option ifname 'eth0'

    option proto 'dhcp'

    ________________________________

    To:

    ________________________________

    config interface 'wan'

    option ifname 'usb0'

    option proto 'dhcp'

    ________________________________

  7. Install the packages required to get the modem workng, these are located in "gargoyle/built/ar71xx/default"
    cd /tmp
    scp root@192.168.1.250:/files/kmod-scsi-core_3.3.8-1-3b124ff64a17bfa06dd514c2f49102e8_ar71xx.ipk
    scp root@192.168.1.250:/files/kmod-usb-storage_3.3.8-1-3b124ff64a17bfa06dd514c2f49102e8_ar71xx.ipk
    scp root@192.168.1.250:/files/kmod-usb-net-cdc-ether_3.3.8-1-3b124ff64a17bfa06dd514c2f49102e8_ar71xx.ipk
    scp root@192.168.1.250:/files/kmod-usb-net_3.3.8-1-3b124ff64a17bfa06dd514c2f49102e8_ar71xx.ipk

     
  8. And finally install the packages you just moved to the device and then reboot.
    opkg install kmod-scsi-core_3.3.8-1-3b124ff64a17bfa06dd514c2f49102e8_ar71xx.ipk kmod-usb-storage_3.3.8-1-3b124ff64a17bfa06dd514c2f49102e8_ar71xx.ipk kmod-usb-net-cdc-ether_3.3.8-1-3b124ff64a17bfa06dd514c2f49102e8_ar71xx.ipk kmod-usb-net_3.3.8-1-3b124ff64a17bfa06dd514c2f49102e8_ar71xx.ipk

Once this is installed and you have rebooted, it should treat your USB dongle as a wan device, this has worked successfuly for me on a TP-LINK router, I see no reason it shouldn't work on anything else.

I would like to thank Simon Hackett from Base64 for commissioning this work, and I hope it helps everyone in the future.

Close