Cleanup Required!
This page or section needs cleanup. You can edit this page to fix wiki markup, redundant content or outdated information.

Installing OpenWrt

This page explains the general sequence needed to get OpenWrt up and running. Generally, you have two options: Flash OpenWrt onto the router's non-volatile memory, or boot OpenWrt over the network (a.k.a. "netboot"). Netbooting is not supported by all devices and/or boot loaders.

Supported Hardware

Compatibility with your router should be determined before installing OpenWrt. The Table Of Hardware page contains a list of supported devices. Certain models have links to additional technical and setup information.

Obtaining the OpenWrt Firmware

OpenWrt's Version History page lists current and past releases of the firmware. A link is provided to the download page for the latest stable firmware version. Each firmware version is listed on the page, and has a corresponding link to a summary of newly-added hardware, as well as notable changes.

TRX vs. BIN

FIXME This seems to be extremely outdated information left over from the White Russian days!

OpenWrt firmware files are shipped as either trx or bin files. The bin file is nothing more than a trx file with additional information added to make it compatible with the vendor's upgrade utilities. bin files should only be used when you cannot use the trx files directly.

  • openwrt-brcm-2.4-.trx
    • This is the firmware in raw format, exactly as it will be written to the flash. This format is used when upgrading from within OpenWrt or during the initial install on one of the following:
  • openwrt-wrt54g-.bin; openwrt-wrt54gs-.bin; openwrt-wrt54gs_v4-.bin; openwrt-wrtsl54gs-.bin
    • This is the exact same as the trx file above, with one exception – a small header has been added to the start of the file, marking it as a valid upgrade for Linksys models. Supported models:
      • openwrt-wrt54g-.bin
      • openwrt-wrt54gs-.bin
      • openety-wrt54g3g-.bin
      • openwrt-wrt54gs_v4-.bin
      • openwrt-wrtsl54gs-.bin
      • openwrt-wa840g-.bin; openwrt-we800g-.bin; openwrt-wr850g-.bin
        • This is also a trx file, but with a Motorola header added to the start of the file, making it a valid firmware file for a Motorola device.

There are 3 trx files, found in the micro, pptp, and bin directories explained above. Size restrictions aside, it doesn't matter which directory you pick.

It is strongly recommended that once the firmware image has been downloaded, it be checked for possible corruption with an MD5 utility. This can be verified by comparing the md5sum from your downloaded image with the md5sum listed in the md5sums file found in the download directory. For Win32 platforms, use md5sums.exe. For GNU/Linux systems, use the

md5sum
command.

Netboot

(…)

Flashing OpenWrt

There are multiple ways to reflash the firmware; we will explain each method below. You can use any method; the end result will be the same. After reflashing, the device will automatically reboot into the new firmware.

If you are not happy with OpenWrt, you can always reinstall your original firmware. Please be sure you have it downloaded and saved on your PC.

:!: It is strongly recommended to print a copy of troubleshooting in case you have any trouble with the install

via vendor supplied web interface

This is the easiest method. Open your web browser, and use the firmware upgrade page on your device to upload the OpenWrt firmware.

You should use HTTP rather than HTTPS for the firmware upgrade.

via tftp

If you're being extremely cautious or are attempting to reflash from a failed upgrade, you can use TFTP to install the firmware. This method is explained in detail on the tftp page.

:!: Note: some models have additional requirements, please refer to the CategoryModel page for documentation specific to your router model.

via CFE

If you already have the serial cable, you'll know how to do it, nevertheless… go cfe

via JTAG

It's not recommended to flash the kernel image via jtag, as it will take more than 2 hours, but it is possible jtag

via the OpenWrt command line

Reflashing OpenWrt will overwrite the filesystem, erasing all previous applications and data. You are strongly urged to back up any changes you may have made to the system.

mtd -r write firmware.trx linux


For models low on memory (8MB), the firmware can be flashed directly from a web site.

:!: Do not use this unless it is absolutely necessary. A dropped connection will result in a partially flashed router. You have been warned.

wget http://www.somesite.com/firmware.trx -O - | mtd -e linux -r write - linux

A slightly safer option is to use netcat to get the image from another machine on the local LAN. The code bellow was tested with the machine sending the image at 192.168.1.6 and running Linux, the router at 192.168.1.1, and 5050 as the transfer port. Change these values to suite your needs. As for the port, any available port will do, but it is probably a good idea to verify that the given machine/port combination is accessible from the router before starting.

The steps are as follows:

  • On the serving machine, Tell netcat to listen on port 5050, and send the firmware when a connection is made:

    nc -l -p 5050 -q 1 < openwrt-XXXX-XXXX.trx
   

  • now ssh to the router, and tell it to get the image from the server and install it:

    nc 192.168.1.6 5050 | mtd -e linux -r write - linux
   

Via Fon Flash (for FONs and related hardware)

For the FON products, there is a separate loader that can flash the router via its network connection. Fon Flash can be found at the Gargoyle download page (select FonFlash as the download). You'll also need to install WinPCAP, which can be found here. Start FonFlash, select the correct files and settings, connect the FON to your computer via its "Internet" interface, press "Flash Router Now!" and power up your FON. After about half an hour, FonFlash will report that the flash was successful, and you'll have an OpenWRT router.

What's Next?

The configuring page is your next step. It explains how to set a password and secure access to OpenWrt.


Categories:

Back to top

doc/howto/installing.txt · Last modified: 2010/08/28 09:25 by dedi