LTE with Asus WL-330N3G, ZTE MF831 and OpenWrt

· 745 words · 4 minute read

For some time now I used the mobile router Asus WL-330N3G with a 3G USB modem. As LTE is now readily available I needed to upgrade my gear. Hofer, one of our local disconters, offers a LTE modem - a ZTE MF831 (). With it comes a HoT sim card (carrier t-mobile AT), which I’ve found not work in more rural areas so one should better choose a A1 based provider (A1, bob, Yessss!) or Drei Hutchinson. I’ve opted for a Yesss! prepaid LTE plan.

Asus WL-330N3G

The original Asus firmware wasn’t fullfilling my needs. It was a pain to configure and there are little possibilities to perform debugging tasks so I’ve ditched the it for OpenWrt which works really well on this small device.

ZTE MF831

The Modem itself is sold unlocked by Hofer for about 45EUR (as of March 2016). It works on the LTE frequencies B20, B9, B3, B7 (more information on frequencies) and offers a virtual network interface via RNDIS and a web interface for configuration. The stick listens on 192.168.0.1 and provides DHCP over the virtual network interface.

Although it is possible to bring the stick into a dummy modem mode (aka factory mode) using the RNDIS interface works well.

Setup

I’m using Arch Linux on my workstation but to some extend you’ll need to check how to do it on your distribution.

Flash openwrt image onto the device

I’ve installed an older version of OpenWrt already on the router but there was no support for RNDIS so I needed to update the firmware. I’ve used the following flashing procdure for the first OpenWrt install too so go ahead and use it - more information to the flashing possibilities can be found in the OpenWrt Wiki.

First download the OpenWrt image:

wget https://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/rt305x/openwrt-15.05.1-ramips-rt305x-wl-330n3g-squashfs-sysupgrade.bin
wget https://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/rt305x/md5sums
md5sum -c openwrt-15.05.1-ramips-rt305x-wl-330n3g-squashfs-sysupgrade.bin
  1. Connect the router to your computer via ethernet
  2. Configure your Ethernet IPv4 address as static: **192.168.1.20** netmask 255.255.255.0. Note the IP of .20 is critical - the bootloader accepts tftp only from this IP.
sudo ip a add 192.168.1.20/24 dev enp0s25
  3. Press and hold the Reset button on the bottom of the router and power on device
  4. Hold the Reset until the power led flashes slowly. If you are running tcpdump on the Ethernet interface you should see ARP requests from 192.168.1.1 for 192.168.1.20.
  5. Use tftp to upload a firmware file in **binary mode** to the device:
# tftp 192.168.1.1
tftp> binary
tftp> trace
Packet tracing on.
tftp> rexmt 1
tftp> put openwrt-15.05.1-ramips-rt305x-wl-330n3g-squashfs-sysupgrade.bin
sent WRQ <file=openwrt-15.05.1-ramips-rt305x-wl-330n3g-squashfs-sysupgrade.bin, mode=octet>
received ACK <block=0>
sent DATA <block=1, 512 bytes>
[...]
sent DATA <block=5377, 4 bytes>
received ACK <block=5377>

The received ACK line is important, the block number varies from version to version. 6. Wait, flashing may take a couple of minutes. Do not power off! 7. The device will reboot when flashing is done. If you flashed OpenWRT, telnet into 192.168.1.1 and set root password:

passwd
  8. Logout - you can only login via SSH from now on.

Mirror repository for local use

I’m aware that this is not needed, as you could easily resolve all dependencies by hand, but I like to have the system itself doing this for me. As I didn’t have internet connection at this point via the router I mirrored the whole repository to my local machine (it’s about 320MB).

mkdir /mnt/owrt
mount /dev/rootvg/owrt_lv /mnt/owrt
cd /mnt/owrt
wget --no-parent -r -l 2 -p -k https://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/rt305x/packages/

To serve the repository I’ve used nginx:

sudo pacman -S nginx
vim /etc/nginx/nginx.conf
  location /packages {
    root /mnt/owrt/downloads.openwrt.org/chaos_calmer/15.05.1/ramips/rt305x;
    index index.html index.htm;
  }

Configure OpenWrts package manager opkg to use my local mirror:

cp /etc/opkg/distfeeds.conf /etc/opkg/distfeeds.conf.20160327
vim /etc/opkg/distfeeds.conf
  src/gz chaos_calmer_base http://192.168.1.20/packages/base
  src/gz chaos_calmer_luci http://192.168.1.20/packages/luci
  src/gz chaos_calmer_packages http://192.168.1.20/packages/packages
  src/gz chaos_calmer_routing http://192.168.1.20/packages/routing
  src/gz chaos_calmer_telephony http://192.168.1.20/packages/telephony
  src/gz chaos_calmer_management http://192.168.1.20/packages/management

Install RNDIS drivers

For more detailed procedure have a look at the OpenWrt Wiki.

opkg update
opkg install kmod-usb-net-rndis usb-modeswitch

Configure the network interfaces

cp /etc/config/network /etc/config/network.20160327
vim /etc/config/network
  config interface 'wan'
    option ifname 'usb0'
    option proto 'dhcp'
/etc/init.d/network restart

Configure wireless access point

I’ve used the webinterface on http://192.168.1.1 to configure my wireless access point. The config file looks as follows:

config wifi-device 'radio0'
  option type 'mac80211'
  option channel '11'
  option hwmode '11g'
  option path '10180000.wmac'
  option htmode 'HT20'
  option txpower '20'
  option country '00'

config wifi-iface
  option device 'radio0'
  option network 'lan'
  option mode 'ap'
  option ssid 'wre'
  option encryption 'psk2'
  option key '12345678'

Perform a test reboot and cut-the-power-reboot to test the setup.