Installing OpenWrt
Installing OpenWrt
http://wiki.openwrt.org/doc/howto/generic.flashing 1/4
Installing OpenWrt
The installation of OpenWrt is device specific. A detailed procedure should be found in the wiki-
page for your device. See Table of Hardware for available ones. If your device is not listed, read
on Definitely have a look at the Flash Layout.
Warning!
This section describes actions that might damage your device or firmware.
Proceed with care!
If your attempt to install OpenWrt fails, generic.debrick could help you.
This Howto is VERY generic. You cannot just use it, but you have to adapt values and other stuff
to your hardware. Look at the supported hardware page for your device-specific documentation.
Generally, you have three options:
Option_1: install OpenWrt onto the router's non-volatile memory: this page
Option_2: install OpenWrt into the RAM:
Option_3: boot OpenWrt over the network: Netbooting is not supported by all bootloaders!
Four Installation Methods
There are four ways to install OpenWrt on a device:
Method 1: via OEM firmware
Open the WebUI of the OEM firmware with your web browser and install the OpenWrt factory
firmware image file using the "Firmware Upgrade" option. Done.
NOTE: Sometimes the OEM firmware will only allow you to flash your device with a specific
firmware file. If that is the case, you will not be able to install OpenWrt using this method.
However, for some devices the build bots prepare tagged builds such that they are compliant with
the firmwares from the manufacturer. This should be documented on the device specific page for
your model.
Method 2: via Bootloader and an Ethernet port
Most, if not all bootloaders provide built-in functionality for this purpose. Some use a TFTP
[http://en.wikipedia.org/wiki/Trivial File Transfer Protocol]-client, others a TFTP-server, others a FTP
[http://en.wikipedia.org/wiki/File Transfer Protocol]-client, some an FTP-server, some a web server and
some use the XMODEM [http://en.wikipedia.org/wiki/XMODEM]-protocol.
Before proceeding you need to determine the following:
the preset IP address of the bootloader (not necessarily identical to the IP address the device
has after it has booted the original firmware!)
the protocol and whether the bootloader acts as client or as server
the correct port number (if not default [http://en.wikipedia.org/wiki/List of TCP and UDP port
numbers])
the interface you need to connect to
a user name and login password (if necessary)
the time window you have after starting the device to obtain a connection
Once you know all of the above parameters, you may proceed.
1. Install the appropriate software on your PC (i.e. if the bootloader uses an FTP-server, you
need a FTP-client).
8/17/2014 Installing OpenWrt - OpenWrt Wiki
http://wiki.openwrt.org/doc/howto/generic.flashing 2/4
need a FTP-client).
2. Read the appropriate manual page ie: tftp [http://linux.die.net/man/1/tftp],
tftpd [http://linux.die.net/man/8/tftpd],
ftp [http://linux.die.net/man/1/ftp],
ncftp [http://linux.die.net/man/1/ncftp],
ftpd [http://linux.die.net/man/8/ftpd],
pure-ftpd [http://linux.die.net/man/8/pure-ftpd], etc
3. Configure a static IP address for your PC interface in the same IP address block as pre-
configured in the bootloader.
4. Connect your PC to the device.
5. Power cycle the device.
6. Connect to the bootloader using the software you chose
7. Install the OpenWrt firmware file.
8. Do not overwrite or alter the bootloader until explicitly instructed to do so!
NOTES: Sometimes even the bootloader prevents you from flashing a non-OEM firmware. If you
have a short time window, the connection between your computer and device needs to be
established quickly. To make this as quick possible, you can disable auto-negotiation on your
NIC [http://en.wikipedia.org/wiki/Network interface controller] and/or disable media sensing
[http://support.microsoft.com/kb/239924].
Specific Howtos
generic.flashing.tftp
generic.flashing.ftp
generic.flashing.xmodem
Method 3: via Bootloader and Serial port
generic.flashing.serial
Method 4: via JTAG
port.jtag
Install a ramdisk-image into main memory
This step shows you howto upload a new ramdisk image to the device. The existing firmware on
the flash remains unchanged! You require a working serial cable to do the ramdisk upload.
1. specifically select the RAMDISK option to make OpenWrt Buildroot create a ramdisk-image for
you to upload
2. connect an ethernet cable between your computer and one of the LAN ports (doesn't matter
which, just so long as it's not the WAN port) of the WNDR3700.
3. connect your serial cable to the header on the WNDR3700 and set your local terminal
program (eg. minicom) to
115200 bps 8N1
no software flow control
no hardware flow control.
4. set your computer's ethernet port to use the IP address 192.168.0.10/24
5. set up a TFTP server on your local computer to respond to requests on the 192.168.0.10
interface. Make sure that the ramdisk image (openwrt-ar71xx-uImage-lzma.bin) is in the
directory used by the TFTP server.
6. Fix the header for the ramdisk image so that it's recognized by the u-Boot firmware. Use the
8/17/2014 Installing OpenWrt - OpenWrt Wiki
http://wiki.openwrt.org/doc/howto/generic.flashing 3/4
6. Fix the header for the ramdisk image so that it's recognized by the u-Boot firmware. Use the
wndr3700.c program that was posted by *aorlinsk* on the forums here
http://aorlinsk2.free.fr/openwrt/wndr3700/ [http://aorlinsk2.free.fr/openwrt/wndr3700/] and run it
from the TFTP server's data directory. I've also reproduced the code here just in case:
./wndr3700 openwrt-ar71xx-uImage-lzma.bin openwrt-fixed.out
7. power up the board. When it gets to the message asking you to press any key to interrupt the
normal bootup sequence, press a key on the serial console (or just hold down the enter key
from first bootup until you get to a prompt):
8. enter the following into the serial console:
setenv ipaddr 192.168.0.1
setenv serverip 192.168.0.10
setenv bootargs 'board=WNDR3700'
tftpboot 80800000 openwrt-fixed.out
bootm
(if you forget the bootargs piece below, the board will boot and look normal, but it won't be
able to bring up any of the network interfaces!)
9. The system should boot!
Concrete examples: wnr2000,
Don't forget to consult the other Generic Basic Howtos for OpenWrt
Installation Checklist
This checklist cannot and does not completely cover all the ways you can install OpenWrt.
Pre-Installation
Say hello in #openwrt channel at freenode.
Make sure that the router has currently stock/original firmware installed.
Configure your computer to use static IP address.
Connect to the router with wire, not WiFi.
Do your own research and read all the resources about installing OpenWRT on your router:
FAQ before installation
Table of Hardware
OpenWRT forum
Print or save those pages for offline reading:
First login
Failsafe
(optional) Backup flash of your router.
Installation
Reboot router.
Download OpenWRT image in proper location.
In case of upgrading existing OpenWrt system, the proper location is RAM (usually /tmp).
Verify MD5 checksum of the OpenWRT image you downloaded.
Make sure that there is at least as much free RAM as the size of OpenWRT image you
have downloaded.
Post-Installation
Do First login and set root password.
Backup flash of your router.
Make yourself comfortable with the Failsafe mode.
8/17/2014 Installing OpenWrt - OpenWrt Wiki
http://wiki.openwrt.org/doc/howto/generic.flashing 4/4
Make yourself comfortable with the Failsafe mode.
Configure your device
Back to top
doc/howto/generic.flashing.txt Last modified: 2014/06/15 12:53 by tmomas
This text is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported
License.