Solved

Reboot a router  through a script, batch or exe

Posted on 2008-10-11
3
9,574 Views
Last Modified: 2012-06-21
I have a router Huawei EchoLife HG520s, and I need a script, exe or batch file to reboot it automatically, in order to use it with other program to get a new ip automatically each 45 minutes.

Using Telnet I do the following to reboot:

C:\> Telnet 192.168.1.1
Password: *********
HG520s> set reboot


If is possible to get code this in a very simple exe or batch would be perfect, or any other solution is also appreciated.

Thanks
0
Comment
Question by:dscholtes
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
James Murrell earned 500 total points
ID: 22694833
Ok here's the script and method to reboot it.

1) Scheduling:
For scheduling the reboot, download TST10 from winsite.com downloads. It is a tiny freeware Telnet utility with support for scripting. Extract the utility to a folder on your hard drive. e.g. C:\TST. In this folder, create a new text file. This is the file in which we will write the script for TST10, so name it anything you like e.g. reboot.txt. Edit this file in notepad and paste the following. Remember to include the quotes as well and exclude the line which says script.

2) Script :

192.168.1.23
WAIT "Login"
SEND "admin\m" (enter your login ID here)
WAIT "Password"
SEND "admin\m" (enter your password here)
WAIT "->"
SEND "12\m"
WAIT "==>"
SEND "1\m"
WAIT "The system shell is being reset. Please wait..."

192.168.1.1 is the address you use to access the router configuration. 23 is the port to which telnet connects. Replace "login_id" and "password" with the login and password respectively, that you use to access the router configuration page from a browser. Remember, keep the \m after the id and pass.

Now simply create a scheduled task using the inbuilt Windows task scheduler.

Important: Create a task to run tst10.exe with the command line parameter /r:reboot.txt.



taken from http://broadbandforum.in/airtel-broadband/13107-fastest-way-reboot-router/2/
0
 

Author Comment

by:dscholtes
ID: 22709396
Thank you very much cs97jjm3,

It worked after i made some simple changes in the script according to my router,  reading the article in the website of your source.

my script is:

192.168.1.1 23
WAIT "Password"
SEND "notan37facil\m"
WAIT "HG520s>"
SEND "set reboot\m"
WAIT "The system shell is being reset. Please wait..."


0
 

Author Closing Comment

by:dscholtes
ID: 31505281
thank you for your help.
muchas gracias.

sorry if i wrote bad english.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

There are two basic ways to configure a static route for Cisco IOS devices. I've written this article to highlight a case study comparing the configuration of a static route using the next-hop IP and the configuration of a static route using an outg…
I recently attended Cisco Live! in Las Vegas, a conference that boasted over 28,000 techies in attendance, and a week of hands-on learning hosted by a solid partner with which Concerto goes to market.  Every year, Cisco displays cutting-edge technol…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now