18.6 Using SLIP

Originally contributed by Satoshi Asami. With input from Guy Helmer and Piero Serini.

18.6.1 Setting Up a SLIP Client

The following is one way to set up a DragonFly machine for SLIP on a static host network. For dynamic hostname assignments (your address changes each time you dial up), you probably need to have a more complex setup.

First, determine which serial port your modem is connected to. Many people set up a symbolic link, such as /dev/modem, to point to the real device name, /dev/cuaaN. This allows you to abstract the actual device name should you ever need to move the modem to a different port. It can become quite cumbersome when you need to fix a bunch of files in /etc and .kermrc files all over the system!

Note: /dev/cuaa0 is COM1, cuaa1 is COM2, etc.

Make sure you have the following in your kernel configuration file:

pseudo-device   sl      1

It is included in the GENERIC kernel, so this should not be a problem unless you have deleted it.

18.6.1.1 Things You Have to Do Only Once

  1. Add your home machine, the gateway and nameservers to your /etc/hosts file. Mine looks like this:

    127.0.0.1               localhost loghost
    136.152.64.181          water.CS.Example.EDU water.CS water
    136.152.64.1            inr-3.CS.Example.EDU inr-3 slip-gateway
    128.32.136.9            ns1.Example.EDU ns1
    128.32.136.12           ns2.Example.EDU ns2
  2. Make sure you have hosts before bind in your /etc/host.conf.

  3. Edit the /etc/rc.conf file.

    1. Set your hostname by editing the line that says:

      hostname="myname.my.domain"

      Your machine's full Internet hostname should be placed here.

    2. Add sl0 to the list of network interfaces by changing the line that says:

      network_interfaces="lo0"

      to:

      network_interfaces="lo0 sl0"
    3. Set the startup flags of sl0 by adding a line:

      ifconfig_sl0="inet ${hostname} slip-gateway netmask 0xffffff00 up"
    4. Designate the default router by changing the line:

      defaultrouter="NO"

      to:

      defaultrouter="slip-gateway"
  4. Make a file /etc/resolv.conf which contains:

    domain CS.Example.EDU
    nameserver 128.32.136.9
    nameserver 128.32.136.12

    As you can see, these set up the nameserver hosts. Of course, the actual domain names and addresses depend on your environment.

  5. Set the password for root and toor (and any other accounts that do not have a password).

  6. Reboot your machine and make sure it comes up with the correct hostname.

18.6.1.2 Making a SLIP Connection

  1. Dial up, type slip at the prompt, enter your machine name and password. What is required to be entered depends on your environment. If you use kermit, you can try a script like this:

    # kermit setup
    set modem hayes
    set line /dev/modem
    set speed 115200
    set parity none
    set flow rts/cts
    set terminal bytesize 8
    set file type binary
    # The next macro will dial up and login
    define slip dial 643-9600, input 10 =>, if failure stop, -
    output slip\x0d, input 10 Username:, if failure stop, -
    output silvia\x0d, input 10 Password:, if failure stop, -
    output ***\x0d, echo \x0aCONNECTED\x0a

    Of course, you have to change the hostname and password to fit yours. After doing so, you can just type slip from the kermit prompt to connect.

    Note: Leaving your password in plain text anywhere in the filesystem is generally a bad idea. Do it at your own risk.

  2. Leave the kermit there (you can suspend it by Ctrl-z) and as root, type:

    # slattach -h -c -s 115200 /dev/modem

    If you are able to ping hosts on the other side of the router, you are connected! If it does not work, you might want to try -a instead of -c as an argument to slattach.

18.6.1.3 How to Shutdown the Connection

Do the following:

# kill -INT `cat /var/run/slattach.modem.pid`

to kill slattach. Keep in mind you must be root to do the above. Then go back to kermit (by running fg if you suspended it) and exit from it (q).

The slattach manual page says you have to use ifconfig sl0 down to mark the interface down, but this does not seem to make any difference for me. (ifconfig sl0 reports the same thing.)

Some times, your modem might refuse to drop the carrier (mine often does). In that case, simply start kermit and quit it again. It usually goes out on the second try.

18.6.1.4 Troubleshooting

If it does not work, feel free to ask me. The things that people tripped over so far:

  • Not using -c or -a in slattach (This should not be fatal, but some users have reported that this solves their problems.)

  • Using s10 instead of sl0 (might be hard to see the difference on some fonts).

  • Try ifconfig sl0 to see your interface status. For example, you might get:

    # ifconfig sl0
    sl0: flags=10<POINTOPOINT>
            inet 136.152.64.181 --> 136.152.64.1 netmask ffffff00
  • If you get ``no route to host'' messages from ping, there may be a problem with your routing table. You can use the netstat -r command to display the current routes :

    # netstat -r
    Routing tables
    Destination      Gateway            Flags     Refs     Use  IfaceMTU    Rtt    Netmasks:
    
    (root node)
    (root node)
    
    Route Tree for Protocol Family inet:
    (root node) =>
    default          inr-3.Example.EDU  UG          8   224515  sl0 -      -
    localhost.Exampl localhost.Example. UH          5    42127  lo0 -       0.438
    inr-3.Example.ED water.CS.Example.E UH          1        0  sl0 -      -
    water.CS.Example localhost.Example. UGH        34 47641234  lo0 -       0.438
    (root node)

    The preceding examples are from a relatively busy system. The numbers on your system will vary depending on network activity.

18.6.2 Setting Up a SLIP Server

This document provides suggestions for setting up SLIP Server services on a DragonFly system, which typically means configuring your system to automatically startup connections upon login for remote SLIP clients.

18.6.2.1 Prerequisites

This section is very technical in nature, so background knowledge is required. It is assumed that you are familiar with the TCP/IP network protocol, and in particular, network and node addressing, network address masks, subnetting, routing, and routing protocols, such as RIP. Configuring SLIP services on a dial-up server requires a knowledge of these concepts, and if you are not familiar with them, please read a copy of either Craig Hunt's TCP/IP Network Administration published by O'Reilly & Associates, Inc. (ISBN Number 0-937175-82-X), or Douglas Comer's books on the TCP/IP protocol.

It is further assumed that you have already set up your modem(s) and configured the appropriate system files to allow logins through your modems. If you have not prepared your system for this yet, please see the tutorial for configuring dialup services. You may also want to check the manual pages for sio(4) for information on the serial port device driver and ttys(5), gettytab(5), getty(8), & init(8) for information relevant to configuring the system to accept logins on modems, and perhaps stty(1) for information on setting serial port parameters (such as clocal for directly-connected serial interfaces).

18.6.2.2 Quick Overview

In its typical configuration, using DragonFly as a SLIP server works as follows: a SLIP user dials up your DragonFly SLIP Server system and logs in with a special SLIP login ID that uses /usr/sbin/sliplogin as the special user's shell. The sliplogin program browses the file /etc/sliphome/slip.hosts to find a matching line for the special user, and if it finds a match, connects the serial line to an available SLIP interface and then runs the shell script /etc/sliphome/slip.login to configure the SLIP interface.

18.6.2.2.1 An Example of a SLIP Server Login

For example, if a SLIP user ID were Shelmerg, Shelmerg's entry in /etc/master.passwd would look something like this:

Shelmerg:password:1964:89::0:0:Guy Helmer - SLIP:/usr/users/Shelmerg:/usr/sbin/sliplogin

When Shelmerg logs in, sliplogin will search /etc/sliphome/slip.hosts for a line that had a matching user ID; for example, there may be a line in /etc/sliphome/slip.hosts that reads:

Shelmerg        dc-slip sl-helmer       0xfffffc00		  autocomp

sliplogin will find that matching line, hook the serial line into the next available SLIP interface, and then execute /etc/sliphome/slip.login like this:

/etc/sliphome/slip.login 0 19200 Shelmerg dc-slip sl-helmer 0xfffffc00 autocomp

If all goes well, /etc/sliphome/slip.login will issue an ifconfig for the SLIP interface to which sliplogin attached itself (slip interface 0, in the above example, which was the first parameter in the list given to slip.login) to set the local IP address (dc-slip), remote IP address (sl-helmer), network mask for the SLIP interface (0xfffffc00), and any additional flags (autocomp). If something goes wrong, sliplogin usually logs good informational messages via the daemon syslog facility, which usually logs to /var/log/messages (see the manual pages for syslogd(8) and syslog.conf(5) and perhaps check /etc/syslog.conf to see to what syslogd is logging and where it is logging to).

OK, enough of the examples -- let us dive into setting up the system.

18.6.2.3 Kernel Configuration

DragonFly's default kernels usually come with two SLIP interfaces defined (sl0 and sl1); you can use netstat -i to see whether these interfaces are defined in your kernel.

Sample output from netstat -i:

Name  Mtu   Network     Address            Ipkts Ierrs    Opkts Oerrs  Coll
ed0   1500  <Link>0.0.c0.2c.5f.4a         291311     0   174209     0   133
ed0   1500  138.247.224 ivory             291311     0   174209     0   133
lo0   65535 <Link>                            79     0       79     0     0
lo0   65535 loop        localhost             79     0       79     0     0
sl0*  296   <Link>                             0     0        0     0     0
sl1*  296   <Link>                             0     0        0     0     0

The sl0 and sl1 interfaces shown from netstat -i indicate that there are two SLIP interfaces built into the kernel. (The asterisks after the sl0 and sl1 indicate that the interfaces are ``down''.)

However, DragonFly's default kernel does not come configured to forward packets (by default, your DragonFly machine will not act as a router) due to Internet RFC requirements for Internet hosts (see RFCs 1009 [Requirements for Internet Gateways], 1122 [Requirements for Internet Hosts -- Communication Layers], and perhaps 1127 [A Perspective on the Host Requirements RFCs]). If you want your DragonFly SLIP Server to act as a router, you will have to edit the /etc/rc.conf file and change the setting of the gateway_enable variable to YES.

You will then need to reboot for the new settings to take effect.

You will notice that near the end of the default kernel configuration file (/sys/i386/conf/GENERIC) is a line that reads:

pseudo-device sl 2

This is the line that defines the number of SLIP devices available in the kernel; the number at the end of the line is the maximum number of SLIP connections that may be operating simultaneously.

Please refer to Chapter 9 on Configuring the DragonFly Kernel for help in reconfiguring your kernel.

18.6.2.4 Sliplogin Configuration

As mentioned earlier, there are three files in the /etc/sliphome directory that are part of the configuration for /usr/sbin/sliplogin (see sliplogin(8) for the actual manual page for sliplogin): slip.hosts, which defines the SLIP users and their associated IP addresses; slip.login, which usually just configures the SLIP interface; and (optionally) slip.logout, which undoes slip.login's effects when the serial connection is terminated.

18.6.2.4.1 slip.hosts Configuration

/etc/sliphome/slip.hosts contains lines which have at least four items separated by whitespace:

  • SLIP user's login ID

  • Local address (local to the SLIP server) of the SLIP link

  • Remote address of the SLIP link

  • Network mask

The local and remote addresses may be host names (resolved to IP addresses by /etc/hosts or by the domain name service, depending on your specifications in /etc/host.conf), and the network mask may be a name that can be resolved by a lookup into /etc/networks. On a sample system, /etc/sliphome/slip.hosts looks like this:

#
# login local-addr      remote-addr     mask            opt1    opt2 
#                                               (normal,compress,noicmp)
#
Shelmerg  dc-slip       sl-helmerg      0xfffffc00      autocomp

At the end of the line is one or more of the options.

  • normal -- no header compression

  • compress -- compress headers

  • autocomp -- compress headers if the remote end allows it

  • noicmp -- disable ICMP packets (so any ``ping'' packets will be dropped instead of using up your bandwidth)

Your choice of local and remote addresses for your SLIP links depends on whether you are going to dedicate a TCP/IP subnet or if you are going to use ``proxy ARP'' on your SLIP server (it is not ``true'' proxy ARP, but that is the terminology used in this section to describe it). If you are not sure which method to select or how to assign IP addresses, please refer to the TCP/IP books referenced in the SLIP Prerequisites (Section 18.6.2.1) and/or consult your IP network manager.

If you are going to use a separate subnet for your SLIP clients, you will need to allocate the subnet number out of your assigned IP network number and assign each of your SLIP client's IP numbers out of that subnet. Then, you will probably need to configure a static route to the SLIP subnet via your SLIP server on your nearest IP router.

Otherwise, if you will use the ``proxy ARP'' method, you will need to assign your SLIP client's IP addresses out of your SLIP server's Ethernet subnet, and you will also need to adjust your /etc/sliphome/slip.login and /etc/sliphome/slip.logout scripts to use arp(8) to manage the proxy-ARP entries in the SLIP server's ARP table.

18.6.2.4.2 slip.login Configuration

The typical /etc/sliphome/slip.login file looks like this:

#!/bin/sh -
#
#       @(#)slip.login  5.1 (Berkeley) 7/1/90

#
# generic login file for a slip line.  sliplogin invokes this with
# the parameters:
#      1        2         3        4          5         6     7-n
#   slipunit ttyspeed loginname local-addr remote-addr mask opt-args
#
/sbin/ifconfig sl$1 inet $4 $5 netmask $6

This slip.login file merely runs ifconfig for the appropriate SLIP interface with the local and remote addresses and network mask of the SLIP interface.

If you have decided to use the ``proxy ARP'' method (instead of using a separate subnet for your SLIP clients), your /etc/sliphome/slip.login file will need to look something like this:

#!/bin/sh -
#
#       @(#)slip.login  5.1 (Berkeley) 7/1/90

#
# generic login file for a slip line.  sliplogin invokes this with
# the parameters:
#      1        2         3        4          5         6     7-n
#   slipunit ttyspeed loginname local-addr remote-addr mask opt-args
#
/sbin/ifconfig sl$1 inet $4 $5 netmask $6 
# Answer ARP requests for the SLIP client with our Ethernet addr
/usr/sbin/arp -s $5 00:11:22:33:44:55 pub

The additional line in this slip.login, arp -s $5 00:11:22:33:44:55 pub, creates an ARP entry in the SLIP server's ARP table. This ARP entry causes the SLIP server to respond with the SLIP server's Ethernet MAC address whenever another IP node on the Ethernet asks to speak to the SLIP client's IP address.

When using the example above, be sure to replace the Ethernet MAC address (00:11:22:33:44:55) with the MAC address of your system's Ethernet card, or your ``proxy ARP'' will definitely not work! You can discover your SLIP server's Ethernet MAC address by looking at the results of running netstat -i; the second line of the output should look something like:

ed0   1500  <Link>0.2.c1.28.5f.4a         191923	0   129457     0   116

This indicates that this particular system's Ethernet MAC address is 00:02:c1:28:5f:4a -- the periods in the Ethernet MAC address given by netstat -i must be changed to colons and leading zeros should be added to each single-digit hexadecimal number to convert the address into the form that arp(8) desires; see the manual page on arp(8) for complete information on usage.

Note: When you create /etc/sliphome/slip.login and /etc/sliphome/slip.logout, the ``execute'' bit (chmod 755 /etc/sliphome/slip.login /etc/sliphome/slip.logout) must be set, or sliplogin will be unable to execute it.

18.6.2.4.3 slip.logout Configuration

/etc/sliphome/slip.logout is not strictly needed (unless you are implementing ``proxy ARP''), but if you decide to create it, this is an example of a basic slip.logout script:

#!/bin/sh -
#
#       slip.logout

#
# logout file for a slip line.  sliplogin invokes this with
# the parameters:
#      1        2         3        4          5         6     7-n
#   slipunit ttyspeed loginname local-addr remote-addr mask opt-args
#
/sbin/ifconfig sl$1 down

If you are using ``proxy ARP'', you will want to have /etc/sliphome/slip.logout remove the ARP entry for the SLIP client:

#!/bin/sh -
#
#       @(#)slip.logout

#
# logout file for a slip line.  sliplogin invokes this with
# the parameters:
#      1        2         3        4          5         6     7-n
#   slipunit ttyspeed loginname local-addr remote-addr mask opt-args
#
/sbin/ifconfig sl$1 down
# Quit answering ARP requests for the SLIP client
/usr/sbin/arp -d $5

The arp -d $5 removes the ARP entry that the ``proxy ARP'' slip.login added when the SLIP client logged in.

It bears repeating: make sure /etc/sliphome/slip.logout has the execute bit set after you create it (ie, chmod 755 /etc/sliphome/slip.logout).

18.6.2.5 Routing Considerations

If you are not using the ``proxy ARP'' method for routing packets between your SLIP clients and the rest of your network (and perhaps the Internet), you will probably have to add static routes to your closest default router(s) to route your SLIP client subnet via your SLIP server.

18.6.2.5.1 Static Routes

Adding static routes to your nearest default routers can be troublesome (or impossible if you do not have authority to do so...). If you have a multiple-router network in your organization, some routers, such as those made by Cisco and Proteon, may not only need to be configured with the static route to the SLIP subnet, but also need to be told which static routes to tell other routers about, so some expertise and troubleshooting/tweaking may be necessary to get static-route-based routing to work.

18.6.2.5.2 Running GateD®

Note: GateD® is proprietary software now and will not be available as source code to the public anymore (more info on the GateD website). This section only exists to ensure backwards compatibility for those that are still using an older version.

An alternative to the headaches of static routes is to install GateD on your DragonFly SLIP server and configure it to use the appropriate routing protocols (RIP/OSPF/BGP/EGP) to tell other routers about your SLIP subnet. You'll need to write a /etc/gated.conf file to configure your gated; here is a sample, similar to what the author used on a FreeBSD SLIP server:

#
# gated configuration file for dc.dsu.edu; for gated version 3.5alpha5
# Only broadcast RIP information for xxx.xxx.yy out the ed Ethernet interface
#
#
# tracing options
#
traceoptions "/var/tmp/gated.output" replace size 100k files 2 general ;

rip yes {
  interface sl noripout noripin ;
  interface ed ripin ripout version 1 ;
  traceoptions route ;
} ;

#
# Turn on a bunch of tracing info for the interface to the kernel:
kernel {
  traceoptions remnants request routes info interface ;
} ;

#
# Propagate the route to xxx.xxx.yy out the Ethernet interface via RIP
#

export proto rip interface ed {
  proto direct {
      xxx.xxx.yy mask 255.255.252.0 metric 1; # SLIP connections
  } ;
} ;

#
# Accept routes from RIP via ed Ethernet interfaces
	      
import proto rip interface ed {
  all ;
} ;

The above sample gated.conf file broadcasts routing information regarding the SLIP subnet xxx.xxx.yy via RIP onto the Ethernet; if you are using a different Ethernet driver than the ed driver, you will need to change the references to the ed interface appropriately. This sample file also sets up tracing to /var/tmp/gated.output for debugging GateD's activity; you can certainly turn off the tracing options if GateD works OK for you. You will need to change the xxx.xxx.yy's into the network address of your own SLIP subnet (be sure to change the net mask in the proto direct clause as well).

Once you have installed and configured GateD on your system, you will need to tell the DragonFly startup scripts to run GateD in place of routed. The easiest way to accomplish this is to set the router and router_flags variables in /etc/rc.conf. Please see the manual page for GateD for information on command-line parameters.

Contact the Documentation mailing list for comments, suggestions and questions about this document.