Networking Forums

Networking Forums > Computer Networking > Broadband > Telnet to reboot router

Reply
Thread Tools Display Modes

Telnet to reboot router

 
 
Graham J
Guest
Posts: n/a

 
      11-03-2007, 10:13 PM
Suppose I have a server running 24/7 and I want to reset its internet
connection when the connection is detected as having failed. Is there any
way to use Telnet to reboot a Vigor router, using a single command line or
some scripting method?

I can see that:
Telnet <router IP>
Respond to password prompt with correct password
Send command : "sys reboot"
.... is the general idea

Any ideas gratefully received.

--
Graham J







 
Reply With Quote
 
 
 
 
Dennis Ferguson
Guest
Posts: n/a

 
      11-03-2007, 11:25 PM
On 2007-11-03, Graham J <(E-Mail Removed)> wrote:
> Suppose I have a server running 24/7 and I want to reset its internet
> connection when the connection is detected as having failed. Is there any
> way to use Telnet to reboot a Vigor router, using a single command line or
> some scripting method?
>
> I can see that:
> Telnet <router IP>
> Respond to password prompt with correct password
> Send command : "sys reboot"
> ... is the general idea
>
> Any ideas gratefully received.


expect works well for that. Or it does on Unix, at least, I don't
know about the windows version.

http://expect.nist.gov/

Dennis Ferguson
 
Reply With Quote
 
Graham J
Guest
Posts: n/a

 
      11-04-2007, 09:19 AM

"Dennis Ferguson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On 2007-11-03, Graham J <(E-Mail Removed)> wrote:
>> Suppose I have a server running 24/7 and I want to reset its internet
>> connection when the connection is detected as having failed. Is there
>> any
>> way to use Telnet to reboot a Vigor router, using a single command line
>> or
>> some scripting method?
>>
>> I can see that:
>> Telnet <router IP>
>> Respond to password prompt with correct password
>> Send command : "sys reboot"
>> ... is the general idea
>>
>> Any ideas gratefully received.

>
> expect works well for that. Or it does on Unix, at least, I don't
> know about the windows version.
>
> http://expect.nist.gov/



Thanks Dennis - I will give it a try ...

--
Graham J


 
Reply With Quote
 
kráftéé
Guest
Posts: n/a

 
      11-04-2007, 09:26 AM
Graham J wrote:
> Suppose I have a server running 24/7 and I want to reset its
> internet connection when the connection is detected as having
> failed. Is there any way to use Telnet to reboot a Vigor router,
> using a single command line or some scripting method?
>
> I can see that:
> Telnet <router IP>
> Respond to password prompt with correct password
> Send command : "sys reboot"
> ... is the general idea
>
> Any ideas gratefully received.


Confused (it's not to diffivcault at the moment).

If the router has lost connection how are you going to telent into it
remotely?

If you want to do it locally then why telnet in when you can access
the router drectly vis IP?


 
Reply With Quote
 
Jon
Guest
Posts: n/a

 
      11-04-2007, 09:29 AM
(E-Mail Removed) declared for all the world to hear...
> Suppose I have a server running 24/7 and I want to reset its internet
> connection when the connection is detected as having failed. Is there any
> way to use Telnet to reboot a Vigor router, using a single command line or
> some scripting method?
>
> I can see that:
> Telnet <router IP>
> Respond to password prompt with correct password
> Send command : "sys reboot"
> ... is the general idea
>
> Any ideas gratefully received.


There is a list of telnet commands on the draytek support site, and
rebooting is one of the supported commands, so it's pretty much as you
described.
--
Regards
Jon
 
Reply With Quote
 
Graham J
Guest
Posts: n/a

 
      11-04-2007, 10:10 AM

"kráftéé" <kraftee@b&e-cottee.me.uk> wrote in message
news:(E-Mail Removed)...
> Graham J wrote:
>> Suppose I have a server running 24/7 and I want to reset its
>> internet connection when the connection is detected as having
>> failed. Is there any way to use Telnet to reboot a Vigor router,
>> using a single command line or some scripting method?
>>
>> I can see that:
>> Telnet <router IP>
>> Respond to password prompt with correct password
>> Send command : "sys reboot"
>> ... is the general idea
>>
>> Any ideas gratefully received.

>
> Confused (it's not to diffivcault at the moment).
>
> If the router has lost connection how are you going to telent into it
> remotely?
>
> If you want to do it locally then why telnet in when you can access the
> router drectly vis IP?


We can all be confused sometimes!

The server runs 24/7.

The router may lose its internet connection, which indeed will prevent me
gaining access to the server. But the server can correct this for itself
provided that it can interact with the router.

I could run a script (i.e. a batch file) on the server, which pings eternal
IP addresses at regular intervals. If these pings fail, the script should
reboot the router. Scripts are composed of command lines.

I use Alive from http://www.softlookup.com/author.asp?id=4222 which pings an
IP address and returns a result code. So the script would look like:

alive <external IP address>
if not errorlevel 1 goto ping-good
echo There was no reply, so reboot the router!
telnet <router> <username> <password> <send command "sys reboot">
goto end
ing-good
echo Reply OK, do nothing more.
:end
exit

The problem with this is that the telnet command doesn't work the way I have
indicated. Dennis Ferguson has suggested http://expect.nist.gov/ for
a program that allows programs such as telnet to work with a script that
sends commands and looks for specific responses.

--
Graham J







 
Reply With Quote
 
alexd
Guest
Posts: n/a

 
      11-04-2007, 10:53 AM
Graham J wrote:

> The problem with this is that the telnet command doesn't work the way I
> have
> indicated. Dennis Ferguson has suggested http://expect.nist.gov/
> for a program that allows programs such as telnet to work with a script
> that sends commands and looks for specific responses.


Yep, works fine with my BeBox - I use it to gather line stats.

http://ale.cx/alex/beboxstats

--
<http://ale.cx/> (AIM:troffasky) ((E-Mail Removed))
11:50:56 up 2 days, 4:35, 2 users, load average: 0.23, 0.15, 0.10
50,000 watts of funking power

 
Reply With Quote
 
Graham Murray
Guest
Posts: n/a

 
      11-04-2007, 10:54 AM
Jon <(E-Mail Removed)> writes:

> There is a list of telnet commands on the draytek support site, and
> rebooting is one of the supported commands, so it's pretty much as you
> described.


Though it should be noted that (unless it has been updated recently)
this list is incomplete.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enable root access to telnet with krb5-telnet Phoe6 Linux Networking 2 06-08-2007 11:00 AM
Wireless router reboot frequency tom_sawyer70@yahoo.com Wireless Internet 8 06-02-2006 08:04 PM
Need to reboot the wireless router ? dingdongdingding@yahoo.com Wireless Internet 1 07-25-2005 08:24 PM
Must reboot modem and router to log on. Why? Hank G. Wireless Internet 2 06-15-2004 04:12 PM
Lose connection w/ USR8054 router after 24hrs (must reboot router) r. t. Wireless Internet 8 02-08-2004 10:42 PM



1 2 3 4 5 6 7 8 9 10 11