Re: Telnet to reboot router




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







.



Relevant Pages

  • Re: Reset a Cisco 1711 VPN
    ... VPN tunnel through a Cisco 1711 router. ... When the ping fails x ... The network people here have given me the command to issue if I ... were to telnet the router. ...
    (microsoft.public.vb.general.discussion)
  • Re: Reset a Cisco 1711 VPN
    ... VPN tunnel through a Cisco 1711 router. ... The network people here have given me the command to issue if I ... were to telnet the router. ... Winsock control that Lance Wynn suggested. ...
    (microsoft.public.vb.general.discussion)
  • Re: telnet from spawned telnet process
    ... like any other command like showing subscribers or the router time. ... so you're at the router's commandline and asking it to start a telnet process. ... Yes, I was spawning the telnet, connecting to the router and then ...
    (comp.lang.tcl)
  • Re: Telnet to reboot router
    ... connection when the connection is detected as having failed. ... Telnet ... Send command: "sys reboot" ...
    (uk.telecom.broadband)
  • Re: [Slightly OT] Who to ping?
    ... connection to my router and issue a 'reboot' command. ...
    (uk.comp.sys.mac)