CLIENT.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <title>
  7. GnuDIP Release 2.3.5 - Windows Client Script
  8. </title>
  9. <base target="_blank">
  10. </head>
  11. <body bgcolor=white>
  12. <table><tr valign=middle><td>
  13. <img align=middle src="gnudip.jpg" alt="GnuDIP Logo" border=0 height=60 width=113>
  14. </td><td>
  15. <h1>GnuDIP Release 2.3.5 - Windows Client Script</h1>
  16. </table>
  17. <hr>
  18. <p>
  19. With this client you can have your IP address updated automatically at
  20. several GnuDIP sites simultaneously. This client will only send an update
  21. to the GnuDIP servers if the IP address at the time of the last update
  22. is no longer valid, or enough time has expired. The validity of the old
  23. address is determined without generating any network traffic.
  24. <p>
  25. The <code>gdipc.bat</code> script serves as the GnuDIP client.
  26. The <code>encpass.bat</code> is also described below. These scripts are simultaneously
  27. Perl scripts and Windows <code>bat</code> files.
  28. <p>
  29. We assume from here on that you have installed
  30. this Windows client in <u><code>C:\gdipc</code></u>.
  31. <p>
  32. We also assume that you chose to have <code>C:\gdipc</code> listed in your
  33. <u><code>%PATH%</code></u> environment variable during the installation of this client
  34. software. Thus you should be able to run <code>gdipc.bat</code> at the command prompt
  35. like this:
  36. <blockquote><pre>
  37. C:\>gdipc -c
  38. </pre></blockquote>
  39. Otherwise at the command prompt you will have to use:
  40. <blockquote><pre>
  41. C:\>C:\gdipc\gdipc.bat -c
  42. </pre></blockquote>
  43. <p>
  44. As a convenience, you may also run <code>gdipc -c</code> by simply opening
  45. (e.g. <b>double-clicking</b>) the file <b><code>C:\gdipc\config.bat</code></b>.
  46. <p>
  47. The client's features include:
  48. <ul>
  49. <li>
  50. The client maintains the information for several GnuDIP domains in the same configuration
  51. file. Using "<code>gdipc -c</code>" will replace any existing entry.
  52. To list the entries or
  53. delete an entry the user must use a text editor. There is one line per GnuDIP domain.
  54. <p>
  55. The script <code>encpass.bat</code> takes its plain text password argument
  56. and prints the encrypted version. This script faciliates manual modification of the configuration
  57. file.
  58. <p>
  59. <li>
  60. The format of the lines in the configuration file is demonstrated by this
  61. sample configuration file:
  62. <pre>
  63. tester;gnudip;gateway;f5d1278e8109edd94e1e4197e04873b9;C:/GDIPC/gdipc.cache.tester.gnudip.txt;0;2073600
  64. tester2;gnudip;gateway;f5d1278e8109edd94e1e4197e04873b9;C:/GDIPC/gdipc.cache.tester2.gnudip.txt;0;2073600
  65. </pre>
  66. <p>
  67. <li>
  68. The client tries not to abuse a GnuDIP server, and maintains a cache file for each GnuDIP
  69. domain towards this end. This is reflected in the user interface, of which this is a sample:
  70. <pre>
  71. C:\>gdipc -c
  72. Using Update Configuration Mode
  73. Configuration file name: C:/GDIPC/gdipc.conf.txt
  74. Username: tester
  75. Domain: gnudip
  76. Connect by direct TCP (d) or web server (w) [d]:
  77. GnuDIP Server - host[:port]: gateway
  78. Password: tester
  79. Cache File [C:/GDIPC/gdipc.cache.tester.gnudip.txt]:
  80. Minimum Seconds Between Updates [0]:
  81. Maximum Seconds Between Updates [2073600]:
  82. </pre>
  83. This is a sample update run:
  84. <pre>
  85. C:\>gdipc
  86. ==== gdipc.pl running: Mon Jun 4 17:59:19 2001 ====
  87. Configuration file name: C:/GDIPC/gdipc.conf.txt
  88. Cache file name: C:/GDIPC/gdipc.cache.tester.gnudip.txt
  89. No update done for tester.gnudip - 192.168.0.4 still valid
  90. Cache file name: C:/GDIPC/gdipc.cache.tester2.gnudip.txt
  91. Invalid login attempt for tester2.gnudip
  92. </pre>
  93. The IP address for <code>tester.gnudip</code> was not updated because the IP address
  94. at the time of the last update is still valid, and because
  95. "Maximum Seconds Between Updates" had not yet expired.
  96. <p>
  97. This is the contents of <code>C:\GDIPC\gdipc.cache.tester.gnudip</code>:
  98. <pre>
  99. 192.168.0.4;991699066
  100. </pre>
  101. The status of a GnuDIP domain may be reset by deleting its cache file.
  102. <p>
  103. If "Minimum Seconds Between Updates" is specified, then an update will not be sent to
  104. the server more often than this interval, even if the IP address at the time of the last
  105. update is no longer valid.
  106. <p>
  107. <li>
  108. The "help" printed by the script is as follows:
  109. <pre>
  110. C:\>gdipc -h
  111. usage: gdipc.bat \
  112. usage: { -h | -v | -i [ -r] | [ -f configfile ] [ -c | -r | \
  113. usage: [ -o outfile | -a appendfile | -l logfile ] \
  114. usage: [ -g sendport:recvport ] [ -d repeatseconds] \
  115. usage: [ -w waitseconds] [ -q "addressquerycommand" ] ] \
  116. usage: [ -x "addresschangedcommand" ] }
  117. usage: With no arguments, update server if address changed or time
  118. usage: expired.
  119. usage: -h: Print this usage message.
  120. usage: -v: Show version information.
  121. usage: -i: Prompt and read standard input rather than a configuration
  122. usage: file.
  123. usage: -f: Specify a particular configuration file.
  124. usage: This will otherwise be .GnuDIP2.txt in the directory
  125. usage: specified by the HOME environment variable, or gdipc.conf.txt
  126. usage: in the directory of the binary if HOME is not set.
  127. usage: -c: Specify contents to write to configuration file.
  128. usage: -r: Send an offline request to the server to remove your DNS hostname.
  129. usage: -d: Run as a daemon. Perform client action immediately and then every
  130. usage: "repeatseconds" seconds.
  131. usage: -o: Specify log file to overwrite on each run with output from script.
  132. usage: -a: Specify log file to append on each run with all output from script.
  133. usage: -l: Specify log file for daemon mode. Overwrite on first run, then
  134. usage: append.
  135. usage: -w: Timeout in seconds when waiting for address validation packet.
  136. usage: Defaults to 1 second. Decimal point and fraction (e.g. "0.5") is
  137. usage: allowed.
  138. usage: -g: Client is behind a gateway. Request GnuDIP server to register
  139. usage: address it sees connection from, and pass it back in response.
  140. usage: Specify port to send address validation packet to and port gateway
  141. usage: will forward it to.
  142. usage: -q: Command to invoke to determine IP address to report to GnuDIP
  143. usage: server. Command must write address to standard output. When used
  144. usage: with -g, address is sent to server.
  145. usage: -x: Command to invoke if address changed. This command can be used to
  146. usage: to take any actions required when the address changes. All
  147. usage: validated addresses are passed as arguments.
  148. </pre>
  149. <p><li>
  150. If your internet connection is established at system start up (as for example with
  151. DHCP), you will want to run <code>gdipc.bat</code> at system startup, using the
  152. "Windows Task Scheduler" ("Scheduled Tasks" in "My Computer" - see
  153. <a href="http://support.microsoft.com/support/kb/articles/q178/7/06.asp">
  154. http://support.microsoft.com/support/kb/articles/q178/7/06.asp</a>).
  155. <p>
  156. On the author's version of Windows 98 this goes like this:
  157. <p>
  158. <ol>
  159. <li>Double-click "My Computer", and then double-click "Scheduled Tasks".
  160. <li>Double-click "Add Scheduled Task", and then click "Next".
  161. <li>Click "Browse".
  162. <li>Locate and select the <code>gdipc.bat</code> file, as a temporary measure.
  163. <li>Click "Open".
  164. <li>Provide a name for the entry - perhaps "gdipc at start up".
  165. <li>Select the "When my computer starts" radio box.
  166. <li>Click "Next".
  167. <li>Select the "Open advanced properties ..." option box.
  168. <li>Click "Finish".
  169. <li>Type the real command line (see below) into the "Run" text box.
  170. <li>Click "OK".
  171. </ol>
  172. <p>
  173. According to the Microsoft Web site:
  174. <blockquote>
  175. NOTE: To use Task Scheduler, you must log on to the computer with a valid user account.
  176. </blockquote>
  177. <p>
  178. The command line for this could be:
  179. <pre>
  180. c:\gdipc\gdipc.bat
  181. </pre>
  182. This would open a console Window for its output, which would disappear after
  183. <code>gdipc.bat</code> finished.
  184. <p>
  185. You could capture the output from the run by instead using:
  186. <pre>
  187. c:\gdipc\gdipc.bat -o c:\gdipc\gdipc_log.txt
  188. </pre>
  189. <p>
  190. The preceding command line would still open a console Window for its output,
  191. which would disappear after
  192. <code>gdipc.bat</code> finished. However, nothing would be displayed in the console window.
  193. To eliminate the console window you could instead use:
  194. <pre>
  195. c:\gdipc\wperl.exe c:\gdipc\gdipc.bat -o c:\gdipc\gdipc_log.txt
  196. </pre>
  197. The difference here is the use of the <code>wperl.exe</code> executable instead of
  198. the <code>perl.exe</code> executable. A console window is created by
  199. <code>perl.exe</code> but not by <code>wperl.exe</code>.
  200. <p><li>
  201. If your IP address may change while your system is running, or you use manually
  202. invoked dial up networking connections, you could have the
  203. Windows Task Scheduler run this once a minute (or whatever), in addition to
  204. running it at system start up. Note however that the
  205. <code>gdipc_log.txt</code> will be overwritten with each execution of
  206. <code>gdipc.bat</code>. For this reason, you may want two separate Task Scheduler
  207. entries - one for execution at start up and a second for the repeating executions.
  208. For the repeating executions use:
  209. <pre>
  210. c:\gdipc\wperl.exe c:\gdipc\gdipc.bat -a c:\gdipc\gdipc_log.txt
  211. </pre>
  212. The difference here is the use of the "<code>-a</code>" option so that output is
  213. appended to the log for each repeating execution. Note that you should also invoke
  214. <code>gdipc.bat</code> with the <code>-o</code> option at system start up, or the
  215. log file will grow indefinitely.
  216. <p>
  217. Again, on the author's version of Windows 98 the "Scheduled Tasks" part goes like this:
  218. <p>
  219. <ol>
  220. <li>Double-click "My Computer", and then double-click "Scheduled Tasks".
  221. <li>Double-click "Add Scheduled Task", and then click "Next".
  222. <li>Click "Browse".
  223. <li>Locate and select the <code>gdipc.bat</code> file, as a temporary measure.
  224. <li>Click "Open".
  225. <li>Provide a name for the entry - perhaps "gdipc repeating".
  226. <li>Select the "Daily" radio box.
  227. <li>Click "Next".
  228. <li>Click "Next" again.
  229. <li>Select the "Open advanced properties ..." option box.
  230. <li>Click "Finish".
  231. <li>Type the real command line (see below) into the "Run" text box.
  232. <li>Select the "Schedule" tab.
  233. <li>Click the "Advanced" button.
  234. <li>Select the "Repeat task" option box.
  235. <li>Use the "Every" scroll box and list box to set your interval.
  236. <li>Click "OK".
  237. <li>Click "OK" again.
  238. </ol>
  239. <p>
  240. If your IP address is particularly
  241. volotile, you should specify a value for "Minimum Seconds Between Updates" of
  242. 1800 (30 minutes) or so, to give the GnuDIP server a break.
  243. <p><li>
  244. If you want to have the address validation done more often than once per minute,
  245. and are willing to leave the GnuDIP client running continually, you could instead
  246. schedule the client at system startup using a command line like this:
  247. <pre>
  248. c:\gdipc\wperl.exe c:\gdipc\gdipc.bat -d 30 -l c:\gdipc\gdipc_log.txt
  249. </pre>
  250. <p><li>
  251. If you have an internal network with a <b>Network Address Transalation/IP Masquerading
  252. gateway</b> providing access to and from the public Internet, and you want to register
  253. the external IP address of the NAT box with the GnuDIP server, you may want to run the
  254. client on an internal machine. If the gateway is a closed proprietary device, you will
  255. have to run the client on an internal machine.
  256. <p>
  257. The client normally sends the address it detects at its end of the connection to
  258. the server in the update request to the server, and the server registers this
  259. address. It also remembers this address, and tests whether it is valid by sending
  260. a UDP packet to a randomly selected port at this address. The client then waits
  261. a short interval to receive this packet. If it is not received the IP address
  262. is assumed to have changed, and an update is sent to the GnuDIP server.
  263. <p>
  264. To run behind an NAT box, the client needs to know the external address of the NAT box
  265. and must be able to check whether that address has changed.
  266. <p>
  267. You must configure the NAT box to redirect some external UDP port to a UDP port on
  268. the internal machine running the client. You provide these port numbers to the
  269. client using the <code>-g</code> option. This option will
  270. also cause the client to request the GnuDIP server to send the external
  271. address of the NAT device (which the server sees as the other end of the client connection)
  272. back in the reply to the update request. You must ensure that the GnuDIP servers you use
  273. are at release 2.3.2 or later in order for this request to succeed.
  274. </ul>
  275. <p><hr>
  276. </body>
  277. </html>