Setting up PPP to CSUC under Linux

Since there are two ways to call into school (x4935 and x6993 [x6385]), this document will be split up the middle, as it were. First, I'll discuss getting to the ECT modem on x4935 using the regular non-PAP login. I know PAP is set up on these lines, but I can't get it to work. (On x6993, you just start spewing PAP stuff at the login prompt, but the ECT setup doesn't seem to care for that.)

The PPP scripts come in two parts: the script that starts pppd and the script that it calls to dial the modem. The first of these, ppp-on can be found in the /usr/sbin directory. I just used ppp-on as a template for a script called chico4935. This script calls another "chat" script called ppp-on-dialer which can be found in /etc/ppp. I used the ppp-on-dialer as a template for my chico4935.dialer.

Another script in /usr/sbin, ppp-off requires no modification--just run it when you want the connection to come down.

Setting up on the x4935 lines

Here is the /usr/sbin/chico4935 script that you should run to set up the connection:

    #!/bin/sh
    #
    # chico4935 -- sets up PPP on the x4935 ECT lines (Non-PAP)
    #
    LOCAL_IP=0.0.0.0        # Local IP address if known. Dynamic = 0.0.0.0
    REMOTE_IP=0.0.0.0       # Remote IP address if desired. Normally 0.0.0.0
    NETMASK=255.255.255.192
    DIALER_SCRIPT=/etc/ppp/chico-dialer4935

    exec /usr/sbin/pppd debug lock modem crtscts /dev/modem 38400 \
             asyncmap 20A0000 escape FF kdebug 0 $LOCAL_IP:$REMOTE_IP \
             noipdefault netmask $NETMASK defaultroute  \
             lcp-max-configure 30 connect $DIALER_SCRIPT

This shell script runs pppd, which in turn runs the chat script /etc/ppp/chico4935-dialer:

    #!/bin/sh
    #
    # This is part 2 of the ppp-on script. It will perform the connection
    # protocol for the desired connection.
    #
    DONE=0
    TELEPHONE=898-4935
    while [ $DONE -eq 0 ]; do
            /usr/sbin/chat                                  \
            TIMEOUT         3                               \
            ABORT           '\nBUSY\r'                      \
            ABORT           '\nNO ANSWER\r'                 \
            ABORT           '\nRINGING\r\n\r\nRINGING\r'    \
            ''              \rAT                            \
            OK              '\rATS11=40'                    \
            TIMEOUT         30                              \
            'OK'            ATDT$TELEPHONE                  \
            CONNECT         '\d\d\d\n\r'                    \
            Username:       YOURname                        \
            Password:       YOURpassword                    \
            '\ncs2500>'     'ppp default'
    
            # if not busy, we're done
            if [ $? -ne 4 ]; then
                    DONE=1
            fi
    done

Be sure to change the lines that enter your name and password into the system, above.

Once these two scripts are in place, pull up another window and run "tail -f /var/adm/messages". In a different window, as root, type "chico4935" and see if everything works. Once the connection comes up, you should see something like this in the log:

    Sep 12 17:03:37 frog pppd[22536]: pppd 2.2.0 started by root, uid 0
    Sep 12 17:04:00 frog pppd[22536]: Serial connection established.
    Sep 12 17:04:01 frog pppd[22536]: Using interface ppp0
    Sep 12 17:04:01 frog pppd[22536]: Connect: ppp0 <--> /dev/modem
    Sep 12 17:04:05 frog pppd[22536]: local  IP address 132.241.5.76
    Sep 12 17:04:05 frog pppd[22536]: remote IP address 132.241.5.66

Type "ping ect-unix" and see if you're there.

If you don't see that above stuff in the log, try adding the "-v" switch to chat in the chico4935-dialer; that will cause it to dump verbose output to the system log.

Setting up on the x6993 lines

These modems are not ECT modems; they're the ones with that pesky 25 hour limit. They require that you use PAP to authenticate yourself, as well. As many of you know, the x6385 modems are functionally the same as the x6993 ones--they're just faster.

Since you need PAP to access these, you must create a file called /etc/ppp/pap-secrets. This file should contain "username * password" lines like this:

    beej * ms2die     [No, that's not my real password...]

Since this password is in plaintext, you should make sure this file isn't world-readable.

Other than that, the setup is similar to the x4935 lines. Here is a /usr/sbin/chico6993 script:

    #!/bin/sh
    #
    # chico6993 -- sets up PPP on the x6993 non-ECT lines (PAP)
    #
    USER=YOURlogin          # Put YOUR login name here!!
    LOCAL_IP=0.0.0.0        # Local IP address if known. Dynamic = 0.0.0.0
    REMOTE_IP=0.0.0.0       # Remote IP address if desired. Normally 0.0.0.0
    NETMASK=255.255.255.0
    DIALER_SCRIPT=/etc/ppp/chico-dialer6993

    exec /usr/sbin/pppd debug lock modem crtscts /dev/modem 38400 \
             asyncmap 20A0000 escape FF kdebug 0 $LOCAL_IP:$REMOTE_IP \
             noipdefault netmask $NETMASK defaultroute user $USER \
             lcp-max-configure 30 connect $DIALER_SCRIPT

The most noticable addition is the USER environment variable--set this to match your username in pap-secrets.

Of course, you need a /etc/ppp/chico6993-dialer to connect:

    #!/bin/sh
    #
    # This is part 2 of the ppp-on script. It will perform the connection
    # protocol for the desired connection.
    #
    DONE=0
    TELEPHONE=898-6993
    #TELEPHONE=898-6385
    while [ $DONE -eq 0 ]; do
        /usr/sbin/chat                                  \
        TIMEOUT         3                               \
        ABORT           '\nBUSY\r'                      \
        ABORT           '\nNO ANSWER\r'                 \
        ABORT           '\nRINGING\r\n\r\nRINGING\r'    \
        ''              '\rATZ'                         \
        TIMEOUT         30                              \
        OK              ATS11=40                        \
        OK              ATDT$TELEPHONE                  \
        'CONNECT'       '\d\d\n\r'                      \
        login:          ''

        # if not busy, we're done
        if [ $? -ne 4 ]; then
            DONE=1
        fi
    done

As root, run chico6993 and you'll be connected after looping over the busy signal about 50 zillion times.


Author: Brian "Beej" Hall
Date: 12-Sep-1997