Server Assigned Addresses with IRIX SLIP


Introduction

Many universities and Internet Access Providers use Server Assigned IP Addresses to get around the limitation in IP address space, and for other routing reasons. This is part of the PPP specification, and all PPP implimentations are supposed to honor it. IRIX PPP works in this environment, but IRIX SLIP doesn't. Since many (most?) Macintosh and IBM-clone SLIP implimentations have a hack to support server assigned IP addresses, many Access Providers (understandably) don't want to deal with implimentations that don't.

This document describes a hack to run IRIX SLIP with server assigned IP addresses. I've recieved more than one, and I'm presenting them in the order I find out about them. The order says nothing about which one I prefer (since I haven't tested any of them).

The Hack, version 1

This is the script that was written by Stefan Farestam (stefan@geometry.se) based upon an idea I provided him, and some help from me to make it finally work. No warranty is provided or implied by either Stefan or myself. If it works for you, that's great! (Pay special attention to the comments you may have to change this, as the format of the sent message varies. You may also need to use a higher debug level in some situations).

#!/bin/sh

## Script to start slip. Handles dynamic ip allocation.
## Stefan Farestam  Mars 1995
##
## Usage (to initiate):  slipc uucp-name
##       (to terminate): slipc quit

## Remote ip address. If this is the same as the local address, then
## set it to 0 (this is tested for further down)
remote_ip=130.237.224.40


trap "$0 quit" 2
syslog=/usr/adm/SYSLOG

case "$1" in
    down|stop|kill|end|quit|e|q|s)
        /etc/killall -INT slip
        ;;

    *) 
        if uuname | egrep -s \^${1:-####}$ ; then
            slip -dd -u "$1" -r $remote_ip -o 1>/dev/null 2>&1 &

            n=`sed -n '$=' $syslog`
            
            ## You may have to change this expression, since it has
            ## to match whatever the slip you connect to outputs.
            match="slip\[$!\]:[ 0-9.:]* start"

            echo "Waiting for slip to connect\c"
            while sleep 5; do
                if sed 1,${n}d $syslog|egrep -s "$match" ; then
                    ## You may have to change the sed expressions. The
                    ## important thing is to extract the assigned ip no.
                    local_ip=`sed 1,${n}d $syslog |\
                        fgrep "slip[$!]"|\
                        sed -n 's/^.*address is \([0-9."]*\).*$/\1/p'|\
                        sed 's/^[":.]*//' |\
                        sed  's/[":.]*$//'`

                    if [ $remote_ip = 0 ]; then remote_ip=$local_ip; fi
                    ifconfig sl0 $local_ip $remote_ip
                    echo "\n\007Connection established"
                    route add net default $remote_ip 1 1>/dev/null
                    ## Decrease the debugging level two steps
                    kill -USR2 $!; sleep 1
                    kill -USR2 $!
                    break
                elif ps -p $! 1>/dev/null; then
                    echo ".\c"
                else
                    echo "\n\007Error:"
                    fgrep "slip[$!]: " $syslog
                    break
                fi
            done
        else
            echo No entry for system \"$1\" in the UUCP Systems file
            exit 1
        fi
        ;;
esac
Stefan may have improved his script since he last sent it to me. If you have problems with this one, he might have an improved script.

Looking more closely at the script, you may need to specify additional options to the SLIP startup command. For example, to use the CSLIP version of the protocol, you would add -p cslip to the command options.

The Hack, version 2

This version was written by Brian Hatch (bri@ifokr.org. Brian is maintaining his on a WWW site. Check out BLIP.

Brian says:

I welcome and encourage any comments you have. But like I said -- it's just a hack to save some time, and make it easier for others who want to use my machine.

Where To Go From Here


Scott Henry <scotth@sgi.com>
Last modified: Mon May 13 13:17:38 1996