home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Edition 1: Linux / CD1.iso / doc / HOWTO / mini / Windows-Modem-Sharing < prev    next >
Text File  |  1998-10-14  |  6KB  |  174 lines

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