TechTalkz.com Logo Ask the Experts!

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Telecom > Broadband

Telnet to reboot router

Broadband

 
 
Thread Tools Display Modes
Unread 26-11-2007, 08:46 AM   #1
Graham J
Guest
 
Posts: n/a
Telnet to reboot router

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







 
Unread 26-11-2007, 08:46 AM   #2
Dennis Ferguson
Guest
 
Posts: n/a
Re: Telnet to reboot router

On 2007-11-03, Graham J <graham@nospam.zen.co.uk> 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
 
Unread 26-11-2007, 08:46 AM   #3
Graham J
Guest
 
Posts: n/a
Re: Telnet to reboot router


"Dennis Ferguson" <dcferguson@pacbell.net> wrote in message
news:slrnfiq4bj.cb.dcferguson@akit-ferguson.com...
> On 2007-11-03, Graham J <graham@nospam.zen.co.uk> 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


 
Unread 26-11-2007, 08:46 AM   #4
kráftéé
Guest
 
Posts: n/a
Re: Telnet to reboot router

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?


 
Unread 26-11-2007, 08:46 AM   #5
Jon
Guest
 
Posts: n/a
Re: Telnet to reboot router

graham@nospam.zen.co.uk 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
 
Unread 26-11-2007, 08:46 AM   #6
Graham J
Guest
 
Posts: n/a
Re: Telnet to reboot router


"kráftéé" <kraftee@b&e-cottee.me.uk> wrote in message
news:kq2dnSSkwYfpA7DanZ2dnUVZ8qKvnZ2d@bt.com...
> 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







 
Unread 26-11-2007, 08:46 AM   #7
alexd
Guest
 
Posts: n/a
Re: Telnet to reboot router

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) (UnSoEsNpEaTm@ale.cx)
11:50:56 up 2 days, 4:35, 2 users, load average: 0.23, 0.15, 0.10
50,000 watts of funking power

 
Unread 26-11-2007, 08:46 AM   #8
Graham Murray
Guest
 
Posts: n/a
Re: Telnet to reboot router

Jon <spam@jonparker.plus.com> 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.
 
 

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT. The time now is 12:23 AM.


vBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2013, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional