RasDial Pro User's Manual

Version 1.4

May 5, 2004

µ-Consulting www.muconsulting.com

Contents

  1. Introduction

  2. Installation

  3. Usage

  4. Usage Examples

  5. TCP/IP Route Addition Support (Split Tunneling)

  6. Common Errors

  7. Batch File Integration

  8. How To Register

  9. Revision History

  10. Distribution

  11. Licensing

  12. Pricing

  13. How To Contact µ-Consulting


Introduction

RasDial Pro is a command-line remote access (dial-up networking) dialer for Windows 95 and above. It's based on the RasDial command on Windows NT and the usage is very similar. RasDial Pro will allow you to dial and hangup a remote access phone entry.  In addition, it supports redialing when a line is busy.  New in this version is support for TCP/IP route additions that are necessary to establish proper connectivity to the Internet and private corporate networks simultaneously.


Installation

RasDial Pro is typically used from a custom batch file (.BAT or .CMD) or another application.  Because of this, there is no install program for RasDial Pro.  Installation will usually just consist of copying RDialPro.exe to a directory referenced by the batch file or other application.  For convenience, RDialPro.exe may be copied to the Windows directory (usually C:\WINDOWS or C:\WINNT) or any other directory in the PATH so that it can be executed without the full directory path specified.


Usage

There are four modes of usage for RasDial Pro.

To Establish a Connection (Dial):

Command-line Syntax:

RDialPro entryname [username [password]] [/DOMAIN:domain] [/PHONE:phonenumber] [/CALLBACK:callbacknumber] [/RETRYCOUNT:n] [/RETRYDELAY:s] [/VERBOSE] [/ADDROUTE destination [MASK netmask] [METRIC metric]]... [/APIERROR]

Parameter Definitions:

entryname The entry name is the name of the icon that is in the dial-up networking folder.  Enclose the entry name in double quotes if it contains spaces.
username, password

The user name and password are optional.  If they are not specified on the command-line, then the user credentials saved with the dial-up networking icon will be used.  If you specify a user name and password, the specified user credentials will be used instead of the saved user credentials.  You may enclose the user name and/or password in double quotes if they contain spaces or other special characters.

/DOMAIN: domain If you are connecting to a Windows NT RAS server, you may use the /DOMAIN parameter to logon using an account on a domain that is different from the RAS server's domain.
/PHONE: phonenumber If the phone number is specified, it overrides the number stored in the dial-up connection icon.
/CALLBACK: callbacknumber If the callback number is specified, it overrides the callback number stored in the dial-up connection icon.  A callback will only be performed if the dial-up server is configured to perform it.
/RETRYCOUNT:n By default, RasDial Pro will attempt to dial only once.  If the connection can't be made, it will return an error.  However, if the /RETRYCOUNT:n parameter is specified, it will retry up to n times before returning with an error.
/RETRYDELAY:s When retrying, RasDial Pro will redial immediately after hanging up.  However, if the  /RETRYDELAY:s parameter is specified, it will pause for s seconds before redialing.
/ADDROUTE destination, netmask, metric If the TCP/IP settings in the dial-up networking icon is not set to use the default gateway on the remote network, then the /ADDROUTE parameter may need to be used.  This is particularly useful when you already have an active Internet connection and would like to use RAS to connect to another network such as a Virtual Private Network or a corporate remote access server.  See the Route Addition section for details on this parameter’s usage.
/VERBOSE The /VERBOSE parameter displays more detailed information when establishing RAS connections.
/APIERROR The /APIERROR parameter causes RasDial Pro to return the Win32 API error code if an error occurs.

 

To Disconnect (Hang up):

Command-line Syntax:

RDialPro [entryname] /DISCONNECT [/APIERROR]

Parameter Definitions:

entryname The entry name is the name of the icon that is in the dial-up networking folder.  Enclose the entry name in double quotes if it contains spaces.  If an entry name is not specified, the first connection will be disconnected.
/APIERROR The /APIERROR parameter causes RasDial Pro to return the Win32 API error code if an error occurs.

 

To List Connected Entries:

Command-line Syntax:

RDialPro [/APIERROR]

Parameter Definitions:

/APIERROR The /APIERROR parameter causes RasDial Pro to return the Win32 API error code if an error occurs.

 

To Query the Status of an Entry:

Command-line Syntax:

RDialPro [entryname] /QUERY [/APIERROR]

Parameter Definitions:

entryname The entry name is the name of the icon that is in the dial-up networking folder.  Enclose the entry name in double quotes if it contains spaces.  If an entry name is not specified, the first connection will be queried.
/APIERROR The /APIERROR parameter causes RasDial Pro to return the Win32 API error code if an error occurs.

Usage Examples

RDialPro myisp

Connect to “myisp” using the logon name and password saved with the “myisp” dial-up networking icon.

RDialPro “My ISP” AAA\john secret007

Connect to “My ISP” (icon name has an embedded space) using the logon name “AAA\john” and password “secret007”

RDialPro “My ISP” john “secret 007” /domain:AAA

Connect to “My ISP” using the logon name “john”, password “secret 007”, and Windows NT logon domain “AAA”.

RDialPro BusyISP /retrycount:10 /retrydelay:5

Connect to “BusyISP” but if the line is busy, then wait 5 seconds and retry again.  Retry connecting up to 10 times.

RDialPro “Long Distance ISP” /phone:9,18185551234,30

Connect to “Long Distance ISP” but instead of using the saved phone number, use the specified phone number (which includes a custom prefix and suffix).

RDialPro CorpVPN /addroute 192.168.1.0 mask 255.255.255.0

Connect to your corporate LAN whose internal IP address is 192.168.1.0 with a subnet mask of 255.255.255.0.

RDialPro CorpVPN /addroute 192.168.1.0 mask 255.255.255.0 /addroute 10.0.0.0 mask 255.0.0.0

Connect to your corporate LAN which has two IP address ranges, 192.168.1.0 with a subnet mask of 255.255.255.0, and 10.0.0.0 with a subnet mask of 255.0.0.0.

RDialPro CorpVPN /phone:vpnserver2.yourdomain.com /addroute 192.168.1.0 mask 255.255.255.0

Connect to your corporate LAN using an alternate VPN server named “vpnserver2.yourdomain.com”.


TCP/IP Route Addition Support (Split Tunneling)

TCP/IP route addition (also known as split tunneling) support is very useful when you have more than one TCP/IP network connection.  The most common example of this is when you want to establish a RAS connection (modem or Virtual Private Network) while you are connected to the Internet.  With TCP/IP route addition support enabled, RasDial Pro will update the operating system’s TCP/IP routing table so that traffic that is addressed to the RAS network is routed to the RAS server instead of the default gateway (usually the Internet).

Why does the TCP/IP routing table need to be updated?  The following two examples illustrate why.

Broken Example #1

Your workstation has a network card that connects to the Internet through a DSL or cable modem connection.  It also has a modem.  You want to use RDialPro to establish a RAS modem connection to your corporate LAN which uses the network 192.168.1.0 with a subnet mask of 255.255.255.0.  The CorpRAS Icon properties has the option “Use default gateway on remote network” unchecked.

You establish a RAS connection to CorpRAS by double-clicking on the CorpRAS Icon in Dial-Up Network or by using RDialPro without the /ADDROUTE parameter.  After connecting, the RAS server assigns the IP address 192.168.20.5 to the local RAS client.

Internet access works as before.  The problem is that you are unable to communicate with any host on the 192.168.1.0 corporate network.  Since the route table doesn’t have an explicit route to this network, any traffic sent to this network is routed to the default gateway which is through the network card instead of the modem in this case.  When the Internet dial-up server receives the traffic sent to the 192.168.1.0 network, it will usually drop it or improperly route it because such an address is not valid on the Internet.

Broken Example #2

Same scenario as Broken Example #1.  However, you check the “Use default gateway on remote network” option for the CorpRAS Icon properties.

You establish a RAS connection to CorpRAS by double-clicking on the CorpRAS Icon in Dial-Up Network or by using RDialPro without the /ADDROUTE parameter.  After connecting, the RAS server assigns the IP address 192.168.20.5 to the local RAS client.  Since the “Use default gateway on remote network” is checked, the operating system updates the routing table so that the default route is effectively 192.168.20.5 (the RAS interface). 

You are now able to communicate with hosts on the 192.168.1.0 corporate network.  However, when you try to access anything else on the Internet, you will find that it either doesn’t work at all, or your Internet access speed went from DSL speed down to modem speed.  The reason for this is just the opposite of the last example.  When you send traffic to the Internet, it gets sent to the default gateway which is through the modem instead of the network card in this case.  This means that your corporate RAS server is handling traffic to and from the corporate LAN as well as the Internet.  In other words, Internet traffic that used to go through your high speed network card and DSL modem now go through your modem to your corporate network and then through the corporate network’s Internet connection (if it has one).

The Solution

The solution to these two problems is to keep the default gateway as your Internet connection and then to add specific routes for traffic that should be sent to your RAS server. 

To specify these routes, you need to give RDialPro three parameters to the /ADDROUTE option. 

Destination IP address: This can be a host IP address or a network IP address of the host or network that can be accessed through the RAS server.  In the above examples, the destination IP address was the network address 192.168.1.0. 

Netmask (also called subnet mask):  This specifies the TCP/IP subnet mask that corresponds with the destination IP address.  If the network is a class C network, the subnet mask will be 255.255.255.0.  If the subnet mask is not specified, it will assume a subnet mask of 255.255.255.255 which means that only traffic sent to the destination host IP address will be routed through the RAS connection. 

Metric: This is only useful if you have more than one route to a particular network.  The metric parameter will then be used by the operating system to determine the best route to a particular destination.  The route with the lowest metric is chosen before another.  If the metric is not specified, it is assume to be one.

The /ADDROUTE parameter can be repeated as often as necessary to completely specify all IP addresses that are accessible through the RAS server.

Here are two examples which show the proper usage of the RDialPro’s TCP/IP route addition support.

Example #1

Your workstation has a network card that connects to the Internet through a DSL or cable modem connection.  It also has a modem.  You want to use RDialPro to establish a RAS modem connection to your corporate LAN which uses the network 192.168.1.0 with a subnet mask of 255.255.255.0.  Before running this command, you verify that the CorpRAS Icon properties has the option “Use default gateway on remote network” unchecked.

RDialPro CorpRAS /addroute 192.168.1.0 mask 255.255.255.0

This command will first establish a RAS connection to the RAS entry called CorpRAS using the stored user credentials.  After successfully connecting, it will run the operating system’s ROUTE.EXE program to add a route to the routing table.  For example, if the RAS server assigned the IP address 192.168.20.5 to the local RAS client, RDialPro would run the following operating system command:

route add 192.168.1.0 mask 255.255.255.0 192.168.20.5

The effect of this command is that traffic sent to IP addresses 192.168.1.0 through 192.168.1.255 will get routed through the modem connection to the RAS server while all other traffic will get routed through the network card directly to the destination on the Internet.

Example #2

Your workstation has a modem but no network card.  You establish a dial-up Internet connection using any method you want (RAS/DUN Icon, RdialPro, AOL, etc.).  You want to use RDialPro to establish a VPN connection to your corporate LAN which uses the network 192.168.1.0 with a subnet mask of 255.255.255.0.

RDialPro CorpVPN /addroute 192.168.1.0 mask 255.255.255.0

This command will first establish a RAS connection to the RAS entry called CorpVPN using the stored user credentials.  After successfully connecting, it will run the operating system’s ROUTE.EXE program to add a route to the routing table.  For example, if the RAS server assigned the IP address 192.168.20.5 to the local RAS client, RDialPro would run the following operating system command:

route add 192.168.1.0 mask 255.255.255.0 192.168.20.5

The effect of this command is that traffic sent to IP addresses 192.168.1.0 through 192.168.1.255 will get tunnelled through the Internet to the RAS/VPN server while all other traffic will get routed directly to the destination on the Internet.


Common Errors

5 (Access is denied)

This error can occur by one of two conditions.  If the user name and password were not specified on the command line, then they must be saved with the dial-up networking icon.

If the user name and password were specified on the command line, then either the account has been disabled by the remote dial-up server or the user name, password, or domain were misspelled.  If the user name and/or password contain a space or other non-alphanumeric characters, enclose them in double quotes.

623 (Cannot find the phone book entry)

This error occurs when the entry name specified on the command line does not exist in the dial-up networking folder.  If the entry contains a space or other non-alphanumeric characters, enclose the entry name in double quotes.

691 (Access denied because username and/or password is invalid on the domain)

See notes for error 5.


Batch File Integration

For integration into batch files (.bat or .cmd), the following error levels are returned by RDialPro:

When dialing:
0 The specified entry was successfully dialed or it was already connected.
1 Dial command failed and the /APIERROR parameter was not specified.
2 Dial command was aborted by the user with Control-C or Control-Break.
600+ Dial command failed and the /APIERROR parameter was specified. The exact error level corresponds to the Win32 RAS API error code.
Click here for a list of possible codes.
When disconnecting:
0 The specified entry was successfully disconnected or it was not connected.
1 Disconnect command failed and the /APIERROR parameter was not specified.
600+ Disconnect command failed and the /APIERROR parameter was specified. The exact error level corresponds to the Win32 RAS API error code.
Click here for a list of possible codes.
When listing connected entries:
0 All connected entries displayed successfully.
1 Command failed and the /APIERROR parameter was not specified.
600+ Command failed and the /APIERROR parameter was specified. The exact error level corresponds to the Win32 RAS API error code.
Click here for a list of possible codes.
When querying the status of an entry:
0 The specified entry is connected.  If querying without specifying an entry name, this is returned if at least one connection is active.
1 The specified entry is not connected.  If querying without specifying an entry name, this is returned if there are no active connections. This is also returned if the command failed and the /APIERROR parameter was not specified.
600+ Command failed and the /APIERROR parameter was specified. The exact error level corresponds to the Win32 RAS API error code.
Click here for a list of possible codes.

Example 1

Here is a sample batch file that performs the following steps:

  1. Uses RDialPro to establish a RAS connection to a corporate network.
  2. If the RAS connection can't be established after 10 retries, the batch file exits with an error.
  3. Authenticates with the Windows server named CORPSERVER.
  4. Maps the drive letter V: to the SALES share on CORPSERVER.
  5. Copies the document LatestPrices.xls from the remote V: drive to the local workstation's C: drive.
  6. Uses RDialPro to disconnect the RAS connection.

@echo off

rem  --- start of connect.bat ---

rdialpro “Corp Network” /retrycount:10 /retrydelay:60 /addroute 192.168.1.0 mask 255.255.255.0

if errorlevel 1 goto :error

echo You are now connected to Corp Network!

rem  Perform any network-related commands here

rem  For instance:

net use \\corpserver mypass /user:CORPDOMAIN\myname

net use v: \\corpserver\sales

copy v:\LatestPrices.xls c:\Documents

echo Done accessing the remote network.

rdialpro “Corp Network” /disconnect

goto :end

:error

echo There was an error connecting to Corp Network!

:end

rem  --- end of connect.bat ---

 

Example 2

This next example shows how to use the /QUERY option to hangup only if the connection was established by the batch file. If the connection was previously established, it is not disconnected at the end of the batch file.  It uses an environment variable called "hangup" that is set to "yes" if the entry is not already connected.

@echo off

rem  --- start of connect2.bat ---

set hangup=
rdialpro "Corp Network" /query
if not errorlevel 1 goto :connected
 

:dial
set hangup=yes

rdialpro “Corp Network” /retrycount:10 /retrydelay:60

if errorlevel 1 goto :error

echo You are now connected to Corp Network!

 

:connected
rem  Perform any network-related commands here

rem  For instance:

net use \\corpserver mypass /user:CORPDOMAIN\myname

net use v: \\corpserver\sales

copy v:\LatestPrices.xls c:\Documents

echo Done accessing the remote network.

if "%hangup%"=="yes" rdialpro "Corp Network" /disconnect
goto :end

 

:error

echo There was an error connecting to Corp Network!

 

:end

rem  --- end of connect2.bat ---

 


How To Register

To register RasDial Pro, you must purchase it from www.muconsulting.com.  After your payment is received and processed, you will be provided a registration code.  Once you have this registration code, run RDialProRegister.exe from the command-line in the same directory where RDialPro.exe is located.  At the prompt, enter your registration name and registration code exactly as provided to you.  If the registration code is correct, the registration information will be written to RDialPro.exe which will unlock the remaining features.  Provided sufficient user licenses were purchased for this product, the registered version of RDialPro.exe can be copied to other workstations without having to be re-registered.


Revision History

RDialPro 1.4 (5/5/04):

RDialPro 1.31 (5/17/02):

RDialPro 1.3a (2/10/02):

RDialPro 1.3 (9/6/01):

RasDial95 1.2 (8/25/99):

RasDial95 1.1 (4/3/98):

RasDial95 1.0 (11/08/97):


Distribution

The unlicensed version of RasDial Pro may be freely distributed, provided that the distribution is unmodified and complete with its documentation and RDialPro.exe.


Licensing

The unlicensed version of RasDial Pro may be installed and evaluated for a period of thirty (30) days, after which it must be purchased to continue using it.

The purchased version of RasDial Pro provides the following benefits:

RasDial Pro is sold on a per-user basis.  One user license for RasDial Pro must be purchased for each computer on which it will be installed.  Discounts are available for companies that wish to purchase multiple user licenses.  Additionally, an unlimited user license is available for companies that wish to install RasDial Pro on an unlimited number of company-owned computers.


Pricing

For the latest pricing information on RasDial Pro or to purchase it, please visit www.muconsulting.com.


How To Contact µ-Consulting

Web Site www.muconsulting.com