home *** CD-ROM | disk | FTP | other *** search
/ Caldera Network Desktop 1.0 / caldera-network-desktop-1.0.bin / doc / HOWTO / mini / Dip+SLiRP+CSLIP < prev    next >
Text File  |  1995-10-29  |  14KB  |  456 lines

  1.  
  2.                    Linux Dip+SLiRP+CSLIP mini-HOWTO
  3.                                  by
  4.                  Zenon Fortuna (zenon@netcom.com)
  5.  
  6.  
  7. Version: 1.0                                            October 15th '95
  8.  
  9. INDEX
  10.         0.      Why "Dip+SLiRP+CSLIP mini-HOWTO" ?
  11.         1.      History of changes
  12.         2.      Short description
  13.         3.      Steps of the configuration
  14.     3.1        Installing the SLiRP
  15.     3.2        Testing the SLiRP
  16.     3.3        Configuring your Linux system
  17.     3.4        Testing your Linux system
  18.     3.5        Installing the DIP
  19.     3.6        Testing the DIP
  20.     4.    Normal operation
  21.     4.1        Adding a DNS capability
  22.         5.      Comments
  23.  
  24. ----------------------------------------------------------------------------
  25. 0.    Why "Dip+SLiRP+CSLIP mini-HOWTO" ?
  26.  
  27.     This document is for users, who don't want to read the NET-2-HOWTO
  28.     with all its details, nor want to read the Dip/SLiRP documents, but
  29.     would like to install a SLIP-like connection to the Internet, using
  30.     available shell-only account.
  31.  
  32.     The above mentioned documents should be considered as more exhaustive,
  33.     but also more exhausting.
  34.  
  35.     The dip337n-uri and slirp-0.95h packages were used to test the described
  36.     functionality. The tests were verified under the stable (tm) Linux
  37.     kernel version 1.2.13, installed under the Slackware 2.2.0 OS
  38.     distribution.
  39.  
  40.  
  41. 1.    History of changes
  42.  
  43.     October 15th '95    Version: 1.0
  44.         The initial version of the document.
  45.  
  46.  
  47. 2.      Short description
  48.  
  49.     - I assume, that your Linux system is able to dial-up a remote
  50.       server of the ISP, where you have a shell-account. On this server
  51.       we will install the "slirp" utility.
  52.  
  53.     - we would like to prepare the "dip" utility on the Linux system,
  54.       along with a specialized script, to dial-up the remote server,
  55.       and start the "slirp" on this remote system.
  56.  
  57.     - the running "dip" will configure the serial line parameters and
  58.       will inform the Linux system about the IP mapping, performed by
  59.       the remote "slirp".
  60.  
  61.     - as a result the TCP/IP packets sent over the serial-line/modem
  62.       connection will be handled by the remote server as though being
  63.       sent locally by this server.
  64.  
  65.     Miracle happens: we will get a TCP/IP connection of the Linux system
  66.     to the Internet resources.
  67.  
  68.  
  69. 3.      Steps of the configuration
  70. 3.1        Installing the SLiRP
  71.  
  72.     - get the SLiRP distribution file, e.g. the slirp-0.95h.tar.gz,
  73.       and compile the "slirp" program on your remote host (the system
  74.       to which you will be dialing up). The SLiRP's docs/README.compiling
  75.       explains the details.
  76.  
  77.       Instead, you can get the already precompiled binary from
  78.         ftp://ibc.wustl.edu/pub/slirp_bin/USE_AT_OWN_RISK/
  79.       as it is explained in the Alt.dcom.slip-emulators FAQ, included
  80.       with the docs.
  81.  
  82.     - move the "slirp" program to a better location, e.g. "./bin/slirp"
  83.       or "./slirp" (i.e. at the $HOME directory)
  84.  
  85.     - at your $HOME directory create the ".slirprc" file.
  86.       To keep it simple let's use only a few commands:
  87.         #### .slirprc file ####
  88.         add ptyexec /usr/bin/tcsh -l:10.0.2.1:23
  89.         compress
  90.         baudrate 38400
  91.         #### end
  92.  
  93.       The "compress" command ensures to use the CSLIP protocol.
  94.       The "add ptyexec" command was used instead of the "shell"
  95.       command (see the SLiRP's docs/CONFIG for a list of commands),
  96.       because it is better to use the "tcsh -l" (for ".login" entry)
  97.       and the "shell" command does not accept flags (I believe).
  98.       You should use the remote system specific address of the "tcsh"
  99.       program (or use another shell, if you prefer).
  100.  
  101.       The "baudrate" should be used with the speed proper for your modem
  102.       connection.
  103.  
  104. 3.2        Testing the SLiRP
  105.  
  106.     Login to your remote site and type
  107.  
  108.         % bin/slirp    (or "./slirp", depending on the location)
  109.  
  110.     You should get a list of messages, with the following line at the end:
  111.         [talking CSLIP, MTU 1500, MRU 1500, 38400 baud]
  112.  
  113.     To exit the "slirp" type slowly (>1 sec gap) five 0's (zeroes).
  114.  
  115. 3.3        Configuring your Linux system
  116.  
  117.     Essentially, what you need to do is to prepare a kernel able
  118.     to run network and the CSLIP. Then you should configure the network.
  119.     Start the "make config" in the "src/linux" directory and set "y"
  120.     to the following options:
  121.  
  122.         Networking support (CONFIG_NET) [y]
  123.         TCP/IP networking (CONFIG_INET) [y]
  124.         Assume subnets are local (CONFIG_INET_SNARL) [y]
  125.         Network device support? (CONFIG_NETDEVICES) [y]
  126.         Dummy net driver support (CONFIG_DUMMY) [y]
  127.         SLIP (serial line) support (CONFIG_SLIP) [y]
  128.         CSLIP compressed headers (CONFIG_SLIP_COMPRESSED) [y]
  129.         PPP (point-to-point) support (CONFIG_PPP) [y]
  130.  
  131.     Now, I use the 3c509 Ethernet card, so my additional options are:
  132.  
  133.         3COM cards (CONFIG_NET_VENDOR_3COM) [y]
  134.         3c509/3c579 support (CONFIG_EL3) [y]
  135.  
  136.     For the NFS installation you can add also:
  137.  
  138.         NFS filesystem support (CONFIG_NFS_FS) [y]
  139.  
  140.     Now, after successful "make config", complete the kernel generation
  141.     with "make dep" and "make zImage".
  142.     Then move the arch/i386/boot/zImage to your kernel location and
  143.     run "lilo".
  144.  
  145.     To configure the network, first decide which IP address to use.
  146.     In a lack of your special address, take 192.168.1.100, allowed for
  147.     local networks by RFC1597.
  148.     Of course, you should rather read the NET-2-HOWTO for correct
  149.     information, but you can try to do the following:
  150.  
  151.     A. Give your system a network name, e.g. "yourhost.linux.org",
  152.        where all the three names could be chosen to your tastes.
  153.        Place the above string (without the quotes) into the
  154.        "/etc/HOSTNAME" file.
  155.  
  156.     B. Edit your "/etc/hosts" file, adding
  157.         192.168.1.100    yourhost.linux.org yourhost
  158.        The above "yourhost.linux.org" string should match the one chosen
  159.        in the step A above.
  160.  
  161.     C. If you run local Ethernet edit also your "/etc/networks" file,
  162.        adding a line:
  163.         yournet        192.168.1.0
  164.  
  165.     D. Edit your "rc.inet1" from the /etc/rc.d directory (save the
  166.        original somewhere :) and set
  167.         IPADDR=yourhost
  168.         NETMASK="255.255.255.0"
  169.         NETWORK=yournet
  170.         BROADCAST="192.168.1.255"
  171.        Then, if you have a real Ethernet card on your system,
  172.        uncomment the line
  173.  /sbin/ifconfig eth0 ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
  174.        and then the following line
  175.  /sbin/route add -net ${NETWORK} netmask ${NETMASK}
  176.  
  177.     E. Place your domain name "linux.org" (compare the step A) into the
  178.        "/etc/resolv.conf" file, as a line:
  179.         domain    linux.org
  180.  
  181.     Now, reboot your system.
  182.  
  183. 3.4        Testing your Linux system
  184.  
  185.     First of all watch the booting messages, or look into the
  186.     "/usr/adm/messages" file, if your syslogd(8) is running.
  187.  
  188.     You should see messages like
  189.          IP Protocols: ICMP, UDP, TCP
  190.          PPP: version ...
  191.          TCP compression ...
  192.          PPP line discipline registered.
  193.          SLIP: version ...
  194.          CSLIP: code copyright ...
  195.     If you have the Ethernet interface it should be recognized as well, e.g:
  196.          eth0: 3c509 at 0x280 ...
  197.  
  198.     Your network should be up and you could test it with a few commands:
  199.  
  200.     A. Run "ifconfig", without arguments.
  201.        You should see the "lo" (loopback) interface activated, with its
  202.        addresses.
  203.        If you run a real Ethernet as well, you will see the information
  204.        about the "eth0" interface as well, and you should notice the
  205.        familiar addresses, like "inet addr: 192.168.1.100", etc.
  206.  
  207.     B. Run "route", without arguments.
  208.        You should see a line about the "loopback" and maybe another one
  209.        about the "yournet".
  210.  
  211.     OK, your Linux system is ready to work with the CSLIP as well.
  212.  
  213. 3.5        Installing the DIP
  214.  
  215.     - it may happen, that your Linux system has already the "dip"
  216.       binary. It would be nice to have the 3.3.7n version of it
  217.       (it has the updated documentation).
  218.  
  219.     - otherwise, get the DIP distribution file, e.g. the dip337n-uri.tar.gz,
  220.       and compile the "dip" program on your local Linux host.
  221.       You do it by typing "make" in the dip-3.3.7n directory.
  222.  
  223.     - move the "dip" program to a better location which is in your PATH,
  224.       e.g. /usr/local/bin/dip or $HOME/bin/dip.
  225.  
  226.     - at convenient location, e.g. your $HOME directory, create the dip's
  227.       script file, for example "slirp.dip".
  228.  
  229.     The dip's script file is usually long and complex. There are some
  230.     examples in the dip's "samples" directory (maybe installed as
  231.     /usr/doc/dip/samples.
  232.     Anyway, I submit my "slirp.dip" file as an example.
  233.  
  234. #### slirp.dip file ####
  235. #
  236. # slirp.dip     Dialup IP script for use with SLiRP and netcom
  237. #
  238.  
  239. main:
  240.   # Set netmask on sl0
  241.   netmask 255.255.255.0
  242.  
  243.   # Set the desired serial port and speed.
  244.   # You may need to change ttyS2 to your modem device...
  245.   # I am running the "mgetty" on this port as well, so I want to use
  246.   # the "ttyS2" instead of the "cua2" device
  247.   port ttyS2
  248.   speed 38400
  249.  
  250.   # Reset the modem and terminal line.
  251.   # This seems to cause trouble for some people!
  252.   reset
  253.  
  254.   # Prepare for dialing.
  255.   # Note your modem may need a different init string.
  256.   # Mine is a WorldBlazer ...
  257.   send AT S0=0 S11=70 S50=254 S58=2 Q0 V1 E1 X4\r
  258.   wait OK 2
  259.   if $errlvl != 0 goto modem_trouble
  260.  
  261. redial:
  262.   # dial your POP#
  263.   # The number below is for my local POP, your mileage may vary
  264.   send ATDT 274 2900\r
  265.   wait CONNECT 50
  266.   if $errlvl != 0 goto dial_trouble
  267.  
  268.   # We are connected.  Login to the system.
  269. login:
  270.   sleep 2
  271.   send \n
  272.   wait ogin: 20
  273.   if $errlvl != 0 goto login_trouble
  274.   print got the login prompt, OK
  275.   # replace 'zenon' below with your remote login username
  276.   sleep 2
  277.   send \n
  278. # I don't know why I had to add the extra "\n" before sending my login name,
  279. # but otherwise it did not work.
  280.   sleep 2
  281.   send zenon\n
  282.   print sent 'zenon', waiting for 'password' ...
  283.  
  284.   wait ord: 30
  285.   if $errlvl != 0 goto password_trouble
  286.   # replace 'blablabla' below with your remote password
  287.   send blablabla\r
  288.  
  289.   # We are now logged in, probably.
  290. loggedin:
  291.   # Substitute YOUR shell prompt below (mine is zenon@netcomNN n% )
  292.   wait zenon 15
  293.   if $errlvl != 0 goto prompt_error
  294.  
  295.   # SLiRP makes 10.0.2.2 the IP of the remote machine
  296.   get $remote 10.0.2.2
  297.  
  298.   # Make sure 'slirp' is found on netcom and is executable
  299.   # Here I assume, that the "slirp" has been installed at the remote $HOME/bin
  300.   # directory
  301.   send exec bin/slirp\n
  302.  
  303.   # Set up the CSLIP operating parameters.
  304.   get $mtu 1500
  305.   # Ensure "route add -net default $remote" will be done
  306.   # With the dip-3.3.7n it is simple, just say "default"
  307.   default
  308.  
  309.   # Say hello and fire up!
  310. done:
  311.   print CONNECTED local: $locip ---> remote: $rmtip
  312.   mode CSLIP
  313.   goto exit
  314.  
  315. prompt_error:
  316.   print TIME-OUT waiting for SLIPlogin to fire up...
  317.   goto error
  318.  
  319. login_trouble:
  320.   print Trouble waiting for the Login: prompt...
  321.   goto error
  322.  
  323. password_trouble:
  324.   print Trouble waiting for the Password: prompt...
  325.   goto error
  326.  
  327. modem_trouble:
  328.   print Trouble occurred with the modem...
  329.   goto error
  330.  
  331. dial_trouble:
  332.   print Trouble occurred while dialing...
  333. error:
  334.   print CONNECT FAILED to $remote
  335.   quit
  336.  
  337. exit:
  338.   exit
  339. #### end
  340.  
  341.     COMMENT: There are some entries in the above script which should be
  342.     adapted to your needs:
  343.     - the port name (I use the ttyS2)
  344.     - the port speed (I use 38400)
  345.     - the modem initialization string (I have a WorldBlazer)
  346.     - the POP's phone number (I hope yours is different :)
  347.     - your remote login name
  348.     - your password
  349.     - your prompt (to confirm the successful login)
  350.     - the location of your "slirp" (mine is in $HOME/bin)
  351.  
  352. 3.6        Testing the DIP
  353.  
  354.     You can start the "dip" in a verbose mode with
  355.         % dip -v slirp.dip
  356.  
  357.     The messages printed by the "dip" may suggest some modifications
  358.     to the above "slirp.dip" script.
  359.     
  360.     If everything goes well, you should see the following message
  361.     at the end:
  362.         CONNECTED local: 192.168.1.100 ---> remote: 10.0.2.2
  363.     ... and the "dip" switches to a "daemon"-like execution, returning
  364.     your prompt.
  365.     BTW, to stop the "dip" now, type simple "dip -k", and all the action
  366.     of the "dip" will be canceled, and the modem connection will be
  367.     closed.
  368.  
  369. 4.    Normal operation
  370.  
  371.     A. Start your dip+slirp connection with typing
  372.  
  373.         % dip slirp.dip
  374.  
  375.     B. After successful connection and the "CONNECTED ..." message you have
  376.        the CSLIP connection to the Internet via your remote ISP.
  377.  
  378.        Try first to connect to your remote server with the "telnet":
  379.  
  380.         % telnet 10.0.2.1
  381.  
  382.        Thanks to the ".slirprc" configuration file, this connection should
  383.        activate the "tcsh -l" and you should get the remote login.
  384.        Typing "ps" you may see the following output:
  385.          6019 s0 S     0:13 slirp
  386.          6075 sb IW    0:00 -/usr/bin/tcsh (tcsh)
  387.         16721 t6 R     0:00 ps
  388.  
  389.  
  390.     C. You can exit from the above telnet connection, or try from another
  391.        virtual terminal (or X shell-window) the ftp connection:
  392.         % ftp 198.86.40.81
  393.  
  394.        After the successful (?) anonymous connection you may discover, that
  395.        you are ... at the "sunsite.unc.edu", Linux-archive site.
  396.  
  397.        If you got so far, you may start admiring the power of the dip+slirp
  398.        connection: you are on the NET.
  399.  
  400.        Disconnect from the "sunsite" ASAP, coming back to your "yourhost"
  401.        system.
  402.        Now, the question comes:
  403.  
  404.         Can we do simply "ftp sunsite.unc.edu" ?
  405.  
  406.        Not before activating the DNS (Domain Name Server).
  407.  
  408.     You may want to quit from the CSLIP at this moment:
  409.     From your local prompt type
  410.  
  411.         % dip -k
  412.  
  413. 4.1        Adding a DNS capability
  414.  
  415.     Apparently, your remote ISP has the DNS service (otherwise you would
  416.     not be able to use the Internet connections in a reasonable way).
  417.     Connect to the remote server once again, with the "dip slirp.dip"
  418.     and "telnet 10.0.2.1", and read the file "/etc/resolv.conf".
  419.  
  420.     You should see a few lines like
  421.         nameserver  <IP-address>
  422.     where the <IP-address> will have a specific value.
  423.  
  424.     Copy at least one of those lines into your "/etc/resolv.conf" file
  425.     on your local Linux system.
  426.  
  427.     Now, come back to this local system (without breaking the
  428.     dip+slirp connection), and test if the DNS service works.
  429.     Type
  430.         % dnsquery sunsite.unc.edu
  431.  
  432.     If the output will inform about the sunsite's IP address, your
  433.     DNS service is functioning.
  434.  
  435.     Now, you can use utilities like "lynx", "mosaic" and "netscape"
  436.     directly from your Linux box.
  437.  
  438. 5.      Comments
  439.  
  440.     This simplified document was written as a summary of the basic
  441.     dip+slirp installation, rather than as a tutorial.
  442.     The intention was to help the potential CSLIP users with starting
  443.     up.
  444.  
  445.     Therefore, if you see any obvious bugs in the above text, please
  446.     let me know.
  447.     After a while I would like to place this text as a mini-HOWTO
  448.     document. For the time being it is available at my ftp directory at
  449.  
  450.         ftp.netcom.com:/pub/ze/zenon/linux/DipSlirpCSLIP/
  451.  
  452.     I want to thank the authors of the "dip" and "slirp" utilities
  453.     for the wonderful utilities. I am impressed and grateful.
  454.  
  455.         Zenon Fortuna    (zenon@netcom.com)
  456.