Skip to content

OpenWRT

What is OpenWRT?ΒΆ

In the ever-evolving landscape of networking technology, OpenWRT stands as a beacon of flexibility and empowerment for users seeking more from their routers. OpenWRT, short for Open Wireless Router, is an open-source firmware that replaces the standard firmware on many commercial routers. This transformation brings a wealth of advanced features, customization options, and enhanced control over your network.

With large fleets (or even small farms) of OpenWRT devices comes the challenge of managing them through their life cycle. The qbee-agent is designed to run on any Linux and is a perfect fit to achieve system management capabilities also for OpenWRT.

How to deploy the agent on OpenWRT?ΒΆ

Qbee does not provide ready made packages for OpenWRT due to the vast number of targets and subtargets. However, building the agent for a particular device is quite straight forward using the SDK integration for qbee-agent.

  1. Set up the build environment for OpenWRT as described here.

  2. Install golang

    wget https://go.dev/dl/go1.21.9.linux-amd64.tar.gz
    tar -xz -f go1.21.9.linux-amd64.tar.gz -C /usr/local
    export PATH=$PATH:/usr/local/go/bin
    
  3. Fetch the relevant OpenWRT SDK for the version of OpenWRT you intend to use and target/subtarget here

    Eg. for version 23.05.3 of OpenWRT with ramips as target and subtarget mt7621 as subtarget.

    wget https://archive.openwrt.org/releases/23.05.3/targets/ramips/mt7621/openwrt-sdk-23.05.3-ramips-mt7621_gcc-12.3.0_musl.Linux-x86_64.tar.xz
    tar xJf openwrt-sdk-23.05.3-ramips-mt7621_gcc-12.3.0_musl.Linux-x86_64.tar.xz
    cd openwrt-sdk-23.05.3-ramips-mt7621_gcc-12.3.0_musl.Linux-x86_64
    
  4. Build the qbee-agent for your target and subtarget by fetching the OpenWRT SDK integration qbee-agent-openwrt.

    git clone https://github.com/qbee-io/qbee-agent-openwrt package/qbee-agent
    ./scripts/feeds update packages
    make defconfig
    make package/qbee-agent/compile
    
  5. Package is now built and ready to install onto the OpenWRT system.

    find bin/packages/ -name "qbee-agent*.ipk"
    bin/packages/mipsel_24kc/base/qbee-agent_<agent_version>_mipsel_24kc.ipk
    
  6. Transfer the package to the OpenWRT system, install and bootstrap

    opkg install qbee-agent_<agent_version>_mipsel_24kc.ipk
    qbee-agent bootstrap -k <bootstrap_key>
    /etc/init.d/qbee-agent start
    

Configuring the OpenWRT device depends on the actual operational needs. You can either use the configuration options that the agent offers or use qbee-connect or qbee-cli to create a tunnel to the OpenWRT web based configuration interface.

!openwrt-qbee-agent-port-forwarding

Accessing the mapped port with a web browser will then display the following OpenWRT interface. Alternatively, it is possible to control the configuration file. This is an ideal use case for our key-value templating.

!openwrt-qbee-agent-web-ui

Setting initial administrative password

The OpenWRT clearly notifies that there are no administrative password set for this router. The password can easily be set (and rotated) as part of a qbee password configuration policy. Please note that your OpenWRT might not be configured with SHA hashing support and that you might need to generate passwords using legacy MD5 hashing to use for your qbee configuration.

openssl passwd -1 <your-password>