Syed Jahanzaib Personal Blog to Share Knowledge !

September 1, 2011

Howto create PPPoE Dialer Installer Package using Auto-iT !


~!~ Article by Syed Jahanzaib ~!~

UPDATED: March, 2017

https://aacable.wordpress.com/2017/03/20/c-pppoe-dialer-program-code/

OLD METHOD of autoit, may not work proeprly so use above mentioned link.

From past few months, I was searching for a method to create a pppoe dialer package installer which can automatically create a new pppoe connection for user,  but I was unable to find any simple method all over the internet. Like the one we can create VPN Dialer Installer Package using Windows 2003 utility called CMAK (Connection management administration kit to

I am basically a Networking type guy who is heavily involved in Microsoft / Linux + Mikrotik Environment and I have no background experience in any programming language , that’s why I asked many people for assistance , but none of any knew about it, and those who knew, didn’t wanted to share the code with general public.

So Finally I decided to do it in my old fashioned style using MS-DOS concepts and logic’s. Today after doing some goggling and thinking about possible solutions in my head, I was able to found a way on how-to do it with the help of a Application name ‘AUTO-IT ‘

Following is a guide on howto to do it in very simple few steps (xp/2000/2003 supported Only at a moment). Being a Linux Lover, I am publishing these codes under GPL (General Public License). You can modify it as per your requirements, redistribute it. Don’t forget to give credit if it helps you :~)

Remember it’s not a standard, neat and clean way but It’s very simple and it does the job nicely:)
[This script was made for Windows 2003/xp Only, I will post Windows Vista/Windows 7 script soon]

Here we go . . .

First of all you have to download ‘Auto-it‘ software from its website at

http://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe

I used Latest version: v3.3.6.1, Do full installation of AutoiT.

After installation, launch it by  Goto Start / Programs / Autoit v3  and select SciTE Script Editor

Now an advance Notepad type windows will open, Just paste the following code in it.

(Note: FOR SOME REASONS, Sometimes CODE Does not displayed PROPERLY IN THIS BLOG, IF you face syntax errors,  you can copy the raw code from following location) http://pastebin.com/jSu5mHmg

#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.6.1
 Author:         SYED JAHANZAIB
 Email:          aacable@hotmail.com
 Web:            https://aacable.wordpress.com
 OS Supported:   Windows XP
 Script Function:
 Template AutoIt script. for PPPoE Dialer Installer
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
#NoTrayIcon
 #compiler_icon=itlifesaver.ico
 #include <GUIConstants.au3>
$COMPANY_NAME = "AACABLE - DIALER SERVICE" ; name of the pppoe icon, friendly description
 $SERVICE_NAME = "aa" ; name of the pppoe service configured in NAS/Mikrotik
$DELAY = 200
 ; change this DELAY value to speedup or slow down the process,
 ;any range between 200-300 is better in my view, too fast will shatter things
;This is for showing your logo for 2 secs
 ;$destination = "C:\Program Files\AutoIt3\Examples\GUI\mslogo.jpg"
 ;SplashImageOn("Splash Screen", $destination,250,50)
 ;Sleep(2000)
 ;SplashOff()
$answer = MsgBox(4, "PPPOE Connection", "This script will create a PPPOE DIALER connection to " & $COMPANY_NAME & ", Ready?")
 If $answer = 7 Then
 Exit
 EndIf
; Prompt user for PPPOE login info
 $frmInformation = GUICreate("Enter Information", 287, 194, 193, 115)
 $lblUserName = GUICtrlCreateLabel("User Name:", 16, 40, 60, 17)
 $lblPassword = GUICtrlCreateLabel("Password:", 16, 80, 53, 17)
 $txtUserName = GUICtrlCreateInput("", 112, 40, 153, 21)
 Dim $ES_PASSWORD,$ES_AUTOHSCROLL
 $txtPassword = GUICtrlCreateInput("", 112, 80, 153, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
 $lblPassword2 = GUICtrlCreateLabel("Confirm Password:", 16, 120, 91, 17)
 $txtPassword2 = GUICtrlCreateInput("", 112, 120, 153, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
 $btnOK = GUICtrlCreateButton("&OK", 200, 160, 75, 25, 0)
 $lblInfo = GUICtrlCreateLabel("Enter your pppoe Login Information Below!", 48, 8, 196, 17)
 GUISetState(@SW_SHOW)
While 1
 $nMsg = GUIGetMsg()
 Switch $nMsg
 Case $btnOK
 If GUICtrlRead($txtPassword) <> GUICtrlRead($txtPassword2) Then
 MsgBox (16, "Error", "Passwords do not match! Try again.")
 Else
 $Username = GUICtrlRead($txtUsername)
 $Password = GUICtrlRead($txtPassword)
 ExitLoop
 EndIf
 Case $GUI_EVENT_CLOSE
 Exit
EndSwitch
 WEnd
 GUISetState(@SW_HIDE)
; Run Network Setup
 Run("control ncpa.cpl")
 WinWaitActive("Network Connections")
; Check if PPPOE dialer by same name already exists, since it'll break script later if Windows add's a number at the end of the name...
 $ControlID = ControlListView("Network Connections", "", "SysListView321", "FindItem", $COMPANY_NAME, "AACABLE - DIALER SERVICE")
 If $ControlID <> -1 Then
 $answer = MsgBox(4404, "Error", "Connection to " & $COMPANY_NAME & " already exists! Remove it and recreate it?")
 If $answer = 6 Then
 ControlListView("Network Connections", "", "SysListView321", "Select", $ControlID)
 Send("{DEL}")
 WinWaitActive("Confirm Connection Delete")
 Send("!y")
 Sleep($DELAY)
 Else
 MsgBox(16, "Exit", "Script stopped by user")
 Exit
 EndIf
 EndIf
; open new connection wizard from file menu
 Send("!f")
 Send("n")
 Sleep($DELAY)
; New Connection Wizard
 Sleep($DELAY)
 Send("!n")
 Sleep($DELAY)
; Choose Conncetion type
 Sleep($DELAY)
 Send("!n")
 Sleep($DELAY)
; setup connectoin manuall
 Send("!m")
 Sleep($DELAY)
 Send("!n")
 Sleep($DELAY)
; Connect using broadband connection with user name n passwd
 Send("!u")
 Sleep($DELAY)
 Send("!n")
 Sleep($DELAY)
; Send Your ISP Name
 Send($COMPANY_NAME)
 Send("!n")
 Sleep($DELAY)
;Donot send id password here, we will set it in End
 Send("!n")
 Sleep($DELAY)
; Wizard Complete, do we want a desktop shortcut?
 Send("!s")
 Sleep($DELAY)
 Send("{ENTER}")
WinWaitClose("New Connection Wizard")
WinWaitActive("Connect " & $COMPANY_NAME)
Send($Username)
 Send("{TAB}")
 Send($Password)
Sleep($DELAY)
Send("!s") ; save password...
Send("!a") ; for anyone who uses this computer, use "!n" for 'Me only'
Sleep($DELAY)
WinClose("Network Connections")
MsgBox(0, "Setup Complete", "Your Dialer have been installed , Click Connect to initiate dialing . . .")

Now Open File / Save and name it ‘aa-dialer-installer’

Now your script with source code is ready to be compiled in .EXE executable format so any user can install it like any other normal application.

Now Open Tools and click on ‘Compile’ and it will compile the script in .exe format and it will save it to the Desktop or whatever Path You have selected.

Now click on ‘aa-dialer-install.exe’ and it will install the pppoe dialer and place its shortcut on Desktop.

Any suggestions on improvements and enhancements / advancements are most welcome  and will be appreciable 🙂
Regrd’s
Syed Jahanzaib

July 5, 2011

A Success story with Mikrotik and DMASoftlab RADIUS MANAGER [Glass Line Pvt Ltd.] June, 2011


Article by Syed Jahanzaib !

Recently I was contacted by a friend who was really passionate in starting a mini-ISP type network setup for about 3000 users in the interior area of city. (soon it may expand up to 5000+ users). He asked my help to setup a scratch card base fully automatic system where user purchase scratch card, & using User self care portal web site, user may create his new ID or refresh his previous ID or change the service package according to the card package offers. I had previously setup this kind of scenario in a cable.net environment using Mikrotik built-in radius server called ‘User Manager’, but it have very limited basic features and all it can offer was a pre-paid type option and it doesn’t have many accounting features. So I thought I should give a try to more rich feature radius server and after a lot of googling i decided to go with  (FREERADIUS base ) DMASOFTLAB RADIUS MANAGER. A very famous radius server with all the option that a mini-ISP would required at unbelievably low price.

The hardware that I have used for this setup.

*Main Mikrotik = v4.17 x86 / Xeon 3.6Ghz Dual / 2 GB Ram / WD 500 GB Sata Hdd , This MT is serving as a PPPoE Server + NAT + bandwidth shaping. It also redirects HTTP traffic to Proxy server.

* Mikrotik RB750 = Just for HOTSPOT to redirect users to self care portal.
(This can be done on Main MT also, but I prefer it this way)

* Radius Server = DMASoftlab RM v3.9 installed on Fedora v10 / Xeon 3.6Ghz Dual / 4 GB Ram / WD 500 GB x2 Sata Hdd

* SQUID PROXY GW = SQUID v2.7 on UBUNTU Karmic Koala v9.10 / Xeon 3.6Ghz Dual / 8 GB Ram / WD 500 GB x3 SATA HDD (2 HDD reserved for Cache), This server acts as a proxy + Gateway machine for the Mikrotik, It also do URL Filtering blocking ads, it also have ZPH enabled so content available in squid cache should be downloaded at full speed (without package limitation) at user end. It also cache youtube videos using VIDEOCACHE.

* Linux Transparent BRIDGE firewall + DHCP + DNS + MRTG + WEB Server on FEDORA V10 / Xeon 3.6Ghz Dual / 4 GB Ram / WD 500 GB SATA HDD, This server sits between Mikrotik and Users , filtering unwanted traffic, ports and do some other stuff like lightweight DNSMASQ DNS Server,  DHCP server providing ips to users , Web Site with MRTG , Psychostats ranking system for Counter Strike Game, Server Monitoring Scripts and Alerts, PHPBB Forums for Users, and some other cool stuff. DNS+DHCP is hosted on this server to minimize load on main mikrotik machine, alos this machine filters unwanted traffic from passing by to main mikrotik.

In this setup , I have configured HOTSPOT on extra RB750 only to redirect user to my advertisement page, where he is informed that he is not logged in via dialer, either create / refresh his ID from RM User Self Care Portal, or if he already have an id, connect it via dialer. I don’t prefer HotSpot authentication due to various security reasons, mainly due to I had a very bad experience having HOTSPOT hit by ARP-POISONING and many virus flooder that requires default gateway.

When user first login , his PC MAC address is binded with his ID to prevent accessing it from different pcs. Multiple session of same ID is NOT allowed , I provide user with scratch card (with refill code) , which he can use to refill his account according to card amount/package from RM User self care portal. RM demo can be viewed at http://www.dmasoftlab.com/cont/radman

When users with pppoe dialer tries to connect to main Mikrotik, MT verifies its credentials by asking Radius Server for the account validity, if the ID is valid, user connects okay and can use internet , otherwise he gets disconnected. When the User account is expired, he still can login via dialer, but then he is redirect to my local web server page where he is informed that his account is expired and he should visit billing.local page to renew his account using the card.

Please find along with attachment is my Network Diagram (This was initially designed, I made few changes afterward, I removed FTP from MT DMZ to user subnet lan to avoid load on MT , I moved ftp OS from windows to Linux and integrate it with radius authentication using APACHE.

Some other entertainment services that I setup here were:
2 FTP Media Sharing Servers ( 4 TB of data )
2 Live TV Channel streaming over LAN using VLC Media Player Broadcasting
1 Counter Strike 1.6 Dedicated Server with Psychostats Ranking System and adminmod/amxmod
1 Web Server (Ubunut) hosting site u-dear . com , an entertainment portal and hosting other features. It also features monitoring system with MRTG / SMS Alerts via attached Mobile.

About RM: Radius Manager uses a nice web interface for administering the users and the whole system (traffic accounting, tracking of online users, display statistics, maintenance ,account management etc.).

and to add that DMASoftlab customer support guys (specially Mr. Viktor.K) have excellent support and respond instantly even to the dumbest of questions. It is real value for money especially for those who do not have big wallet$.

Network Diagram Layout : (Complete setup guide can found at
https://aacable.wordpress.com/2011/07/19/mikrotik-squid-zph-complete-guide-incomplete-post-i-will-edit-it-later/

GLASSLINE-Network-Presentation-by-zaib Update 03/08/2001

%d bloggers like this: