Internet Auto Dialer: PPPoE Dialer


I need to configure a autodialer for windows 2008 server. Although the PPPoE dialer within windows have “dial on line drop” but for some unknown reason that function wasn’t working for my cause. Also, if a User through which I start/dial connect gets logout the connection gets disconnect.

Someone suggest to use 3rd party dialer, but I am not very keep to install anything “else” on server and I believe that there should exists some method to do it within available windows resources. But when I read article on “10 default things windows should adopt from Linux” where I read about crone feature I got an idea, that why not schedule the RASPHONE through scheduler ? So here is what I do:
I create a batch script that simply ping google.com, if ping is unsuccessful it call rasphone with “-d” switch and dial the connection. now I schedule it to run every 5 minutes after ssytem startup for indefinate time. Simple 2 line batch script and work is done.

Edit (code of Batch file):

@echo off
ping -n 2 -l 1 google.com
if %errorlevel%==1 rasphone -d "MyDialupConnectionName"

Edit: 01-10-2011

I change the file to use RASDIAL command instead of rasphone, as when my Internet line has disturbance or my ISP is not available then my schedule keep adding rasphone.exe in Active task like which consume 2.5MB per instance and since I schedule it to run every 10 minutes, it keep consume 2.5MB every 10 minutes and finally my server was doomed when my ISP went down for 2 days during weekend. So new file is

 

@echo off
ping -n 2 -l 1 google.com
if %errorlevel%==1 rasdial "MyDialupConnectionName" Username Password

3 responses to “Internet Auto Dialer: PPPoE Dialer”

  1. hi could you please post the lines you used in the batch files so i can create onefor myself please

  2. Batch File code is included in post now. However I want to tell that this method though works great for me for more than a year now, but I see that if Network is down at ISP, it start piling up rasphone’s instance in my Task Manager, and that I have to manually kill or reboot the PC to get rid of them. So when a network failure is there make sure to stop your task schedular to not run during that time.