Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Linksys Router with dd-wrt installed on. Due to some problems, I would like to periodically reboot the router (let's say at 0:00 everyday). How would I do that?

share|improve this question

migrated from serverfault.com Oct 19 '11 at 21:52

This question came from our site for system and network administrators.

    
What version of dd-wrt do you have? Make sure you have the latest version. – Wesley Feb 2 '10 at 4:12

dd-wrt has a scheduled reboot feature built into the firmware. Have a look at Administration >> Keep Alive >> Scheduled Reboot. Make sure cron is turned on at Administration >> Management >> Cron.

share|improve this answer

[if scheduled reboot does not work]

If you have enabled ssh-server on (I don't use dd-wrt, not sure if its enabled by default), you can reboot using following command

ssh root@192.168.1.1 reboot

You can look at this page to configure SSH public-private keys, so that you don't have to login everytime. And remember you should be running ssh-agent/putty-agent whereever your login from.

http://www.dd-wrt.com/wiki/index.php/Telnet/SSH_and_the_Command_Line#SSH

On Linux use cron to schedule reboot, and windows use Windows-Scheduler to execute command using putty.

share|improve this answer
    
A lot of the smaller DD-WRT builds don't support SSH--only telnet, but it's the same basic principle. – amphetamachine Feb 22 '11 at 1:45

I have a Linksys WRT-54GL running DD-WRT and have the same requirement. I've found that the scheduled reboot doesn't work so put a timer on the power outlet. Get a digital one so you can set the downtime to be 1 minute at midnight and you have a scheduled reboot.

share|improve this answer
    
Huh? Which timers have settings where you can turn something off then on quickly? This is a modem we're talking about: he wants it turned on immediately after it is turned off. – Paul Hoffman Feb 2 '10 at 3:27
    
Digital timers, like you use the schedule lamps going on and off in your house to make it look like you're at home generally can be set to a resolution of a minute or two. A reboot cycle takes about a minute from power off to serving internet again anyway so a 2 min disruption at 3am isn't going to be too much trouble. I've heard of UPSs that have a similar feature. – Dan Feb 2 '10 at 3:36
    
I saw chatter on the web about scheduled reboot not working, but the entry for that bug in dd-wrt's Trac site was closed as having been fixed. Do you have the latest version? – Wesley Feb 2 '10 at 4:12

You will have to create a cronjob for this.

Log on with ssh or telnet

Create a crontab by running:

# nvram set cron_jobs="00 00 * * * root reboot"

Commit the changes so they're still there after the first boot:

# nvram commit
share|improve this answer
    
In addition to Alex Toombs' answer, you can also add cron job in your router's web administration: Administration - Management tab - Additional Cron Jobs field: insert 00 00 * * * root reboot (or in my case 0 3 * * 4 root reboot so it reboots every Thursday 3:00 am). – LuH Jun 13 '15 at 14:32

There are low tech solutions also. You can use a light timer such as this. They also make digital ones that are more customizable.

FYI - taken from my answer to http://www.radioshack.com/product/index.jsp?productId=4405611&clickid=prod_cs

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .