# OpenWrt

## Summary


OpenWrt is a Linux-based customizable operating system for embedded devices. Instead of being a static firmware, it's a flexible Linux distribution that allows applications to be added/removed through a package management system without having to rebuild the entire firmware. 

OpenWrt started as a means to give users and developers control over router firmware. The suffix "WRT" itself comes from Wireless RouTer. Today, OpenWrt can be used in various embedded devices including Wi-Fi routers, wired routers, residential gateways, smartphones, laptops and even x86-based PCs.

## Discussion

### Why should I use OpenWrt?

Hardware manufacturers normally ship their products with their own firmware. However, such a firmware may be unstable or lack features that you desire. One Reddit user noted many problems with the default firmware: broken port forwarding, security flaws, missing IPv6 support, limited routing support, no patches, no SSH access, etc. Manufacturers may not bother patching old device models. Their firmware may also have government backdoors. 

This is where OpenWrt comes in as a suitable alternative. Users can download pre-built binaries and customize the same with necessary packages. Developers can built firmware from source and develop new packages. The code is open source and is maintained by a community of developers. Because source is open, OpenWrt is a useful tool for students and researchers. Moreover, one can get enterprise-class features by installing OpenWrt on a cost-effective hardware. 

As of January 2017, OpenWrt is supported for close to 700 different models across brands. In February 2011, OpenWrt had about 2000 packages. In 2017, this number was 3500. 


### How are people customizing OpenWrt for their routers?

With OpenWrt, users/developers can use their router to run a BitTorrent client, enable VPN, create a guest Wi-Fi network, analyze network traffic, do traffic-shaping or apply QoS rules on packets. The router can also run servers: SSH (and do SSH tunneling), IRC server, HTTP server, FTP server, etc. Mesh networking, port knocking, firewalling, wireless bridging, file sharing and real-time monitoring are some other useful features. When configured as a public hotspot, OpenWrt provides a number of functions to manage the hotspot. 

OpenWrt can also connect to printers, webcams, modems and soundcards. In general, an OpenWrt device can work with any hardware that has Linux support. 


### Could you share some technical details of OpenWrt?

OpenWrt is a Linux distribution but because it's optimized for embedded systems, many of the libraries have been customized. uClibc is the C standard library used. Utilities from BusyBox are used though procd has replaced some of them for process management. For package management, opkg is used. It's been claimed that a stripped version of OpenWrt can run with only 8 MiB of main memory and non-volatile storage of 2 MiB. 

The firmware is composed of image (kernel + rootfs) and optional packages. Linux, BSD or MacOS are recommended for the host system building the firmware. Robbie Cao has shared a detailed discussion of OpenWrt's build process, installation, configuration, package management system, boot up sequence and memory layout. 


### What are some open source alternatives to OpenWrt?

Many of the alternatives themselves are derived from OpenWrt: LEDE, Gargoyle, Fon, libreCMC, Freifunk, LibreMesh, etc. Other alternatives include DD-WRT, pfSense, ClearOS, Tomato (and its derivatives), LibreMesh, telehash, Gluon and OpenWISP. FreeWRT and Chilifire are also available. 

While OpenWrt is more of a customizable Linux distribution, DD-WRT is a monolithic build. OpenWrt takes a little more work than DD-WRT for the user but OpenWrt has more features. Tomato is lightweight and strikes a balance between performance and features. However, it supports fewer device variants unlike DD-WRT. DD-WRT is claimed to be the most popular open source router firmware. 


### Are there any concerns with using OpenWrt?

Flashing your router with OpenWrt will void the manufacturer's warranty. In some exceptional cases, due to incompatibility, the device may become unusable (bricked) after loading OpenWrt. If device has a button to revert to factory settings, this could be an option to recover it. In any case, flashing a replacement firmware should be avoided via a wireless link. Also, ensure that availability of uninterrupted power supply during the process. 

Some routers using open source firmware have been blamed for using 5 GHz spectrum without using Dynamic Frequency Selection (DFS). As a result, they interfere with weather radar systems. Since June 2016, in the US, devices are required to operate within allowed bands, modulations and power levels. Some manufacturers such as TP-Link took the easy path of preventing the use of open source firmware while Linksys still allows them with necessary checks. 

Some have claimed that one can boost power levels with open source firmware. However, if done wrongly, this may violate local limits and regulations. 


### What tools are available to build, install or configure OpenWrt and its packages?

The development and build environment is called *OpenWrt Buildroot*, which is derived from *Buildroot* system. This allows developers to cross-compile for different target architectures and automate the build process using makefiles and scripts. 

*OpenWrt SDK* is needed to build userspace packages. We can download a pre-built SDK or build one ourselves. Package manager *opkg* is used to install/remove/update pre-built packages. If we are building a custom package, OpenWrt SDK can also be used to manage the package. 

Configuration is centralized via *Unified Configuration Interface (UCI)*. We can configure OpenWrt from a command console or from a web interface named *LuCI*. Alternative web interfaces include *X-Wrt* and *Gargoyle Router Management Utility*. LuCI includes a package manager page. In fact, some packages have their own configuration pages in LuCI. 


### As a developer, how can I contribute to OpenWrt?

OpenWrt is completely open source and community driven. It's released under GPL v2.0 license. The code is available on GitHub. You can either contribute to the main distribution or to the various community-maintained packages. Documentation is on OpenWrt Wiki.

Tasks for developers typically include the following: 

    + Update the Linux kernel to more recent versions
    + Fix bugs in kernel or packages: these may include security fixes
    + Update to drivers and networking protocols
    + Support new hardware and new platforms
    + Write new packages
    + Participate in code reviews and testing
    + Improve build, packaging and development tools


## Milestones

2003

Linksys releases router WRT54G with support for IEEE 802.11g standard. Some folks in open source community investigate the firmware and find that it uses open source Linux components. Under pressure from community, Linksys releases firmware source code in July 2003. This is the genesis of OpenWrt, and custom router firmware in general. Sveasoft's Alchemy and Talisman, and BrainSlayer's DD-WRT are based on this firmware. 

Jan  
2004

OpenWrt project is started. First version is released the same year using Linksys open source firmware for the Linksys wireless router WRT54G. 

2008

LuCI project is started to provide a web user interface for embedded devices. It's based on Lua programming language. OpenWrt adopts this interface in Kamikaze 8.09 release. Today, LuCI source code is part of OpenWrt.

Oct  
2015

OpenWrt Summit is organized for the first time to discuss OpenWrt technology and support the movement. It happens in Dublin, Ireland. 

Mar  
2016

Chaos Calmer 15.05.1 is released. This is a maintenance release on Chaos Calmer 15.05 released in September 2015. Note that the number "15.05" indicate that release branch was created in May 2015, although the release was finalized only in September. Next OpenWrt release named "Designated Driver" is under development. 

May  
2016

*Linux Embedded Development Environment (LEDE)* is born as a fork of OpenWrt. LEDE is started by many active OpenWrt developers unhappy with OpenWrt's processes and lack of transparency, among other things. LEDE promises more open communication, liberal merge policy, automated testing, simplified release process, predictable release cycles and simple infrastructure that requires little maintenance. 

May  
2017

OpenWrt and LEDE projects meet and plan for a merger. 

Jan  
2018

OpenWrt code is replaced by code from LEDE as part of efforts to merge the two under the original brand name of OpenWrt.