UsualCoding.eu

To content | To menu | To search

Friday, January 15 2010

OpenWRT on the Ubiquiti RouterStation Pro

I recently replaced my old WRT54GS router with a RouterStation Pro.

Although it already comes with OpenWRT on the board, it is a pretty outdated trunk version.

The documentation for this device is not easy to find and is motly scattered on different wikis and forums. Here is a quick guide on how to flash the latest OpenWRT on this device using tftp.

  • Download the latest snapshot if you don't want to build it yourself: http://downloads.openwrt.org/snapsh... (I use the squashfs version because it is easier to upgrade)
  • Connect your computer to the WAN port
  • Configure your network like this: 192.168.1.1/255.255.255.0 (anything but 192.168.1.20)
  • Plug in your RouterStation Pro
  • Press the reset button and hold it for about 10 seconds (you should see the third led flash a bit and the second on come up)
  • You should be able to ping 192.168.1.20 now
  • Send the firmware image with tftp in binary mode:

Linux:

   $ tftp -m binary 192.168.1.20 -c put openwrt-...-factory.bin

Mac OS X:

   $ tftp 192.168.1.20
   tftp> binary
   tftp> put openwrt-...-factory.bin

The router will reboot and provide dhcp on the switch. You can now telnet to 192.168.1.1 as usual.

Wednesday, July 16 2008

Private Weave Server (with ssl)

Since Google Browser Sync has been discontinued, I moved to Mozilla Weave. The cool thing is that it is open source and you can even create your own weave server.
All you need is an apache server with following modules activated and configured:

  • dav
  • dav_fs
  • dav_lock

Since weave only uses basic authentication (digest would have been better) it is strongly advised to use https.
Here is the vhost configuration file. It should be pretty straightforward:

<VirtualHost *:80>
        ServerName weave.YOURDOMAIN

        RewriteEngine On
        RewriteCond %{HTTPS} !on
        RewriteRule ^/(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R]
</VirtualHost>

<VirtualHost *:443>
        ServerName weave.YOURDOMAIN
        ServerAdmin YOURMAIL

        DocumentRoot "/var/www/weave.YOURDOMAIN"

        <Directory /var/www/weave.YOURDOMAIN>
                SSLRequireSSL
                Order allow,deny
                Allow from all

                DAV On
                AuthType Basic
                AuthName "Restricted"
                AuthUserFile /etc/apache2/passwd/weave_htpasswd
                require valid-user

                AllowOverride None
        </Directory>

        <Directory /var/www/weave.YOURDOMAIN/user/YOURUSER>
                require user YOURUSER
                Options Indexes
        </Directory>

        ErrorLog /var/log/apache2/weave.YOURDOMAIN_error.log
        LogLevel warn
        CustomLog /var/log/apache2/weave.YOURDOMAIN_access.log combined
</VirtualHost>

Now all you need to do is to create the /user/YOURUSER directory in the vhost and give apache the rights to write to it.
Then create the password file with the htpasswd utility.

That should be enough to have a working weave server. You can test it by going to the directory with your browser first. Once everything works, change the server in your weave preferences.

Links:

EDIT: If you use firefox 3 you will have to add a security exception if your certificate is not signed.

Monday, July 14 2008

Python on OpenWrt Kamikaze 7.09

It is not possible to install python on OpenWrt Kamikaze 7.09 because it depends on libreadline which is not available in the repositories for now.
There is a simple workaround:

  • Install the libreadline from 7.06 (brcm47xx-2.6 for mipsel and atheros-2.6 for mips)
   # ipkg install http://downloads.openwrt.org/kamikaze/7.06/brcm47xx-2.6/packages/libreadline_5.1-1_mipsel.ipk
  • Install python
   # ipkg install python

I tested this on the au1000 7.09 build. It should work on other mipsel and mips builds and on 7.07.

Sunday, July 13 2008

OpenWrt on the MeshCube

Where I work we use a lot of MeshCubes to create an OLSR powered network.
It is a tiny wireless router with two minipci slots and one Ethernet slot.
It has a 400 MHz MIPS based processor, 64 MB of RAM and 32 MB of Flash.

It is sad that it was discontinued and that the main site (meshcube.org) is down.
There is a mirror here.

The other problem is that the Linux distribution that runs it (nylon) is unmaintained. The good news is that OpenWrt works on the au1500 processor.
The installation without a serial cable is very simple:

  • Download the OpenWrt au1000 images:
   # wget http://downloads.openwrt.org/kamikaze/7.09/au1000-2.6/openwrt-au1000-2.6-vmlinux.bin
   # wget http://downloads.openwrt.org/kamikaze/7.09/au1000-2.6/openwrt-au1000-2.6-jffs2-128k.fs
  • Copy them to the cube:
   # scp openwrt-au1000-2.6-vmlinux.bin root@192.168.0.250:/tmp
   # scp openwrt-au1000-2.6-jffs2-128k.fs root@192.168.0.250:/tmp
  • Make sure nothing writes to the flash (kill most processes but not ssh!)
  • Copy to flash
   # flashcp -v openwrt-au1000-2.6-vmlinux.bin /dev/mtd/2
   # flashcp -v openwrt-au1000-2.6-jffs2-128k.fs /dev/mtd/0

Thats it!

Links:

- page 1 of 3