home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 May / PCO_5_97.ISO / FilesBBS / OS2 / OS2WWW42.ARJ / OS2WWW42 / OS2WWW42.ZIP / SYS402.R4 / ADMIN / WIZARDS / MULTIP4.INC < prev   
Encoding:
Text File  |  1996-07-09  |  1.4 KB  |  42 lines

  1. /* Create multiple virtual IP addresses under OS/2 TCP/IP version 4 */
  2. /* This batch file was generated by CompuSource PowerWeb Server++ */
  3.  
  4. /* These are all the setup variables: */
  5.  
  6. adapter  = '<!--#echo var=adapter -->' /* This is a dummy com port set up with SIO.SYS */
  7. multiple    =  <!--#echo var=multiple -->    /* This is how many IP addresses you want, up to 32 */
  8. realip    = '<!--#echo var=realip -->'    /* This is the IP through which you will route */
  9. baseip    = '<!--#echo var=baseip -->'    /* This is the class C ip base address */
  10. startip    =  <!--#echo var=startip -->    /* This is the first class C ip address to use */
  11.  
  12. /* Have any of the IP's already been configured? If so, don't redefine. */
  13.  
  14. if multiple == 0 then do
  15.     say 'No IP Addresses to configure.'
  16.     return;
  17. end
  18.  
  19. '@ipdetect' baseip'.'startip
  20. if rc == 0 then do
  21.     say 'Multiple IP Addresses ALREADY configured.'
  22.     return;
  23. end
  24.  
  25. say 'Configuring' multiple 'Multiple IP Addresses ...'
  26. say 'This takes a while, sometimes 3-5 seconds per IP address that has to be configured, so please be patient.'
  27.  
  28. /* Now the work begins - add an alias for each IP Address */
  29.  
  30. do interface=0 to multiple-1
  31.     ip = interface + startip
  32.     '@ifconfig' adapter baseip'.'ip 'alias'
  33. end
  34.  
  35. /* Ensure the default ip is reset to the physical adapter IP address, */
  36. /* otherwise PowerWeb and HostID will query the wrong IP address. */
  37.  
  38. '@hostid' realip
  39.  
  40. return
  41.  
  42.