To get ppp going you will need to know the port name to use, and some basic information from the ISP.
| Basic Info from ISP | |
|---|---|
| Account name | philip |
| Password | password |
| Dial | 086755555 |
| Nameserver | 202.12.123.43 |
| System Info | |
|---|---|
| Modem | /dev/cua00 |
| Speed | 19200 |
Use 19200 as the connect speed to get things working. After succesful connections have been made, this speed can be raised to whatever your modem supports. Remember that PC compatable systems only support limited speeds, refer to the pccom man page for details.
Needs the device name of the modem, the speed to connect at, and the name of the account with the ISP.
/dev/cua00 19200 defaultroute lock noipdefault persist name philip connect "/usr/sbin/chat -v -f /etc/ppp/isp.chat"
The defaultroute setting actually sends the traffic out the modem once the connection is up. Lock sets a lock on the serial port so other programs know it's in use. Noipdefault allows the ppp daemon to negotiate the IP address with the ISP. The ISP will normally assign an IP when the connection is made. Persist keeps the connection up. If the connection goes down for any reason, the PPP daemon will redial and attempt to get it back going. Useful if you get a lot of droputs.
The 'name' option is needed by the ISP. By default ppp uses the hostname of your computer. The 'name' option sends the account name.
The chat script is called by the last line.
Needs the phone number of the ISP.
ABORT "NO CARRIER" ABORT "NO DIALTONE" ABORT "ERROR" ABORT "NO ANSWER" ABORT "BUSY" "" "at" OK "at&d0&c1" OK atdt086755555 CONNECT ""
The chat script dials the number of the ISP, then waits for CONNECT. If you don't wait for the CONNECT, the ppp daemon will exit because it doesn't have carrier.
Needs the account name and password for the ISP.
# Secrets for authentication using PAP # client server secret IP addresses philip * password *
The pap-secrets file is where the account and password details are kept. It uses 'philip' and 'password' for any server and any IP address.
To allow a user to start a ppp connection, add them to the network group. e.g.
sudo user mod -G network philip
Make the serial device read/write by the network group.
sudo chgrp network /dev/cua00 sudo chmod g+rw /dev/cua00
Ensure all the ppp config files in /etc/ppp are readable by the network group.
sudo chgrp network /etc/ppp/* sudo chmod g+r /etc/ppp/*
To make the connection to the ISP, use the command pppd.
To drop the connection use the command kill `cat /var/run/ppp0.pid `
A simple program can be used to manage this ppp daemon. With this script in /usr/local/bin/dialup you can start and stop the ppp connection.
#! /bin/sh
case $1 in
start )
pppd
;;
stop )
kill `cat /var/run/ppp0.pid`
;;
info )
ifconfig ppp0
;;
* )
echo usage $0 start\|stop\|info
;;
esac
Philip Plane <philip@xinqu.net>