|
GnuDIP Release 2.3.5 - Windows Client Script |
With this client you can have your IP address updated automatically at several GnuDIP sites simultaneously. This client will only send an update to the GnuDIP servers if the IP address at the time of the last update is no longer valid, or enough time has expired. The validity of the old address is determined without generating any network traffic.
The gdipc.bat script serves as the GnuDIP client.
The encpass.bat is also described below. These scripts are simultaneously
Perl scripts and Windows bat files.
We assume from here on that you have installed
this Windows client in C:\gdipc.
We also assume that you chose to have C:\gdipc listed in your
%PATH% environment variable during the installation of this client
software. Thus you should be able to run gdipc.bat at the command prompt
like this:
Otherwise at the command prompt you will have to use:C:\>gdipc -c
C:\>C:\gdipc\gdipc.bat -c
As a convenience, you may also run gdipc -c by simply opening
(e.g. double-clicking) the file C:\gdipc\config.bat.
The client's features include:
gdipc -c" will replace any existing entry.
To list the entries or
delete an entry the user must use a text editor. There is one line per GnuDIP domain.
The script encpass.bat takes its plain text password argument
and prints the encrypted version. This script faciliates manual modification of the configuration
file.
tester;gnudip;gateway;f5d1278e8109edd94e1e4197e04873b9;C:/GDIPC/gdipc.cache.tester.gnudip.txt;0;2073600 tester2;gnudip;gateway;f5d1278e8109edd94e1e4197e04873b9;C:/GDIPC/gdipc.cache.tester2.gnudip.txt;0;2073600
C:\>gdipc -c Using Update Configuration Mode Configuration file name: C:/GDIPC/gdipc.conf.txt Username: tester Domain: gnudip Connect by direct TCP (d) or web server (w) [d]: GnuDIP Server - host[:port]: gateway Password: tester Cache File [C:/GDIPC/gdipc.cache.tester.gnudip.txt]: Minimum Seconds Between Updates [0]: Maximum Seconds Between Updates [2073600]:This is a sample update run:
C:\>gdipc ==== gdipc.pl running: Mon Jun 4 17:59:19 2001 ==== Configuration file name: C:/GDIPC/gdipc.conf.txt Cache file name: C:/GDIPC/gdipc.cache.tester.gnudip.txt No update done for tester.gnudip - 192.168.0.4 still valid Cache file name: C:/GDIPC/gdipc.cache.tester2.gnudip.txt Invalid login attempt for tester2.gnudipThe IP address for
tester.gnudip was not updated because the IP address
at the time of the last update is still valid, and because
"Maximum Seconds Between Updates" had not yet expired.
This is the contents of C:\GDIPC\gdipc.cache.tester.gnudip:
192.168.0.4;991699066The status of a GnuDIP domain may be reset by deleting its cache file.
If "Minimum Seconds Between Updates" is specified, then an update will not be sent to the server more often than this interval, even if the IP address at the time of the last update is no longer valid.
C:\>gdipc -h
usage: gdipc.bat \
usage: { -h | -v | -i [ -r] | [ -f configfile ] [ -c | -r | \
usage: [ -o outfile | -a appendfile | -l logfile ] \
usage: [ -g sendport:recvport ] [ -d repeatseconds] \
usage: [ -w waitseconds] [ -q "addressquerycommand" ] ] \
usage: [ -x "addresschangedcommand" ] }
usage: With no arguments, update server if address changed or time
usage: expired.
usage: -h: Print this usage message.
usage: -v: Show version information.
usage: -i: Prompt and read standard input rather than a configuration
usage: file.
usage: -f: Specify a particular configuration file.
usage: This will otherwise be .GnuDIP2.txt in the directory
usage: specified by the HOME environment variable, or gdipc.conf.txt
usage: in the directory of the binary if HOME is not set.
usage: -c: Specify contents to write to configuration file.
usage: -r: Send an offline request to the server to remove your DNS hostname.
usage: -d: Run as a daemon. Perform client action immediately and then every
usage: "repeatseconds" seconds.
usage: -o: Specify log file to overwrite on each run with output from script.
usage: -a: Specify log file to append on each run with all output from script.
usage: -l: Specify log file for daemon mode. Overwrite on first run, then
usage: append.
usage: -w: Timeout in seconds when waiting for address validation packet.
usage: Defaults to 1 second. Decimal point and fraction (e.g. "0.5") is
usage: allowed.
usage: -g: Client is behind a gateway. Request GnuDIP server to register
usage: address it sees connection from, and pass it back in response.
usage: Specify port to send address validation packet to and port gateway
usage: will forward it to.
usage: -q: Command to invoke to determine IP address to report to GnuDIP
usage: server. Command must write address to standard output. When used
usage: with -g, address is sent to server.
usage: -x: Command to invoke if address changed. This command can be used to
usage: to take any actions required when the address changes. All
usage: validated addresses are passed as arguments.
gdipc.bat at system startup, using the
"Windows Task Scheduler" ("Scheduled Tasks" in "My Computer" - see
http://support.microsoft.com/support/kb/articles/q178/7/06.asp).
On the author's version of Windows 98 this goes like this:
gdipc.bat file, as a temporary measure.
According to the Microsoft Web site:
NOTE: To use Task Scheduler, you must log on to the computer with a valid user account.
The command line for this could be:
c:\gdipc\gdipc.batThis would open a console Window for its output, which would disappear after
gdipc.bat finished.
You could capture the output from the run by instead using:
c:\gdipc\gdipc.bat -o c:\gdipc\gdipc_log.txt
The preceding command line would still open a console Window for its output,
which would disappear after
gdipc.bat finished. However, nothing would be displayed in the console window.
To eliminate the console window you could instead use:
c:\gdipc\wperl.exe c:\gdipc\gdipc.bat -o c:\gdipc\gdipc_log.txtThe difference here is the use of the
wperl.exe executable instead of
the perl.exe executable. A console window is created by
perl.exe but not by wperl.exe.
gdipc_log.txt will be overwritten with each execution of
gdipc.bat. For this reason, you may want two separate Task Scheduler
entries - one for execution at start up and a second for the repeating executions.
For the repeating executions use:
c:\gdipc\wperl.exe c:\gdipc\gdipc.bat -a c:\gdipc\gdipc_log.txtThe difference here is the use of the "
-a" option so that output is
appended to the log for each repeating execution. Note that you should also invoke
gdipc.bat with the -o option at system start up, or the
log file will grow indefinitely.
Again, on the author's version of Windows 98 the "Scheduled Tasks" part goes like this:
gdipc.bat file, as a temporary measure.
If your IP address is particularly volotile, you should specify a value for "Minimum Seconds Between Updates" of 1800 (30 minutes) or so, to give the GnuDIP server a break.
c:\gdipc\wperl.exe c:\gdipc\gdipc.bat -d 30 -l c:\gdipc\gdipc_log.txt
The client normally sends the address it detects at its end of the connection to the server in the update request to the server, and the server registers this address. It also remembers this address, and tests whether it is valid by sending a UDP packet to a randomly selected port at this address. The client then waits a short interval to receive this packet. If it is not received the IP address is assumed to have changed, and an update is sent to the GnuDIP server.
To run behind an NAT box, the client needs to know the external address of the NAT box and must be able to check whether that address has changed.
You must configure the NAT box to redirect some external UDP port to a UDP port on
the internal machine running the client. You provide these port numbers to the
client using the -g option. This option will
also cause the client to request the GnuDIP server to send the external
address of the NAT device (which the server sees as the other end of the client connection)
back in the reply to the update request. You must ensure that the GnuDIP servers you use
are at release 2.3.2 or later in order for this request to succeed.