Western Digital My Net N900 – add scheduled reboot support

[Update] The script will work with any router that has telnet access, ie: Dynalink routers.

My Western Digital My Net N900 router works fine for a while, but then performance degrades requiring a reboot. I guess this is quite usual with relatively low cost routers.

The problem is that the router doesn’t have a feature to schedule an automated reboot and I find it quite annoying to manually restart.

Luckily there is a way to overcome this limitation of the router. You will need to have access to linux machine in your network that we’ll use to reboot remotely the router. I have a Raspberry Pi as HTPC which is connected to my network and it’s on all the time, so I will be using that for this purpose.

Gain access to the router

The router can be accessed remotely is you enable “telnet” or “ssh” on it. This can be done via the web interface. My router has the IP address and I will be using this IP in my examples but your router might be accessible via

In order to enable the telnet service you need to access this url on your router:


Once this is enabled you should be able to get access to the router:

xbian@xbian ~ $ telnet 23

Entering character mode
Escape character is ‘^]’.

login: Alphanetworks
Password: wrgnd15_wd_pro

BusyBox v1.18.1 (2013-04-12 18:22:04 PHT) built-in shell (ash)
Enter ‘help’ for a list of built-in commands.

/bin/sh: can’t access tty; job control turned off

If you run the command “reboot” the router would reboot.

Reboot the router remotely

So far we gained access to the router and we saw we can reboot it, but we want to do this remotely. For this we’ll create a script on the Raspberry Pi that will log in to the router and execute the reboot command.

On the linux box create a file named “reboot_n900” that will have this content:


set timeout 10
set ip
set port 23
set username Alphanetworks
set password wrgnd15_wd_pro
spawn telnet $ip $port
expect “login:” {
send “$username\r”
expect “Password:”
send “$password\r”
expect “#”
send “reboot\r”

Make sure the file is executable: chmod +x reboot_n900 .

We will be using a script called “expect” and you will need to install this dependency:

sudo apt-get  install expect

The script needs to be run as is (do not run with sh since it’s not a shell script!):

xbian@xbian ~ $ ./reboot_n900

Now all that’s left is to schedule the script to run every night at 4am. We can add this to the cron (crontab -e).

0 4 * * * /home/xbian/reboot_n900

Let me know if this worked for you or if you need more details.

(in case you want to switch to a root account run: login orion orion)
(more info about wd n900: https://wiki.openwrt.org/toh/wd/n900)

Leave a Reply

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