Reviews / articles about OS/2 |
Operating systems: ArcaOS, eComStation, IBM OS/2 Warp |
|
|
DATE: 2004-11-11 12:41:04 AUTHOR: Stanislav Kozlov, Dmitry Froloff
.......... . . ..... .......... .........: ... "............" ........., . ......, ......., ........... .... . ........ .. ......., .......... VPN (Virtual Private Network) Server W2k. ........ ... ... "...." ..... ........ PPtP (Point to Point Tunneling Protocol), ....... ... ..... .. ...... ......... . .... ......... .......... ............ ...! InJoyFW, IJDialer, PPtPforos2, .. ...... .. .......... ......., ..... .......... . ......... ISDNPM, ....... ....... ........ ............. ........ ...... Willibald Meyer. ..... ... .. ....... PM. ..... PM ......, ........ . ......... ...... .......... 1. ......... ISDNPM...... . ... ..... . ........, .. ..... ....... ..... . ..., ... ...... ... ....... ..... ..... .. ........ ....., . ....... . . ......... ...... .. .......... .., ........... . ......... . ................ ........ ....... . .......... ....... ............ . ......... ......... .... ......... ....... .. ..........., .. ..... . . .... .. .............. ......., ... .... ............ ... pptp.out ......... ....... ..... ... .........: ....: pptp.out [OUTGOING] Name : PP // .... ... .........., ............ LineOutName : [PPTP01] // ... ......... ....., .... .. // .......... pptp ... . ........., // .... . isdn.cfg .. . ....... Tunnel : 192.168.4.20 //..... ......, ... ....... ....... VPN ....... MSS : 1400 //............ ...... ........ (Max Segment Size), // ...... .... ...... ... MTU(== ...... 1500) UserId : // .... . ...... ... ..... . ....... Password : MaxConnections : 1 // ............ ...-.. .......... Flags : AUTODIAL //....., ..... ......... =) AUTODIALMODE : PING,DNSREQUEST,TCPCONNECT // FLAGS : DEFAULTROUTE Flags : MPPE128 //!!!...... ...., ... .... // ..... .......... .......... Flags : MPPESLESS // ........., ..... ....., ... ...... ...... ;) DNS : 212.45.25.166 //... ...... KeepAlive : 30 //.. ... .... ... .... ....... =) KeepAliveDisc : 5 Masquermode : 2 //.... .. ........... // ...... ... Netbios over TCP/IP (Port 137-139) IncomingFilter : fp2.flt,DATENFILTER0 OutgoingFilter : fp2.flt,DATENFILTER0 ..... ...... ... . .. .. .........., ... isdnPM . .... user. ..... ....... .. isdn.cfg ....: isdn.cfg . . . . .: FLAGS : AUTODIAL // .... ......., ..... ............... // .........., .... .. ....... FLAGS : MULTILINK // ....., ... ......... ..-.. ..... FLAGS : DEFAULTROUTE // .......... ....... .. ....... FLAGS : DNSREQUEST // ............ ... . ..... Flags : DORESOLVE // .... ........ ..., . . . . . ..........., .......... .......!!!!! . . . . .! FLAGS : MPPE128 // ..........., . .... ... . ... ........ FLAGS : PAP // PAP ........... FLAGS : CHAP // CHAP ........... FLAGS : CHAPMS // CHAPMS ........... FLAGS : CHAPMSV2 // CHAPMSV2 ........... FLAGS : ALLOWCALLBACKMS // ......... ......-.. FLAGS : ALLOWCALLBACK // ......... CALLBACK FLAGS : CALLBACK // .......... ......, // .... ..... .... ............. ..... FLAGS : CALLBACKMS // PPP-CALLBACK .. .......... .$ FLAGS : LZS // STACK LZS COMPRESSION FLAGS : LZS1 // STACK LZS-1 COMPRESSION FLAGS : LZS1T // STACK LZS-1T COMPRESSION FLAGS : BSD // BSD COMPRESSION FLAGS : PREDICTOR1 // PREDICTOR COMPRESSION FLAGS : PREDICTORCISCO // PREDICTOR CISCO COMPRESSION FLAGS : MPPC // MICROSOFT COMPRESSION FLAGS : DYNAMIC // ......... .dyn .....(. .. .. ............, // .... ... .... .. ..... ......) .... [GLOBAL] .... PPTPLines : 1 //....... ..... .......... ... ... .... ... .... ........ .... ... ...... ..... ... ....... ....... ........ . .......... .... .........(.......), .. ..... .......... .. [IP0] IF_NAME : sl0 << .... IF_UNIT : 0 IF_CONFIG : CONFIG0.FNC // . .... =) // ... ... ...... ... ................ // ........, ... .... ....... [PPTP01] Indication : 10123 // Connections : 4 // Bind : 127.0.0.1 // ... ....... .. ....... ...... ........ . ... ..... ....... ...... .. ....... . ........ ...... CONFIG0.FNC ... ... .... ..... ......... ........ ....: CONFIG0.FNC lcLocalIP = '192.168.4.20' // ......... ... . ... .... ...... lcNetmask = '255.255.255.255' // .. . .... ..... _....._ LocalDNS = '0.0.0.0' // ......... ... .... .... ......, // . .... ... ......... .. ... ........ ............ .. .......... ... ... ..... ........ ........ .-. MPTN .. ....... /driver ..... ... .......... . ... ........ ........ IMYWI$, .. .... .... ......, .. . .... . ... .... ... ........ =)) .. ... ..... .... ... .. ... ............., .. ..... ........... ......... isdnPM. .......... . ... .. ....., . ... ... .. ...... .......... . ......, .. ........., ... ......... ..........., ...... ... ....... Willibald Meyer, ... ..... .. ........... ...... ... ............ .......=( ... ..... .... .. ........ ISDNPM, ... ......... ..... . ... ....... ..... ........ ... .. .... ........ ......, ...... ... ...... . ...... isdnpm. ........., .... . ........ . ........... . ... .... 1 .........., . .......... ... ... ... .. ........ ... . pptp.out. ........ ... . .... ..... dial ... .... ... ..... ......., .. . ... .........., .. ....... ...... ........... .. ......., .... .. ... ......, . ..... ......., .. ... ......... ......, ... ........ ..........., .. .. ..... .... ... ..... .... ..... .... =) ......, ... ...... ......, .... ... ......... ..... ............. DNS, .. ... ........., ..... .., ..... ......... . ... .. ..... MPTS ......... DNS ........ 212.45.25.166 . 212.45.25.165 (... . O:\MPTN\ETC\resolv2 ......... nameserver 212.45.25.166) .. ... .... ...... PS: .. ..... .... ISDNPM - ... ..... ...... ..... .. ...... . ...... . ...... ...... ........ ...... .... ... ....... - ...... . VPN ..... ......... ..... ... .. .. ........ ..... ....., .... ... ..... ............ ... ........, .. ... ... .. .. ... ... =) ..... .... ..... .. #os2russian, ... . ......... ... ...... Mancubus =) ....... ....... .... .. #os2russian, . ........... moveton. 2. .......... .. ....... .................. .... ........ ... .. ......., ....... ..... .... .... ......... ....... .......... .......... (.., ... . ..... ........ .. 5 .....) ........ ...... ...... ............ . ........ . ....... ..... .. Karlheinz Schmidthaus ...... .. ......... ....... ........... ...... ........... .......... . ..... User\pptp.out ........ ....... ...... passive mode ppp. ..... ............ ..... Flags : ~PASSIVE ... ........... ....... .............. ........ MACMYWI.OS2 . PPPEMYWI.OS2 ............. .. .......... ...., .......... ......... User\pptp.out ........ ... .... // * Sample for an ADSL-PPTP connection // * Standardbeispiel fuer eine ADSL-PPTP-Tunnelverbindung // * // * mit Netbios-Datenfilter / with Netbios-paketfilter // * IP-Masquerading // * AutoDial [OUTGOING] // define NAME without space Name : Xs4all-Adsl // or special characters, // maximum 32 chars. LineOutName : [PPTP01] // Tunnel = IP-address of the ADSL-Modem Tunnel : 192.168.0.1 // MSS = (Max Segment Size) // must be lower then MTU Size MSS : 1492 UserId : username@xs4all-basic-adsl Password : mypassword # QueryUID : QUID MaxConnections : 1 # Flags : AUTODIAL AUTODIALMODE : DNSREQUEST,TCPCONNECT,PING # AUTORECONNECT : 1 FLAGS : DEFAULTROUTE,DORESOLVE Flags : ~PASSIVE # FLAGS : MPPESLESS // Client want to use encryption # FLAGS : MPPE128 // ask for 128 bit encryption # FLAGS : NACK2CHAPMSV2 // force MS CHAPV2 authentication // IP-Masquerading aktiv Masquermode : 2 RemoteAddress : 10.0.0.0/255.0.0.0 # Masquerloglevel : natindeny,natinaccept,natout // allow different port for the ftp data connection MasquerOption : LOOSEFTPPORT // answer authentication request with TCPReject (port 113/tcp) MasquerEntry : 0.0.0.0,0,113,127.0.0.1,113,6,0,TCPReject // Paketfilter for Netbios over TCP/IP (Port 137-139) IncomingFilter : fp2.flt,DATENFILTER0 OutgoingFilter : fp2.flt,DATENFILTER0 KeepAlive : 30 KeepAliveDisc : 5 #, // - ........... ............, ...... .............. .. .....
....... ... ....... ........... ....... Rexx ....... ......... ............. config1.fnc - ......... ... ............ ......... .... 10.0.0.0/255.0.0.0 (..... NAT ...... .... ........... .......). ..... ............ .... ...... - .......... ......... ... ..... IF_CONFIG : CONFIG1.FNC . ...... [IP0] (......... sl0) ..... isdn.cfg /********************************************************************** * config1.fnc * * Sample for T-DSL-Connection * the command syntax is for TCP/IP 4.1 and later * * WICHTIG: Abweichende MTU-Size (1492) bei PPPoE notwendig! ***********************************************************************/ call RxFuncAdd 'SysSleep','RexxUtil','SysSleep' call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs' call SysLoadFuncs /* read parameter */ PARSE ARG action ifname ifnumber txt1 local txt2 remote txt3 dns1 txt4 dns2 txt5 nbdns1 txt6 nbdns2 txt7 netmask txt8 name txt9 default txt10 mmode txt11 doresolve txt12 lineoutname . /* display parameters in more readable form */ PARSE SOURCE . . CallName PARSE ARG . . . MoreParms; CALL LOGSAY CallName 'started for' action 'of interface' ifname'/'ifnumber; DO WHILE (MoreParms \= '') PARSE VAR MoreParms ThisName ThisValue MoreParms; CALL LOGSAY ' ' ThisName ThisValue; END; /****************************************************************/ /* CALLED WHEN ISDNPM IS STARTED FOR A SPECIFIC INTERFACE */ /****************************************************************/ if ACTION = 'START' then do say 'START FOR INTERFACE ' ifname ' NUMBER ' ifnumber /* .... .... default - ....... */ 'route delete default' /* ............. ......... */ 'ifconfig sl0 10.0.1.1 netmask 255.0.0.0 mtu 1492' /* ........... default */ 'route add net default 10.0.1.1' /* .. ...... ...... - .... ... . setup.cmd */ 'ifconfig lo 127.0.0.1' 'ipgate on' end /****************************************************************/ /* CALLED WHEN ISDNPM IS STOPPED FOR A SPECIFIC INTERFACE */ /****************************************************************/ if ACTION = 'STOP' then do /* ............... ........ ........ */ 'route delete default' 'ipgate off' WriteResolv() /* say 'STOP FOR INTERFACE ' ifname ' NUMBER ' ifnumber */ end /****************************************************************/ /* CALLED WHEN ISDNPM OPENS A 'PPP-LINK' FOR A INTERFACE */ /****************************************************************/ if ACTION = 'OPEN' then do say 'CONFIG FOR INTERFACE ' ifname ' NUMBER ' ifnumber say 'CONFIG ' txt1 local say 'CONFIG ' txt2 remote say 'CONFIG ' txt9 default say "Nameserver1="||dns1 say "Nameserver2="||dns2 /* ........... ......... DNS . %ETC%\resolv */ WriteResolv( LocalDNS, DNS1, DNS2); end /****************************************************************/ /* CALLED WHEN ISDNPM CLOSE A 'PPP-LINK' FOR A INTERFACE */ /****************************************************************/ if ACTION = 'CLOSE' then do /* say 'RESET FOR INTERFACE ' ifname ' NUMBER ' ifnumber */ end exit 0 /* -------------------------------------------------------------------- */ /* write a line to console and logfile */ /* name and place of the logfile is the same as of the script, but with */ /* extension .log, The file must exist in order to be written. */ /* -------------------------------------------------------------------- */ LOGSAY: PROCEDURE LogId = '[#]'; TimeStamp = TRANSLATE( 'abcd/ef/gh', DATE('S'), 'abcdefgh') TIME()':'; PARSE ARG Line; PARSE SOURCE . . CallName; LogFile = OVERLAY( '.log', CallName, LASTPOS( '.', CallName)); IF (FileExist( LogFile)) THEN DO rc = LINEOUT( LogFile, TimeStamp Line); rc = LINEOUT( LogFile); END; SAY LogId Line; RETURN( 0); /* -------------------------------------------------------------------- */ /* determines if a given file exists */ /* -------------------------------------------------------------------- */ FileExist: PROCEDURE PARSE ARG FileName RETURN(STREAM(Filename, 'C', 'QUERY EXISTS') > ''); /* -------------------------------------------------------------------- */ /* determines filesize */ /* -------------------------------------------------------------------- */ FileSize: PROCEDURE PARSE ARG FileName RETURN(STREAM(Filename, 'C', 'QUERY SIZE')); WriteResolv: PROCEDURE EXPOSE (GlobalVars) PARSE ARG LocalDNS, DNS1, DNS2; /* default values */ Redirection = '>NUL 2>&1'; resolv = VALUE( 'ETC',, 'OS2ENVIRONMENT')'\resolv' resolv2 = VALUE( 'ETC',, 'OS2ENVIRONMENT')'\resolv2' resolv_tmp = resolv||'.tmp' resolv_bak = resolv||'.sik' IF (DNS1 \= '') THEN DO /* ---- write resolv configuration ---- */ /* write temporary resolv file */ rc = SysFileDelete( resolv_tmp); IF (LocalDNS \= "0.0.0.0") THEN CALL LINEOUT resolv_tmp, 'nameserver' LocalDNS; IF (dns1 \= "0.0.0.0") THEN CALL LINEOUT resolv_tmp, 'nameserver' dns1; IF (dns2 \= "0.0.0.0") THEN CALL LINEOUT resolv_tmp, 'nameserver' dns2; CALL LINEOUT resolv_tmp /* create backup copy */ IF ((\FileExist( resolv2)) | (FileSize( Filename) = 0)) THEN DO CALL LOGSAY 'create backup copy of existing file' resolv; rc = SysFileDelete( resolv_bak); 'ren' resolv FileSpec( 'N', resolv_bak) Redirection; END; /* now let temporary file become the real resolv file */ CALL LOGSAY 'create file' resolv 'with requested DNS information' rc = SysFileDelete( resolv); 'ren' resolv_tmp FileSpec( 'N', resolv) Redirection; /* create resolv2 from resolv if not exist */ IF (\FileExist( resolv2)) THEN DO CALL LOGSAY 'create file' resolv2 'as copy'; 'COPY' resolv resolv2 Redirection; END; END; ELSE DO /* ---- cleaup resolv configuration ---- */ /* delete current resolv file */ CALL LOGSAY 'removing file' resolv; rc = SysFileDelete( resolv); /* rename back a backup copy */ IF (FileExist( resolv_bak)) THEN DO CALL LOGSAY 'reactivating existing backup copy of' resolv; 'ren' resolv_bak FileSpec( 'N', resolv) Redirection; END; /* do not delete resolv2 ! */ /* better for autodial users */ END; RETURN( ''); 3. .......... ...... ISDNPM. ....... eComStation/Rus 1.2 ............ ........... ........... ...... ISDNPM - eCSConNet, ....... ............ ......... ........ ........... . .... ........:
... ............ eCSConNet ..... ............ ....... ........., ........ Internet Assistant.
Kommentare:
|
|
||||||||||||||||||||||
(C) OS2.GURU 2001-2021