User Tools

Site Tools

This wiki is read only and for archival purposes only. >>>>>>>>>> Please use the new OpenWrt wiki at <<<<<<<<<<


This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:howto:generic.flashing [2013/05/15 20:25]
doc:howto:generic.flashing [2017/05/21 08:41] (current)
tmomas OpenWrt spelling corrected
Line 1: Line 1:
 +====== Installing OpenWrt ======
 +The installation of OpenWrt is device specific.
 +These device specific procedures should be found in the wiki. See [[toh:​start|Table of Hardware]] for available procedures. If your device is not listed, information in this Howto may be helpful. /* Definitely have a look at the [[doc:​techref:​Flash.Layout]]. */
 +:!: If your attempt to install OpenWrt fails, please view [[doc/​howto/​generic.debrick]] for fixes.
 +:!: This HOWTO is VERY generic. You cannot use it in most situations, as you have to adapt values and other parts for specific hardware. Please look at the [[toh:​start|supported hardware page]] for device-specific documentation.
 +In most circumstances;​ you have three options:
 +  * **''​Option 1:''​** install OpenWrt onto the router'​s non-volatile memory
 +  * **''​Option 2:''​** install OpenWrt onto the RAM
 +  * **''​Option 3:''​** boot OpenWrt over the network ([[inbox:​howto:​netboot|netbooting]] is not supported by all [[doc:​techref:​bootloader|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. Your device should reboot with OpenWrt installed.
 +**''​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 [[doc:​techref:​bootloader|bootloaders]] provide built-in functionality for this purpose. Some use a [[wp>​Trivial File Transfer Protocol|TFTP]]-client,​ others a TFTP-server,​ others a [[wp>​File Transfer Protocol|FTP]]-client,​ some an FTP-server, some a web server and some use the [[wp>​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 [[wp>​List of TCP and UDP port numbers|default]])
 +  * 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.
 +  - Install the appropriate software on your PC (i.e. if the bootloader uses an FTP-server, you need a FTP-client).
 +  - Read the appropriate manual page ie: ''​[[http://​​man/​1/​tftp|tftp]]'',​ ''​[[http://​​man/​8/​tftpd|tftpd]]'',​ ''​[[http://​​man/​1/​ftp|ftp]]'',​ ''​[[http://​​man/​1/​ncftp|ncftp]]'',​ ''​[[http://​​man/​8/​ftpd|ftpd]]'',​ ''​[[http://​​man/​8/​pure-ftpd|pure-ftpd]]'',​ etc ...
 +  - Configure a static IP address for your PC interface in the same IP address block as pre-configured in the bootloader.
 +  - Connect your PC to the device.
 +  - Power cycle the device.
 +  - Connect to the bootloader using the software you chose
 +  - Install the OpenWrt firmware file.
 +  - **<color red>Do not overwrite or alter the bootloader</​color>​** 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 [[wp>​Network interface controller|NIC]] and/or [[http://​​kb/​239924|disable media sensing]].
 +=== Specific Howtos ===
 +  * [[doc:​howto:​generic.flashing.tftp]]
 +  * [[doc:​howto:​generic.flashing.ftp]]
 +  * [[doc:​howto:​generic.flashing.xmodem]]
 +==== Method 3: via Bootloader and Serial port ====
 +  * [[doc:​howto:​generic.flashing.serial]]
 +==== Method 4: via JTAG ====
 +  * [[doc/​hardware/​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.
 +  - specifically select the RAMDISK option to make OpenWrt Buildroot create a ramdisk-image for you to upload
 +  - 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.
 +  - 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.
 +  - set your computer'​s ethernet port to use the IP address ''​​24''​
 +  - set up a TFTP server on your local computer to respond to requests on the interface. Make sure that the ramdisk image (openwrt-ar71xx-uImage-lzma.bin) is in the directory used by the TFTP server.
 +  - 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://​​openwrt/​wndr3700/​ and run it from the TFTP server'​s data directory. I've also reproduced the code here just in case:
 +    * <code bash>
 +./wndr3700 openwrt-ar71xx-uImage-lzma.bin openwrt-fixed.out
 +  - 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):
 +  - enter the following into the serial console:<​code bash>
 +setenv ipaddr
 +setenv serverip
 +setenv bootargs '​board=WNDR3700'​
 +tftpboot 80800000 openwrt-fixed.out
 +</​code>​(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!)
 +  - The system should boot!
 +Concrete examples: [[toh/​netgear/​wnr2000]],​ ...
 +Don't forget to consult the other [[doc:​howto:​generic.overview|Generic Basic Howtos for OpenWrt]]
 +===== Installation Checklist =====
 +//This checklist cannot and does not completely cover all the ways you can install OpenWrt.//
 +  <​head>​
 +    <style type="​text/​css">​
 +      .checklist label { display: block; }
 +      .lvl1 {margin-left:​1em;​ font-weight:​bold;​ margin-top:​1em;​}
 +      .lvl2 {margin-left:​2em;​}
 +      .lvl3 {margin-left:​4em;​ font-style:​italic;​}
 +    </​style>​
 +  </​head>​
 +  <​body>​
 +    <form class="​checklist">​
 +      <label class="​lvl1"><​input type="​checkbox">​ Pre-Installation</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Say hello in <a href="​http://​​channels=#​openwrt">#​openwrt</​a>​ channel at freenode.</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Make sure that the router has currently stock/​original firmware installed.</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Configure your computer to use static IP address.</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Connect to the router with wire, not WiFi.</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Do your own research and read all the resources about installing OpenWrt on your router:</​label>​
 +          <label class="​lvl3"><​input type="​checkbox">​ <a href="​http://​​doc/​faq/​before.installation">​FAQ before installation</​a></​label>​
 +          <label class="​lvl3"><​input type="​checkbox">​ <a href="​http://​​toh/​start">​Table of Hardware</​a></​label>​
 +          <label class="​lvl3"><​input type="​checkbox">​ <a href="​https://​">​OpenWrt forum</​a></​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Print or save those pages for offline reading:</​label>​
 +          <label class="​lvl3"><​input type="​checkbox">​ <a href="​http://​​doc/​howto/​firstlogin">​First login</​a></​label>​
 +          <label class="​lvl3"><​input type="​checkbox">​ <a href="​http://​​doc/​howto/​generic.failsafe">​Failsafe</​a></​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ (optional) <a href="​http://​​doc/​howto/​generic.backup">​Backup flash of your router.</​a></​label>​
 +      <label class="​lvl1"><​input type="​checkbox">​ <​b>​Installation</​b></​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Reboot router.</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Download OpenWrt image in proper location.</​label>​
 +          <label class="​lvl3"><​input type="​checkbox">​ In case of <a href="​http://​​doc/​howto/​generic.sysupgrade">​upgrading</​a>​ existing OpenWrt system, the proper location is RAM (usually /​tmp).</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Verify MD5 checksum of the OpenWrt image you downloaded.</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Make sure that there is at least as much free RAM as the size of OpenWrt image you have downloaded.</​label>​
 +      <label class="​lvl1"><​input type="​checkbox">​ <​b>​Post-Installation</​b></​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Do <a href="​http://​​doc/​howto/​firstlogin">​First login</​a>​ and set root password.</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ <a href="​http://​​doc/​howto/​generic.backup">​Backup flash of your router.</​a></​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Make yourself comfortable with the <a href="​http://​​doc/​howto/​generic.failsafe">​Failsafe</​a>​ mode.</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ <a href="​http://​​doc/​howto/​basic.config">​Configure your device</​a></​label>​
 +    </​form>​
 +  </​body>​