Skip to content

OpenWRT

Hardware considerations

First setup

  • Set root-pw
  • Set IP, reboot
  • add ssh key
  • Login in via ssh

Install packages:

opkg update
opkg install git tmux
  • Check in /etc
cd /etc
git init .
git add .
git commit -m'Initial commit'

Upgrade all packages

Since OpenWrt firmware stores the base system in a compressed read-only partition, any update to base system packages will be written in the read-write partition and therefore use more space than it would if it was just overwriting the older version in the compressed base system partition. It's recommended to check the available space in internal flash memory and the space requirements for updates of base system packages.

Run in tmux (!):

tmux
opkg list-upgradable | cut -f 1 -d ' ' | xargs -r opkg upgrade
reboot

Add packages

Basics

opkg install curl luci-app-ddns luci-app-upnp screen rsync

openssh

opkg openssh-client openssh-sftp-server

Storage

Freeing space

What helped after package installation broke and left half-installed packages:

  • Removed leftovers from /overlay/upper/usr/lib/
  • Reboot

USB Storage

Quick Start for Adding a USB drive

Extroot

For SD-Card usage (yes, kmod-usb-storage needs to be installed to access a sd-card, at least on the GL.Inet X-750):

opkg install kmod-mmc kmod-usb-storage
ls -al /sys/block/
ls -la ls -al /dev/sd*
parted -s /dev/sda -- mklabel gpt mkpart extroot 2048s -2048s

Recovery

Failsafe mode

Failsafe mode is useful if you have lost control of your device, and it has become inaccessible, perhaps through a configuration error. It allows you to reboot the router into a basic operating state, retaining all your packages and (most) settings.

Power on the device, wait for a flashing LED and press a button. This can be the WPS, Reset, or other button on the device.

The LEDs provide clues for timing the button press. Watch the LED blinking speeds immediately after powering up the router. Most routers show three different (power) LED blinking speeds during boot:

  • A power-on sequence of lights that is specific to the device's bootloader
  • Then a semi-rapid 5-per-second blinking rhythm during four seconds, while router waits for a button press
  • Then either:
    • A really fast 10-per-second blink if failsafe mode was triggered. The device is listening on 192.168.1.1
    • A slower, 2.5-per-second blink continuing to the end of normal boot, if the failsafe was not triggered

Then ssh into the device: ssh root@192.168.1.1 (no password needed)