Every dog has a blog!
[ start | index | login or register ]
start > 2011-07-06 > 1

How to Reboot a Draytek Router from remote with a perl-script

Created by derjohn. Last edited by derjohn, one year and 316 days ago. Viewed 1,261 times. #1
[edit] [rdf]
labels
attachments

How to Reboot a Draytek Router from remote with a perl-script

Probably due a complex setup and a slightly buggy firmware the VPN of my Draytek Vigor Router 2950 stops working from time to time. The only way to make it run again is a reboot.

As a workaround I created a perl-script to reboot the boxen from remote and added the reboot to the crontab of my linux server in the secure zone (telnet, unencrypted!). Now that the Vigor is rebooted every night, the VPN lockups don't occur anymore.

#!/usr/bin/perl

use Net::Telnet;

$telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Host=>'**INSERTYOURHOSTIP**', Port=>'**INSERTPORTFORTELNET**', Prompt=>'/> $/'); $telnet->open(); $telnet->waitfor('/Password: $/i'); $telnet->print('**INSERTYOURPASSWORDHERE**'); print $telnet->cmd('sys reboot');

Of course you need Net::Telnet (from CPAN or your distribution).

no comments | post comment

< May 2013 >
SunMonTueWedThuFriSat
1234
567891011
12131415161718
19202122232425
262728293031


Logged in Users: (1)
… and 3 Guests.

Blogrolling:
>>Blog des Wahnsinns
>>Daniel Holbach's Blog
>>Matt Cutt's blog
>>Randgruppentourismus

XHTML 1.0 validated
CSS validated
RSS 2.0 validated
RSS Feed

Hinweise zur Formatierung
snipsnap-help.

Powered by
SnipSnap 1.0b1-snipit

Ads will be placed here!

dem john sein blog | Impressum: Andreas John, Frankfurter Str. 98a, 63067 Offenbach, E-Mail: himself@derjohn.de