Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I revert back to an OpenWrt router configuration? [closed]

I recently ported Luci to an OpenWrt router. I was just exploring the thing. I disabled the DHCP server on LAN and enabled as DHCP client. I saved and applied the configuration to the router. Now after a restart I am not able to connect the router webpage.

How do I enable the DHCP server again or can anyone let me know how to reset this OpenWrt router to default settings?

I tried in the serial port console. but I can't see any IP address for any interfaces. Before It was 192.168.1.1.

Please suggest...

like image 522
Surjya Narayana Padhi Avatar asked Sep 04 '12 08:09

Surjya Narayana Padhi


People also ask

What is the default IP of OpenWrt?

The default IP of the LAN ports of a OpenWrt device is 192.168. 1.1, if the addresses of the devices in the network you connect to the WAN port are 192.168. 1. X (X=any number), you need to change the IP address of the LAN interface on your OpenWrt router to 192.168.

What is OpenWrt router?

OpenWrt (from open wireless router) is an open-source project for embedded operating systems based on Linux, primarily used on embedded devices to route network traffic. The main components are Linux, util-linux, musl, and BusyBox.


3 Answers

Those who are facing this problem: Don't panic.

Short answer:

Restart your router, and this problem will be fixed. (But if your restart button is not working, you need to do a nine-step process to do the restart. Hitting the restart button is just one of them.)

Long answer: Let's learn how to restart the router.

  1. Set your PC's IP address: 192.168.1.2 and subnetmask 255.255.255.0 and gateway 192.168.1.1
  2. Power off the router
  3. Disconnect the WAN cable
  4. Only connect your PC Ethernet cable to ETH0
  5. Power on the router
  6. Wait for the router to start the boot sequence (SYS LED starts blinking)
  7. When the SYS LED is blinking, hit the restart button (the SYS LED will be blinking at a faster rate means your router is in failsafe mode). (You have to hit the button before the router boots.)
  8. telnet 192.168.1.1
  9. Run these commands:

    mount_root ## this remounts your partitions from read-only to read/write mode
    
    firstboot  ## This will reset your router after reboot
    
    reboot -f ## And force reboot
    
  10. Log in the web interface using web browser.

link to see the official failsafe mode.

like image 166
Nafis Ahmad Avatar answered Oct 19 '22 09:10

Nafis Ahmad


Some addition to previous comments: 'firstboot' won't be available until you run 'mount_root' command.

So here is a full recap of what needs to be done. All manipulations I did on Windows 8.1.

  • Enter Failsafe mode (hold the reset button on boot for a few seconds)
  • Assign a static IP address, 192.168.1.2, to your PC. Example of a command: netsh interface ip set address name="Ethernet" static 192.168.1.2 255.255.255.0 192.168.1.1
  • Connect to address 192.168.1.1 from telnet (I use PuTTY) and login/password isn't required).
  • Run 'mount_root' (otherwise 'firstboot' won't be available).
  • Run 'firstboot' to reset.
  • Run 'reboot -f' to reboot.

Now you can enter to the router console from a browser. Also don't forget to return your PC from static to DHCP address assignment. Example: netsh interface ip set address name="Ethernet" source=dhcp

like image 9
yuliskov Avatar answered Oct 19 '22 09:10

yuliskov


You can run this command for making a factory reset:

killall dropbear uhttpd; sleep 1; mtd -r erase rootfs_data
like image 7
developer Avatar answered Oct 19 '22 08:10

developer