![]() |
|
![]() |
Let's just assume that you are running release 4.X of FreeBSD [or perhaps 2.X of OpenBSD] and you are using an external modem connected to a serial port. Believe me, the relief of not having to trouble with PnP or PCI modem cards is worth the extra money on the modem. It is always possible that in the past year there has been some improvement on modem detection, but I wouldn't know.
I will also assume you are running with the default kernel, which already has the ppp option compiled into it. If you're running with a modified kernel, you probably don't need this. I repeat for those new to FreeBSD, the default kernel has ppp already built in.
If you want a thorough introduction to running ppp on FreeBSD I recommend the FreeBSD Handbook If you want to get fancy then I strongly suggest the Pedantic PPP Primer. On most (i.e. default) FreeBSD installs, copies of the documents can be found in your /usr/share/doc/ directory.
There are a lot of different PPP configurations supported by FreeBSD, single dial, daemon dial, demand dialing. For the rest of this document I'm going to tell you what I do, and you can generalize it from there.
As root, edit these configuration files:
- /etc/resolv.conf
- /etc/group
- /etc/ppp/ppp.conf
- /etc/ppp/ppp.linkup
resolv.conf
Edit this file to look like this:domain eskimo.com #
nameserver 204.122.16.8
nameserver 204.122.16.9
/etc/group
Add users to the network group:
Default permissions allow only root
and the network group to start ppp
network:*:alice,bob,carol
/etc/ppp/ppp.conf
Use this template, which is a demand style configuration
Note: If PPPLOGIN contains a punctuation like an '@' sign, you must escape it with a '\' (ie. "foo\@usb.com"). Also, some lines here might be wrapped in your browser, they should not wrap in the configuration files.
- PPPLOGIN is your PPP account login name
- PPPPASSWD is your PPP account password
- DIALNUMBER is your local access number
- timeout is set to 400 secs of idle
- only alice, bob are permitted to use ppp
- /dev/cuaa1 is the modem port
default: allow users alice bob carol set device /dev/cuaa1 set log Phase Chat LCP IPCP CCP tun command set speed 115200 set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 15 \"\" AT&F&C1&D2 OK-AT-OK ATE1Q0 OK \\dATDT\\T TIMEOUT 40 CONNECT" set redial 3 10 demand: set phone DIALNUMBER set login "TIMEOUT 10 ogin:--ogin: PPPLOGIN word: PPPPASSWD" set timeout 400 set openmode active set ifaddr 10.1.1.127/0 10.2.2.127/0 255.255.255.0 0.0.0.0 add 0 0 10.2.2.127
/etc/ppp/ppp.linkup
Edit the file to look like:
demand: # configuration must delete routes first delete ALL add 0 0 HISADDR MYADDR: # for non-demand configurations add 0 0 HISADDRLogs are usually kept in /var/log/messages (readable only by root). The permissions on the /etc/ppp/ppp.conf is typically set to 600. It is probably a good idea to do this.
That's it! You are all set up now. If you are alice or bob or root you can connect by executing:
/usr/sbin/ppp -auto demand To start the ppp daemon in the background or you can add a line like this to your /etc/rc.local file (or make one if you need to):
su -m ripper -c "ppp -auto -quiet demand" and the daemon will get activated at bootup. To see if it works try
ssh eskimo.com (Note: in -auto mode, dialing commences with your first net access.)
BSD Daemon Copyright © 1988 by Marshall Kirk McKusick. All rights reserved.
Usage permission granted by the owner with rules posted on his site, http://www.mckusick.com/beastie/mainpage/copyright.html.