What if you have configure OpenWRT device and turn you device to useless? Or maybe some of configuration make you box inaccessible. But fortunately, OpenWRT has a built in feature for “resetting” your box. It’s called failsafe mode and this feature will attempt to bypass almost all configuration in favor of a few hard coded defaults. The device would boots up in 192.168.1.1/24 with only essential service running. From this state we can telnet and fix certain problems.
But how we can do it? This article will cover the basic.
In this article I will use TP-Link MR3020
Triggering via Hardware Button (Standard method)
- Set our IP address to 192.168.1.2 with subnet mask 255.255.255.0
- Turn off the device and turn it on again.
- Immediately after the device boot, press hardware reset
- Try to ping 192.168.1.1 to check whether the device has entered failsafe mode.
Here is a video on to do it (for MR3020 device):
Triggering via Keyboard key Combination
Unplug the router’s power cord.
Connect the router’s WAN port directly to your PC.
Configure your PC with a static IP address between 192.168.1.2 and 192.168.1.254. E. g. 192.168.1.2 (gateway and DNS is not required).
Plugin the power.
Connect via serial
Wait until the following messages is passing: Press the [f] key and hit [enter] to enter failsafe mode
Press “f” and the “enter” key
You should be able to telnet to the router at 192.168.1.1 now (no username and password)
Now we have entered failsafe mode. You will get message similar to this:
Note: the root filesystem in failsafe mode is the only SquashFS partition. The JFFS2 is not present. To mount JFFS2 in read-write mode run this command:
Now, suppose you forgot your password you just need to set a new one. A command to do so:
Another common problem is you forgot router. To get it just give command:
uci get network.lan.ipaddr
When you fill the entire JFFS2 or install too big/ too many packages, you can clean the entire JFFS2 partition by executing one of these command:
mtd -r erase rootfs_data
rm -r /overlay/*
After you have done, you can reboot by using:
That’s all. Happy hacking 🙂