Skip to content

OpenWRT flashing

TFTP

Install

Arch

sudo pacman -S tftp-hpa
  • Config: /etc/conf.d/tftpd
  • Server root dir: /srv/tftp/

Debian/Ubuntu

sudo apt-get install tftpd-hpa tftp

Prevent tftp from auto-start:

sudo systemctl stop tftpd-hpa.service
sudo systemctl mask tftpd-hpa.service

Usage

Using a script

Flashing a Fritzbox 7530 worked with this script:

#!/bin/sh

NETDEV=enp45s0u2u3u2
sudo ip address flush dev $NETDEV
sudo ip address add 192.178.1.70/24 dev $NETDEV

sudo in.tftpd --listen --ipv4 --foreground -vvvvv --secure .

Using the systemd service

Increase verbosity in /etc/default/tftpd-hpa by adding -vvv to TFTP_OPTIONS:

TFTP_OPTIONS="--secure -vvv"

Copy firmware to /srv/tftp dir:

sudo cp openwrt-ramips-mt76x8-tplink_tl-mr6400-v5-squashfs-tftp-recovery.bin /srv/tftp/tp_recovery.bin

sudo systemctl start tftpd-hpa.service

Prepare for flashing:

sudo systemctl stop NetworkManager
sudo ip addr add dev enx0050b6ebc45b 192.168.0.225/24

Testing tftpd

sudo journalctl -f -u tftpd-hpa.service

tftp localhost
tftp> get tp_recovery.bin
Received 8166088 bytes in 0.2 seconds
tftp> quit

rm tp_recovery.bin

After flashing

IP after flashing:

  • ssh root@192.168.1.1
  • Open http://192.168.1.1
  • Initial OpenWRT credentials: User root, Password: root