Mesh/OpenWRT
OpenWRT installation
Web interface method
- Power on router and let it boot.
- Press and hold power button for 30 seconds.
- Wait for router to reboot.
- Connect to the access point using LAN.
- Go to web interface, e.g. http://192.168.1.1/
- If this doesn't work, look up the reset method for your specific router.
- Find the firmware upgrade page.
- On your computer, download the firmware.
- Different versions are here.
- The snapshots directory has recent development versions.
- If you have a WRT54G you probably want [1] assuming 12.09 (attitude adjustment) is the most recent stable version.
- If you have an Asus RT-N10+, you probably want [2] assuming 12.09 (attitude adjustment is the most recent stable version.
- Upload the firmware using the web form and wait for the router to reboot.
TFTP method
This requires that the router has a TFTP server enabled. Type these commands with the router powered off, then power on the router and it should work. For some routers (like the Asus RT-N10+) you have to hold down the reset button while you plug in the power, and keep it held in for a few seconds after.
tftp 192.168.1.1 binary rexmt 1 timeout 60 trace tftp> put firmwarefile.bin
If it doesn't work, try omitting the "rexmt 1" line.
Curl method
You may use the command line tool 'curl' on Linux and Mac OS X systems to send files to your router. For instance, to flash the firmware of the Asus R10+ router, using 'curl' instead of tftp, you can issue the following command:
$ curl -T openwrt-ramips-rt305x-rt-n10-plus-squashfs-sysupgrade.bin tftp://192.168.1.1
OpenWRT configuration
Logging in and setting root password
Telnet into the device:
telnet 192.168.1.1
If it asks for a password use 'passwd' (without the quotes).
Set a root password on the router:
passwd
Verify that you can log in using ssh from your computer:
ssh root@192.168.1.1
If you can ssh into the router, disable telnet:
rm /etc/rc.d/S50telnet
Enabling TFTP
Operating Systems: TFTP clients
Windows 7/Server 2008
TFTP is disabled by default. In Control Panel > Programs and Features, click on Turn Windows features on or off, find TFTP Client and tick the box. You should now be able to use TFTP from the command prompt
Linux:
using whatever your Linux distribution's package management might be, you need to check for the presence of a tftp client, and if necessary, install that package. Instructions for xUbuntu/Linux Mint (xUbuntu means any Ubuntu based distribution, including Kubuntu, Xubuntu, etc. Instructions for Debian may be similar, but are not yet tested).
(Linux: for Ubuntu/Linux Mint only)
tftp client may not be installed by default on Ubuntu 12.10 or Linux Mint 14. check and see if you have it by issuing:
dpkg --get-selections | grep tftp
if you do not have the client, then install it with:
sudo apt-get install tftp
Enabling TFTP on various routers
WRT54G / WRT54GL
If you're on an WRT54G or WRT54GL then you should do this to enable TFTP. If you're not on one of those routers, then don't do it!
It makes it easier to upgrade the firmware and recover from serious problems.
CAUTION: This will reboot your router.
nvram set boot_wait=on nvram set boot_time=10 nvram set wait_time=10 nvram commit && reboot
Enabling wifi
OpenWRT has wifi disabled per default.
vim /etc/config/wireless
Remove the line indicated:
config wifi-device radio0 option type mac80211 option channel 11 option macaddr 00:1c:10:bc:a7:1f option hwmode 11g # REMOVE THIS LINE TO ENABLE WIFI: option disabled 1
Reboot.
Wait a few minutes, then ssh back into the router.
Run 'wifi'. You should see the following:
root@OpenWrt:~# wifi Configuration file: /var/run/hostapd-phy0.conf Using interface wlan0 with hwaddr 00:1c:10:bc:a7:1f and ssid "OpenWrt"
Connecting to wifi
You will need internet access to install packages and other things. Edit your config wifi-iface section to match the example below.
vi /etc/config/wireless
config wifi-iface option device radio0 option network wwan option mode sta option ssid sudoroom option encryption none
If you're on an encrypted network add the following options...
option encryption psk2 option key 1234567890
Next add the "wwan" interface.
vi /etc/config/network
config interface wwan option proto dhcp
Restart networking and you should be set. /etc/init.d/network restart
Installing BATMAN
These are the required packages:
kmod-batman-adv_3.3.8+2012.3.0-3_<chipset>.ipk kmod-crypto-crc32c_3.3.8-1_<chipset>.ipk kmod-crypto-hash_3.3.8-1_<chipset>.ipk kmod-lib-crc16_3.3.8-1_<chipset>.ipk kmod-lib-crc32c_3.3.8-1_<chipset>.ipk kmod-tun_3.3.8-1_<chipset>.ipk libpthread_0.9.33.2-1_<chipset>.ipk
Router-specific notes
Asus RT-N10+
This router has TFTP enabled out of the box. You _must_ set your computer's IP address on ethernet, however, to '192.168.1.15' in order to be able to use a command-line TFTP client.
Meraki mini
None of the methods on the openwrt wiki page worked, so I had to resort to using the serial console.
- Open the router (two screws behind the sticker).
- Connect a USB to 3.3v serial adapter to the serial pins.
Serial pins with the antenna pointing away from you and the ethernet port pointing towards you, from left to right:
1: 3.3v 2: TX 3: RX 4: GND
The router may either be using 9600 or 115200 baud. Other settings are 8N1 with software and hardware flow control turned off.
Start minicom with e.g:
minicom -o -D /dev/ttyUSB0
Then configure by hitting ctrl+a followed by an o. Use the arrow keys to select "Serial port setup" and adjust settings. When done, hit escape once or twice to exit the menu. Optionally you can choose to "Save setup as dfl" to save the settings for next time.
When you plug in the router with the serial connected, you should see the following line:
== Executing boot script in 2.000 seconds - enter ^C to abort
Once you see that line, immediately hit ctrl+c.
You will then get a RedBoot prompt like this:
RedBoot>
Leave that sitting in its window for a bit. You'll need it later.
You will now need to set up a tftp server on your computer.
Install the tftp server:
sudo aptitude install tftpd-hpa
Make sure it isn't running with default parameters:
sudo /etc/init.d/tftpd-hpa stop
Download openwrt:
cd mkdir openwrt_for_meraki_mini cd openwrt_for_meraki_mini wget http://downloads.openwrt.org/attitude_adjustment/12.09/atheros/generic/openwrt-atheros-vmlinux.gz wget http://downloads.openwrt.org/attitude_adjustment/12.09/atheros/generic/openwrt-atheros-root.squashfs
You may want to get a different version than attitude adjustment stable. Just make sure you get the two files ending in vmlinux.gz and root.squashfs, and make sure you get them for the atheros chipset.
Ensure that NetworkManager is not managing your network card. The easiest temporary way of doing this is to stop NetworkManager:
sudo /etc/init.d/network-manager stop
Change the IP of your network card to 192.168.84.9:
sudo ifconfig eth0 192.168.84.9 netmask 255.255.255.0 up
cd into the directory where the .gz and .squashfs files are located, then start the tftp server:
sudo in.tftpd -l -L -p --address 192.168.84.9 --secure ./
It doesn't tell you it's been started, it just sits there waiting. You can test that it's working using:
curl tftp://192.168.84.9/openwrt-atheros-vmlinux.gz > /tmp/out.gz
Which should download the .gz file to /tmp/out.gz
Now, go back to the RedBoot console waiting for you in minicom:
Execute the following commands, pressing y when asked questions. The "fis create" commands will take a long time to complete.
RedBoot> ip_address -l 192.168.84.1 -h 192.168.84.9 RedBoot> fis init RedBoot> load -r -b 0x80041000 -m tftp -h 192.168.84.9 openwrt-atheros-vmlinux.gz RedBoot> fis create -r 0x80041000 -l 0x180000 -e 0x80041000 linux RedBoot> load -r -b 0x80041000 -m tftp -h 192.168.84.9 openwrt-atheros-root.squashfs RedBoot> fis create -r 0x80041000 -l 0x620000 rootfs RedBoot> fconfig -d boot_script_data fis load -d linux exec RedBoot> reset
Thanks to the Hack Notes blog for the above RedBoot commands.
After the router resets, you should have OpenWRT running in the serial console. Change your IP address again:
sudo ifconfig eth0 192.168.1.100 netmask 255.255.255.0 up
Now you should be able to telnet into the meraki:
telnet 192.168.1.1
If it worked: Hurray!
When you're done, remember to re-enable network manager:
sudo /etc/init.d/network-manager start