home *** CD-ROM | disk | FTP | other *** search
- /* Create multiple virtual IP addresses under OS/2 TCP/IP version 3 */
- /* This batch file was generated by CompuSource PowerWeb Server++ */
-
- /* These are all the setup variables: */
-
- comport = '<!--#echo var=comport -->' /* This is a dummy com port set up with SIO.SYS */
- multiple = <!--#echo var=multiple --> /* This is how many IP addresses you want, up to 32 */
- realip = '<!--#echo var=realip -->' /* This is the IP through which you will route */
- baseip = '<!--#echo var=baseip -->' /* This is the class C ip base address */
- startip = <!--#echo var=startip --> /* This is the first class C ip address to use */
- startppp = <!--#echo var=startppp --> /* This is the first PPP interface to use, use 1 if PPP0 is used for dialup */
- ether = '<!--#echo var=ether -->' /* This is the MAC address of the ethernet card in your machine */
-
- /* Have any of the IP's already been configured? If so, don't redefine. */
-
- if multiple == 0 then do
- say 'No IP Addresses to configure.'
- return;
- end
-
- '@ipdetect' baseip'.'startip
- if rc == 0 then do
- say 'Multiple IP Addresses ALREADY configured.'
- say 'If you are extending the existing set, you should first reboot.'
- return;
- end
-
- say 'Configuring' multiple 'Multiple IP Addresses ...'
- say 'This takes a while, sometimes 8-15 seconds per IP address that has to be configured, so please be patient.'
-
- /* Load sleeping code */
-
- call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
- call SysLoadFuncs
-
- /* Now the work begins - start each PPP connection as a separate process */
-
- do interface=0 to multiple-1
- ppp = interface + startppp
- '@start /n /min /i "ppp'ppp'" ppp' comport 'idle 1 silent'
- rc=syssleep(1)
- end
-
- /* Configure the routing IP if not already set up */
-
- if realip == '127.0.0.1' then do
- '@ipdetect' realip
- if rc \= 0 then
- '@ifconfig lo' realip
- end
-
- /* Configure each interface and its routing in turn */
-
- do interface=0 to multiple-1
- ip = interface + startip
- ppp = interface + startppp
- call setup 'ppp'ppp baseip'.'ip
- end
-
- return
-
- /* Set up a PPP interface on a specified ip */
-
- setup: parse arg int virtual
-
- '@ifconfig' int virtual realip 'up'
- '@route delete' realip virtual
- '@route add' virtual realip '0'
-
- if ether \= '' then
- '@arp -s' virtual ether 'pub'
-
- return
-
-