The Asus router reboot script

On old router firmware Asus often noticed that the web interface is not fully open, not all the menus are displayed, so it can not be configured accordingly and can not be restarted if remote access is also available, since the reset button is not displayed.
So he took the Asus RT-N12E router, ran the Wireshark sniffer, opened the web interface of the router and pressed the reboot button.
In the intercepted packets, you could see that the Reboot.asp file is being rebooted in the root directory.

This resulted in a script for rebooting Asus routers:

#!/bin/sh
ROUTER_IP="192.168.1.1"
USERNAME="admin"
PASSWORD="admin"

# exit if router is down
ping -q -c 1 "$ROUTER_IP" > /dev/null || exit

curl --basic --user "$USERNAME:$PASSWORD" -A "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" --refer "http://$ROUTER_IP" "$ROUTER_IP/Reboot.asp"

The contents of the script will be placed in a new file, for example, using the nano editor (“CTRL+X” to exit and “y” to save the changes):

nano file.sh

Let’s make it executable:

chmod 777 file.sh

After this, we execute:

./file.sh

You can also manually open the link http://192.168.1.1/Reboot.asp in the browser if you need to reboot the router once.

How to upgrade the Firmware of the ASUS RT-N12E Router

In order to update the firmware of the Asus RT-N12E router, you need to enter its settings by typing in the browser address http://192.168.0.1 and enter your login – admin, password – admin, see the firmware version that is installed, usually it is written at the very top, for example “Firmware version: 2.0.0.16”.

Check for a new version of the firmware on the official site and if it is there to download it:
http://www.asus.com/Networking/RTN12E/HelpDesk_Download

Next, open the menu “Administration“, select a tab “Firmware Upgrade“, press “Browse” and select the firmware file, click “Send” and wait for the update process to complete.

The configuration of the router remains unchanged.
If the update fails, the router can be restored using a utility that can also be downloaded from the link above.