4

I have the need to be able to cycle my linksys router via a program, the reason I want to do this is complex, so let's just assume there is no better option.

Is there anyway to do this? I think there is because when I install a firmware update to the router via the admin console, it cycles the router.

Blorgbeard
  • 101,031
  • 48
  • 228
  • 272
shsteimer
  • 28,436
  • 30
  • 79
  • 95

4 Answers4

5

If you can find the function to do that on the router's web interface, you can achieve the same via a suitable HTTP request. Also, you can often telnet to the router and reboot it through its command-line interface. Programmatically you can achieve the same, by using a tool like expect.

Diomidis Spinellis
  • 18,734
  • 5
  • 61
  • 83
1

If you have access to the local web interface of the router you might be able to access the "reset" function of the router. You can try to call this via a http request, e.g. via wget. But this depends very much on the router. Some routers also support SNMP or a telnet interface.

Another possibility is to plug the router into an ethernet-connected power strip which can be remotely controlled. These power strips usually have a simple http server build in, so you can individually switch on and off the devices that are connected.

Andreas Kraft
  • 3,754
  • 1
  • 30
  • 39
1

If it's a Linksys WRT54G, I highly recommend DD-WRT. It's an open source firmware replacement, and it has this feature built in for timed restarts. A programmatic restart with an HTTP request should be quite easy as well, as the restart function is available through the admin GUI.

Nerdfest
  • 1,675
  • 13
  • 20
0

https://github.com/danielrussellLA/restart-linksys-EA2700-router you can try using a nightwatch bot similar to this one to programatically restart your router through its browser ui. This works well if your router does not have a command line interface that you can access (through telnet, ssh etc). It's pretty hacky, but it gets the job done.

drussell
  • 509
  • 4
  • 5