If you have access to the device click system – Backup Flash firmware and click the Reset to defaults button.
Otherwise you’ll have to use the more difficult process:
1 Power off the device
2 Set a static ip for the device you are connecting from on the 192.168.1.0 network
3 Open a command prompt and start a continuous “ping 192.168.1.1 -t”
4 Connect a cable to the router’s LAN PORT
5 power on device
6 ping will fail throughout the boot cycle, but there is a small window when the device will respond to ping, at that time press and hold the reset button for about 10 seconds,
connect to LAN PORT, and you can telnet the device on 192.168.1.1 (be sure to use telnet, there will be no login prompt)
*On some routers you may need to rapidly press a button to get to safemode
7 Issue the command: firstboot. When the command finished type reboot -f
You may need to power cycle the router. GUI will then be reachable on 192.168.20.1
At the login prompt do not fill out the password field, but be sure you add a valid password as you won’t be able to telnet/ssh the device.