Red Hat Linux 7 Unleashed

Red Hat Linux 7 Unleashed

By William Ball

Setting Up SLIP

SLIP is used by some ISPs who don't support PPP (a rarity these days). You may also find SLIP supported by some online services that don't use the Internet, such as bank access programs and stock trading. In the past, SLIP was usually compiled into the Linux kernel, as was a modification of SLIP called CSLIP (Compressed SLIP). With Red Hat Linux, however, SLIP support is supplied as a loadable kernel module.

To use SLIP, you need to dedicate a port to it. This means that the port cannot be used by other applications. This is necessary because of the way SLIP handles ports, which causes conflicts if shared with other programs.

Configuring SLIP

The fastest way to configure SLIP is to use the slattach program. This requires the name of the port that SLIP will use (which has a modem attached for the connection, usually). The command that sets up slattach is as follows:

					
   # slattach /dev/ttyS0 &
				

In this case, I've configured /dev/ttyS0 port (COM1) as the SLIP port. You can use any other port attached to your system. The ampersand at the end of the line puts the slattach program in the background so you can get your shell prompt back.

When you run slattach, the port is renamed to /dev/sl0, which indicates it is the first SLIP device. It doesn't matter what device name you used for the serial port; the first SLIP device is always called /dev/sl0. This can lead to some confusion if you are using /dev/ttyS2, for example, which becomes /dev/sl0. If more than one SLIP port is created, they are numbered increasingly as /dev/sl1, /dev/sl2, and so on. Linux usually supports up to eight SLIP lines, but it is unlikely you will need this many. To check if the SLIP device has been created, you can search the file named dev under the /proc/net directory using fgrep like this:

					
   # fgrep sl0 /proc/net/dev
sl0:     0      0    0    0    0      0     0     0
...

Linux uses CSLIP by default for most SLIP lines because it packs more information in the same space as SLIP. If your ISP or whomever you are connecting to does not support CSLIP, you need to force Linux to use only SLIP. You can do this on the slattach line:

					
   # slattach -p slip /dev/ttyS0 &
				

This tells slattach to use only the SLIP protocol. Other valid arguments after the -p option are cslip (for CSLIP), adaptive (which adjusts to whatever is at the other end of the connection), ppp, and kiss (for packet radio).

Now that the SLIP device has been created, you need to tell the Linux kernel about it, using the ifconfig program for setting up the dummy interface. The ifconfig line that establishes the interface requires the name of the remote system:

ifconfig sl0 mymachine-slip pointopoint remotemachine

sl0 is the name of the interface (/dev/sl0 in this case); mymachine -slip is the local name of the SLIP interface (you should substitute your machine's name, such as merlin-slip or darkstar-slip); pointopoint tells ifconfig the interface is a point-to-point connection (not to be confused with PPP); and remotemachine is the name of the machine at the other end of the connection. For example, if the remote machine's name is darkstar and your machine's name is dogbert, the ifconfig command looks like this:

ifconfig sl0 dogbert-slip pointopoint darkstar

The next step is to issue the route command to add the route to the remote machine to the system databases. The syntax is the same as when you set up the dummy interface:

route add darkstar

In this case, you are adding a route to the remote machine called darkstar. You should substitute whatever the remote machine is called.

Share ThisShare This

Informit Network