Macintosh PowerBook


Apple Macintosh PowerBook G3


How-to
Partition your hard disk
Configure X windows
Configure AfterStep
Make the PowerBook sleep
Set up the modem for PPP
HotSync a Palm Pilot via IrDA
Go wireless!


Links
How to hook up PPP in Linux
More advice from W.G. Unruh

Configuring PPP

There are several steps to get PPP up and running:

Having kernel support
In order to do PPP, you need to have support for it in your kernel by having the following options set in the kernel configuration.
Option Setting    Found under
CONFIG_MAC_SERIAL   y General setup
CONFIG_SERIAL m Character devices
CONFIG_PPP m Network device support


Setting up the modem
The first thing you might want to do is create the modem device /dev/modem by doing:
    ln -s ttyS0 /dev/modem
(That's a zero in ttyS0.) The reason I said "might" is because you don't have to do it: in everything that's below, you can simply use /dev/ttyS0 instead; however, using /dev/modem is clearer and many commands and utilities assume the latter.


Generic PPP options
Create the following files having the contents shown. These two files will be the same regardless of your ISP.
/etc/ppp/options
    /dev/modem
    debug
    defaultroute
    hide-password
    noipdefault

/etc/ppp/options.modem
    57600
    asyncmap 0
    crtscts
    disconnect "/usr/sbin/chat -- \d+++\d\c TIMEOUT 5 OK ATH0 OK"
    lock
    modem
Once you get PPP working reliably, you can take out the debug option.


ISP-specific PPP options
The remaining files will need to be customized for your ISP. (My ISP is pacbell.net, hence the filename of pacbell for my peers file and pacbell.chat for my chat(8) file. choose a filename more appropriate for your ISP.)

Aside from the obvious of replacing phone number, login, and password with your own, you may also need different options in your peers file depending on your ISP. You'll hopefully be able to get some information from their support web pages or staff. If all else fails, experiment.

My ISP, like most ISPs these days, mandates dynamic IP addresses. This configuration assumes that.

/etc/ppp/peers/pacbell

connect "/usr/sbin/chat -v -f /etc/ppp/scripts/pacbell.chat"
mtu 500
name
login
noauth
passive

/etc/ppp/scripts/pacbell.chat

ABORT "BUSY"
ABORT "ERROR"
ABORT "NO ANSWER"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
REPORT CARRIER
REPORT CONNECT
"" \d\d\dATZ TIMEOUT 5
OK AT&C1E1%E2L2M1Q0S0=0V1X4   
OK ATDTphone number TIMEOUT 30
CONNECT \c TIMEOUT 10
ogin:--ogin:    login
assword: password
You can find the complete set of modem AT commands in the AT Commands for the Apple Internal Modem manual.


Configuring the Domain Name Server (DNS)
The last part of the actual configuration is to create the following file for your domain name server:

/etc/resolv.conf

nameserver   name.server.ip.1
nameserver name.server.ip.2
options rotate timeout:15
You need to obtain the your ISP's name server IP addresses from them.


Bringing PPP up and down
Before you can establish a PPP connection, you'll need to have PPP daemon software (pppd) installed. The RPM for it most likely came with your Linux distribution.

To bring the PPP connection up and down, you need a shell script to start and stop the daemon. The following script takes a single command-line argument of either start or stop:
/etc/init.d/pppd
    #! /bin/sh

    . /etc/rc.d/init.d/functions

    rm_files() {
        rm -f /var/lock/LCK*modem /var/run/ppp*.pid
    }
    case "$1" in
        start)
            rm_files
            killall -q dhcpcd
            echo -n "Starting pppd: "
            daemon pppd call pacbell
            echo
            ;;
        stop)
            echo -n "Shutting down pppd: "
            killproc pppd
            rm_files
            echo
            ;;
        *)
            echo "usage: pppd {start|stop}" >&2
            exit 1
            ;;
    esac
The killall -q dhcpcd will kill a DHCP client daemon process, if any, thereby removing a default route it set up. Removing any default route is necessary since, if one already exists, pppd will refuse to replace it with the route to the peer on the other end of the PPP link.

The above script only kicks off the connection sequence: it doesn't wait until the connection has actually been established before returning the command-line prompt. To be notified when the connection has been established, create the following script:
/etc/ppp/ip-up.local
    #! /bin/sh
    echo "ppp up" >/dev/console
(You could alternatively use xmessage instead of echo.) This script is automatically executed by pppd when PPP comes up.


[Personal] [Résumé] [Software] [Contact]
Last updated: November 23, 2001