| Software Secret Weapons™ |
Linksys Router Reanimator Or Smoke And Mirrors Of Enterprise Reliability posted by Pavel Simakov on 2007-05-07 16:14:56 under Smoke & Mirrors
|
|||||
|
However, the "Keep Alive" doesn't quite work if the Internet provider (the phone company in my case) has a temporary outage. During the outage router tries to reconnect couple of times and gives up. So when the phone company finally restores the connectivity, the router doesn't reconnect. And poor me, I can't connect to my home computer to get the files out of it.
The solution To fully automate and improve the reconnect process I wrote a small program in Java. This program runs on one of the computers on local network. It periodically logs into the router via web admin interface, as a human would, and checks the router connection status. If router is "disconnected" the program "clicks" connect button. The whole cycle repeats every couple of minutes.
After a quick inspection of the HTML source for the router status page
http://192.168.1.1/Status_Router.asp
http://192.168.1.1/apply.cgi
?change_action=gozila_cgi
&submit_button=Status_Router
&wan_proto=pppoe
&submit_type=Connect_pppoe
http://192.168.1.1/apply.cgi
?change_action=gozila_cgi
&submit_button=Status_Router
&wan_proto=pppoe
&submit_type=Disconnect_pppoe
The Java source for LinksysRouterReanimator class is here. This is how it works:
Use the following command line to run LinksysRouterReanimator (just provide the user name and password):
java -Dhost="192.168.1.1" -Dname="bob" -Dpass="bob123" -Dperiod="300" LinksysRouterReanimator.class
When it runs it produces the following output:
?+?+?+?+?+?-S?+?+?+?+?x?x?x?+?+?+?+?+?+?+
The ? indicates that status was checked, + indicates that router was in the connected state, - indicates that router was in the disconnected stats, S indicates that "connect" command was sent to the router, and x indicates that router state was unknown (aka. Connecting...). Finally, I can safely go to my friends and watch a movie streamed right from my home computer over the Internet. Any intermittent outage is immediately restored by my own LinksysRouterReanimator. God bless I know Java… Otherwise I had to hire a full time system administrator to push the reset button on the router.
Comments (3) Leave a comment |
|
|||||
| Copyright © 2004-2007 by Pavel Simakov |
|
Comment by chris — August 29, 2007 @ 10:53 am
Does it matter that ‘gozilla’ is spelt wrongly in the command?
- Chris
Comment by Pavel Simakov — August 29, 2007 @ 11:23 am
The action name “gozila_cgi” is expected by the router and must not be changed. I have no idea why it’s spelled this way. Maybe it’s a result of outsourcing the software development to some country in Asia…
- Pavel Simakov
Comment by ycc — January 30, 2008 @ 8:39 am
Thanks a million. I have the same router and the same problem. I put your GET-requests in curl-argument and will not have to get up in the night to check router status any more :)