Dialup PPP

From OpenBSD-Wiki

Jump to: navigation, search

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 namephilip
Passwordpassword
Dial086755555
Nameserver202.12.123.43

System Info

Modem/dev/cua00
Speed19200

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.

/etc/ppp/options

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.

/etc/ppp/isp.chat

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.

/etc/ppp/pap-secrets

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 make the connection to the ISP, use the command:

pppd 

Recent versions of OpenBSD don't create the ppp device by default. If you get an error saying ppp0 doesn't exist, create the device with

ifconfig ppp0 create

This will be needed after each restart of the system, so consider putting this command in /etc/rc.local or in a script to start ppp.

To drop the connection use the command:

kill `cat /var/run/ppp0.pid `

To check the status of your PPP connection, some useful things to do are:

/sbin/ifconfig ppp0

You can check the log files for messages from PPP.

tail -f /var/log/daemon
Personal tools