OpenWRT: OpenWRT Failsafe

Home / OpenWRT: OpenWRT Failsafe

OpenWRT: OpenWRT Failsafe

December 3, 2015 | Article | No Comments

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)

  1. Set our IP address to 192.168.1.2 with subnet mask 255.255.255.0
  2. Turn off the device and turn it on again.
  3. Immediately after the device boot, press hardware reset
  4. 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

  1. Unplug the router’s power cord.
  2. Connect the router’s WAN port directly to your PC.
  3. 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).
  4. Plugin the power.
  5. Connect via serial
  6. Wait until the following messages is passing: Press the [f] key and hit [enter] to enter failsafe mode
  7. Press “f” and the “enter” key
  8. 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:

mount_root

Now, suppose you forgot your password you just need to set a new one. A command to do so:

passwd

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:

firstboot

or

mtd -r erase rootfs_data

or

rm -r /overlay/*

After you have done, you can reboot by using:

reboot -f

That’s all. Happy hacking 🙂

,

About Author

about author

xathrya

A man who is obsessed to low level technology.

Leave a Reply

Your email address will not be published. Required fields are marked *

Social media & sharing icons powered by UltimatelySocial