home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / doc / HOWTO / mini / Windows-Modem-Sharing < prev    next >
Text File  |  1997-07-14  |  5KB  |  161 lines

  1. Linux Modem sharing mini-HOWTO
  2.  
  3. Author:  Friedemann Baitinger,  baiti@herrenberg.netsurf.de
  4. last update: V1.00, 06/12/97
  5.  
  6.  
  7. 1. Introduction
  8. ~~~~~~~~~~~~~~~
  9.  
  10. This mini-HOWTO describes how to setup a Linux system in order to share a
  11. modem attached to this system with other systems over a TCP/IP network.
  12.  
  13.  
  14.  
  15.  
  16. 2. The Server Side
  17. ~~~~~~~~~~~~~~~~~~
  18.  
  19. It is assumed that the server is a Linux system with either:
  20.  
  21.   a)  a modem attached to a /dev/ttySx device
  22.  
  23.   b)  an 'isdn4linux'-emulated modem mapped to a /dev/ttyIx device
  24.  
  25. The easiest setup I can think of uses a five lines perl script to
  26. implement a 'modem demon':
  27.  
  28.     $ cat /usr/sbin/modemd
  29.  
  30.     #!/usr/bin/perl
  31.     select((select(STDOUT), $| = 1)[$[]);
  32.     select((select(STDIN), $| = 1)[$[]);
  33.     exec 'cu -l /dev/ttyS1';
  34.     die '$0: Cant exec cu: $!\n';
  35.  
  36. The modem demon is started by the INETD process if a client connects to
  37. the appropriate port as described below. The 'modemd simply connects the
  38. socket handle with STDIN and STDOUT of the 'cu' command and lets 'cu'
  39. handle the actual modem device.
  40.  
  41. The existence of the modem demon must be made known to the INETD process
  42. by updating its configuration file, usually /etc/inetd.conf like:
  43.  
  44.     #
  45.     # modem daemon
  46.     #
  47.     modem stream tcp nowait root /usr/sbin/tcpd /usr/sbin/modemd /dev/ttyS1
  48.  
  49. In order to make this work, an entry to '/etc/services' needs to be added
  50. like:
  51.  
  52.     modem           2006/tcp        modemd
  53.  
  54. This associates a symbolic name with an explicit port, 2006 in the
  55. example. The portnumber could be any number not already assigned to
  56. an existing service. After these changes have been made, a signal must
  57. be sent to the inetd process in order to let inetd re-read and process
  58. its configuration file:
  59.  
  60.     $ ps |grep inetd
  61.     194  ?  S     0:00 /usr/sbin/inetd 
  62.  
  63.     kill -HUP 194
  64.  
  65.  
  66. Now the server side is ready to accept requests from clients. The correct
  67. function can be verified by:
  68.  
  69.     $ telnet localhost modem
  70.  
  71.     Trying 127.0.0.1...
  72.     Connected to localhost.
  73.     Escape character is '^]'.
  74.  
  75. You are now connected to the modem. You can now issue 'AT' command in order
  76. to verify the setup:
  77.  
  78.  
  79.     atz
  80.     atz
  81.     OK
  82.  
  83.     ati1
  84.     ati1
  85.     Linux ISDN
  86.     OK
  87.  
  88.     ^]
  89.     telnet>quit
  90.     $
  91.  
  92.  
  93. Instead of using the Perl script as a modem server, there is also a
  94. program named 'mserver' available. You may want to use 'archie' or any
  95. other search engine in order to locate the mserver archive. I haven't
  96. had the opportunity yet to install and use mserver.
  97.  
  98.  
  99.  
  100. 3. The Client Side
  101. ~~~~~~~~~~~~~~~~~~ 
  102.  
  103. At this time, only Windows client setups are described here.  On the client
  104. PC, a COM-port redirector for TCP/IP is required. The best program for this
  105. purpose I have found is 'DialOut/IP' from 'Tactical Software' for Windows
  106. 3.1 and Windows 95.  (The Windows 3.1 version can be used under Windows NT
  107. for 16-bit applications only.  A 32-bit version for Windows NT is due late
  108. summer 1997.)  
  109.  
  110. DialOut/IP presents the shared modem on a new virtual COM port that it adds
  111. to Windows.  This virtual COM port can be used by Windows programs as if
  112. the shared modem is directly connected.  Most client applications
  113. (including Windows 95 dial-up networking) accept this and work as if there
  114. were a real COM port and modem, with the general exception being fax
  115. applications or any others that need access to UART control lines.
  116. DialOut/IP can be configured to provide Telnet protocol processing, but
  117. that feature applies to certain modem pool products and not to the Linux
  118. setup described in this file.  Note that, despite its name, DialOut/IP can
  119. be used also by applications that wait for incoming calls.
  120.  
  121. On <URL: http://www.tactical-sw.com/> there is a page for downloading a
  122. fully functional evaluation version that times out in 1-2 weeks.
  123. Installation and configuration is handled by a setup program, with
  124. installation details in the README.TXT file.  When you run DialOut/IP, you
  125. enter the IP address and port number of the shared modem. 
  126.  
  127. DialOut/IP is a commercial product that is licensed on a per-modem basis,
  128. that is, the price depends on the number of modems that you are sharing.
  129. The license states that you can install the software on any number of PC's
  130. that access the shared modems.
  131.  
  132.  
  133. 4. Security Considerations
  134. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  135.  
  136. If you have only one modem for all your hosts in your local area network,
  137. there is probably no reason to worry about security here. However, if
  138. any one or more of the hosts in your LAN are connected to the internet
  139. by other means than using the modem we have just setup as a modem server,
  140. then security considerations are required, otherwise anybody can do a
  141. 'telnet your_host modem' and dial out long distance or even international
  142. calls at his will.
  143.  
  144. I suggest to install and configure tcp-wrappers in order to protect
  145. the modem serer against unauthorized access.
  146.  
  147.  
  148.  
  149. 5. Examples
  150. ~~~~~~~~~~~   
  151.  
  152. I am using the setup as described in (2) and (3) to run Quicken on my
  153. Windows 95 ThinkPad and do homebanking with the modem attached to my
  154. Linux machine. The 'modem' in my case is not even a real modem, it is
  155. an emulated modem on an ISDN-So card. Quicken just sees a COM port,
  156. it doesn't know that the device attached to the COM port is actually
  157. at the other end of my Ethernet LAN, nor does it know that it is not
  158. a standard analog modem but an ISDN device which happens to understand
  159. 'AT' commands.
  160.  
  161.