xref: /netbsd-src/external/bsd/ppp/dist/FAQ (revision a619718e42cf7022332d544fd5ec5713434707ac)
1*a619718eSchristosThis is a list of Frequently Asked Questions about using ppp-2.x and
2*a619718eSchristostheir answers.
3*a619718eSchristos
4*a619718eSchristos
5*a619718eSchristos------------------------------------------------------------------------
6*a619718eSchristos
7*a619718eSchristosQ: Can you give me an example of how I might set up my machine to dial
8*a619718eSchristosout to an ISP?
9*a619718eSchristos
10*a619718eSchristosA: Here's an example for dialling out to an ISP via a modem on
11*a619718eSchristos/dev/tty02.  The modem uses hardware (CTS/RTS) flow control, and the
12*a619718eSchristosserial port is run at 38400 baud.  The ISP assigns our IP address.
13*a619718eSchristos
14*a619718eSchristosTo configure pppd for this connection, create a file under
15*a619718eSchristos/etc/ppp/peers called (say) my-isp containing the following:
16*a619718eSchristos
17*a619718eSchristostty02 crtscts 38400
18*a619718eSchristosconnect 'chat -v -f /etc/ppp/chat/my-isp'
19*a619718eSchristosdefaultroute
20*a619718eSchristos
21*a619718eSchristosThe ppp connection is then initiated using the following command:
22*a619718eSchristos
23*a619718eSchristospppd call my-isp
24*a619718eSchristos
25*a619718eSchristosOf course, if the directory containing pppd is not in your path, you
26*a619718eSchristoswill need to give the full pathname for pppd, for example,
27*a619718eSchristos/usr/sbin/pppd.
28*a619718eSchristos
29*a619718eSchristosWhen you run this, pppd will use the chat program to dial the ISP and
30*a619718eSchristosinvoke its ppp service.  Chat will read the file specified with -f,
31*a619718eSchristosnamely /etc/ppp/chat/my-isp, to find a list of strings to expect to
32*a619718eSchristosreceive, and strings to send.  This file would contain something like
33*a619718eSchristosthis:
34*a619718eSchristos
35*a619718eSchristosABORT "NO CARRIER"
36*a619718eSchristosABORT "NO DIALTONE"
37*a619718eSchristosABORT "ERROR"
38*a619718eSchristosABORT "NO ANSWER"
39*a619718eSchristosABORT "BUSY"
40*a619718eSchristosABORT "Username/Password Incorrect"
41*a619718eSchristos"" "at"
42*a619718eSchristosOK "at&d2&c1"
43*a619718eSchristosOK "atdt2479381"
44*a619718eSchristos"name:" "^Uusername"
45*a619718eSchristos"word:" "\qpassword"
46*a619718eSchristos"annex" "\q^Uppp"
47*a619718eSchristos"Switching to PPP-ppp-Switching to PPP"
48*a619718eSchristos
49*a619718eSchristosYou will need to change the details here.  The first string on each
50*a619718eSchristosline is a string to expect to receive; the second is the string to
51*a619718eSchristossend.  You can add or delete lines according to the dialog required to
52*a619718eSchristosaccess your ISP's system.  This example is for a modem with a standard
53*a619718eSchristosAT command set, dialling out to an Annex terminal server.  The \q
54*a619718eSchristostoggles "quiet" mode; when quiet mode is on, the strings to be sent
55*a619718eSchristosare replaced by ?????? in the log.  You may need to go through the
56*a619718eSchristosdialog manually using kermit or tip first to determine what should go
57*a619718eSchristosin the script.
58*a619718eSchristos
59*a619718eSchristosTo terminate the link, run the following script, called (say)
60*a619718eSchristoskill-ppp:
61*a619718eSchristos
62*a619718eSchristos#!/bin/sh
63*a619718eSchristosunit=ppp${1-0}
64*a619718eSchristospiddir=/var/run
65*a619718eSchristosif [ -f $piddir/$unit.pid ]; then
66*a619718eSchristos  kill -1 `cat $piddir/$unit.pid`
67*a619718eSchristosfi
68*a619718eSchristos
69*a619718eSchristosOn some systems (SunOS, Solaris, Ultrix), you will need to change
70*a619718eSchristos/var/run to /etc/ppp.
71*a619718eSchristos
72*a619718eSchristos
73*a619718eSchristos------------------------------------------------------------------------
74*a619718eSchristos
75*a619718eSchristosQ: Can you give me an example of how I could set up my office machine
76*a619718eSchristosso I can dial in to it from home?
77*a619718eSchristos
78*a619718eSchristosA: Let's assume that the office machine is called "office" and is on a
79*a619718eSchristoslocal ethernet subnet.  Call the home machine "home" and give it an IP
80*a619718eSchristosaddress on the same subnet as "office".  We'll require both machines
81*a619718eSchristosto authenticate themselves to each other.
82*a619718eSchristos
83*a619718eSchristosSet up the files on "office" as follows:
84*a619718eSchristos
85*a619718eSchristos/etc/ppp/options contains:
86*a619718eSchristos
87*a619718eSchristosauth		# require the peer to authenticate itself
88*a619718eSchristoslock
89*a619718eSchristos# other options can go here if desired
90*a619718eSchristos
91*a619718eSchristos/etc/ppp/chap-secrets contains:
92*a619718eSchristos
93*a619718eSchristoshome	office	"beware the frub-jub"	home
94*a619718eSchristosoffice	home	"bird, my son!%&*"	-
95*a619718eSchristos
96*a619718eSchristosSet up a modem on a serial port so that users can dial in to the
97*a619718eSchristosmodem and get a login prompt.
98*a619718eSchristos
99*a619718eSchristosOn "home", set up the files as follows:
100*a619718eSchristos
101*a619718eSchristos/etc/ppp/options contains the same as on "office".
102*a619718eSchristos
103*a619718eSchristos/etc/ppp/chap-secrets contains:
104*a619718eSchristos
105*a619718eSchristoshome	office	"beware the frub-jub"	-
106*a619718eSchristosoffice	home	"bird, my son!%&*"	office
107*a619718eSchristos
108*a619718eSchristosCreate a file called /etc/ppp/peers/office containing the following:
109*a619718eSchristos
110*a619718eSchristostty02 crtscts 38400
111*a619718eSchristosconnect 'chat -v -f /etc/ppp/chat/office'
112*a619718eSchristosdefaultroute
113*a619718eSchristos
114*a619718eSchristos(You may need to change some of the details here.)
115*a619718eSchristos
116*a619718eSchristosCreate the /etc/ppp/chat/office file containing the following:
117*a619718eSchristos
118*a619718eSchristosABORT "NO CARRIER"
119*a619718eSchristosABORT "NO DIALTONE"
120*a619718eSchristosABORT "ERROR"
121*a619718eSchristosABORT "NO ANSWER"
122*a619718eSchristosABORT "BUSY"
123*a619718eSchristosABORT "ogin incorrect"
124*a619718eSchristos"" "at"
125*a619718eSchristosOK "at&d2&c1"
126*a619718eSchristosOK "atdt2479381"
127*a619718eSchristos"name:" "^Uusername"
128*a619718eSchristos"word:" "\qpassword"
129*a619718eSchristos"$" "\q^U/usr/sbin/pppd proxyarp"
130*a619718eSchristos"~"
131*a619718eSchristos
132*a619718eSchristosYou will need to change the details.  Note that the "$" in the
133*a619718eSchristossecond-last line is expecting the shell prompt after a successful
134*a619718eSchristoslogin - you may need to change it to "%" or something else.
135*a619718eSchristos
136*a619718eSchristosYou then initiate the connection (from home) with the command:
137*a619718eSchristos
138*a619718eSchristospppd call office
139*a619718eSchristos
140*a619718eSchristos------------------------------------------------------------------------
141*a619718eSchristos
142*a619718eSchristosQ: When I try to establish a connection, the modem successfully dials
143*a619718eSchristosthe remote system, but then hangs up a few seconds later.  How do I
144*a619718eSchristosfind out what's going wrong?
145*a619718eSchristos
146*a619718eSchristosA: There are a number of possible problems here.  The first thing to
147*a619718eSchristosdo is to ensure that pppd's messages are visible.  Pppd uses the
148*a619718eSchristossyslog facility to log messages which help to identify specific
149*a619718eSchristosproblems.  Messages from pppd have facility "daemon" and levels
150*a619718eSchristosranging from "debug" to "error".
151*a619718eSchristos
152*a619718eSchristosUsually it is useful to see messages of level "notice" or higher on
153*a619718eSchristosthe console.  To see these, find the line in /etc/syslog.conf which
154*a619718eSchristoshas /dev/console on the right-hand side, and add "daemon.notice" in
155*a619718eSchristosthe list on the left.  The line will end up looking something like
156*a619718eSchristosthis:
157*a619718eSchristos
158*a619718eSchristos*.err;kern.debug;auth.notice;mail.crit;daemon.notice	/dev/console
159*a619718eSchristos
160*a619718eSchristosNote that the whitespace is tabs, *not* spaces.
161*a619718eSchristos
162*a619718eSchristosIf you are having problems, it may be useful to see messages of level
163*a619718eSchristos"info" as well, in which case you would change "daemon.notice" to
164*a619718eSchristos"daemon.info".
165*a619718eSchristos
166*a619718eSchristosIn addition, it is useful to collect pppd's debugging output in a
167*a619718eSchristosfile - the debug option to pppd causes it to log the contents of all
168*a619718eSchristoscontrol packets sent and received in human-readable form.  To do this,
169*a619718eSchristosadd a line like this to /etc/syslog.conf:
170*a619718eSchristos
171*a619718eSchristosdaemon,local2.debug		/etc/ppp/log
172*a619718eSchristos
173*a619718eSchristosand create an empty /etc/ppp/log file.
174*a619718eSchristos
175*a619718eSchristosWhen you change syslog.conf, you will need to send a HUP signal to
176*a619718eSchristossyslogd to causes it to re-read syslog.conf.  You can do this with a
177*a619718eSchristoscommand like this (as root):
178*a619718eSchristos
179*a619718eSchristos	kill -HUP `cat /etc/syslogd.pid`
180*a619718eSchristos
181*a619718eSchristos(On some systems, you need to use /var/run/syslog.pid instead of
182*a619718eSchristos/etc/syslogd.pid.)
183*a619718eSchristos
184*a619718eSchristosAfter setting up syslog like this, you can use the -v flag to chat and
185*a619718eSchristosthe `debug' option to pppd to get more information.  Try initiating
186*a619718eSchristosthe connection again; when it fails, inspect /etc/ppp/log to see what
187*a619718eSchristoshappened and where the connection failed.
188*a619718eSchristos
189*a619718eSchristos
190*a619718eSchristos------------------------------------------------------------------------
191*a619718eSchristos
192*a619718eSchristosQ: When I try to establish a connection, I get an error message saying
193*a619718eSchristos"Serial link is not 8-bit clean".  Why?
194*a619718eSchristos
195*a619718eSchristosA: The most common cause is that your connection script hasn't
196*a619718eSchristossuccessfully dialled out to the remote system and invoked ppp service
197*a619718eSchristosthere.  Instead, pppd is talking to something (a shell or login
198*a619718eSchristosprocess on the remote machine, or maybe just the modem) which is only
199*a619718eSchristosoutputting 7-bit characters.
200*a619718eSchristos
201*a619718eSchristosThis can also arise with a modem which uses an AT command set if the
202*a619718eSchristosdial command is issued before pppd is invoked, rather than within a
203*a619718eSchristosconnect script started by pppd.  If the serial port is set to 7
204*a619718eSchristosbits/character plus parity when the last AT command is issued, the
205*a619718eSchristosmodem serial port will be set to the same setting.
206*a619718eSchristos
207*a619718eSchristosNote that pppd *always* sets the local serial port to 8 bits per
208*a619718eSchristoscharacter, with no parity and 1 stop bit.  So you shouldn't need to
209*a619718eSchristosissue an stty command before invoking pppd.
210*a619718eSchristos
211*a619718eSchristos
212*a619718eSchristos------------------------------------------------------------------------
213*a619718eSchristos
214*a619718eSchristosQ: When I try to establish a connection, I get an error message saying
215*a619718eSchristos"Serial line is looped back".  Why?
216*a619718eSchristos
217*a619718eSchristosA: Probably your connection script hasn't successfully dialled out to
218*a619718eSchristosthe remote system and invoked ppp service there.  Instead, pppd is
219*a619718eSchristostalking to something which is just echoing back the characters it
220*a619718eSchristosreceives.  The -v option to chat can help you find out what's going
221*a619718eSchristoson.  It can be useful to include "~" as the last expect string to
222*a619718eSchristoschat, so chat won't return until it's seen the start of the first PPP
223*a619718eSchristosframe from the remote system.
224*a619718eSchristos
225*a619718eSchristosAnother possibility is that your phone connection has dropped for some
226*a619718eSchristosobscure reason and the modem is echoing the characters it receives
227*a619718eSchristosfrom your system.
228*a619718eSchristos
229*a619718eSchristos
230*a619718eSchristos------------------------------------------------------------------------
231*a619718eSchristos
232*a619718eSchristosQ: I installed pppd successfully, but when I try to run it, I get a
233*a619718eSchristosmessage saying something like "peer authentication required but no
234*a619718eSchristosauthentication files accessible".
235*a619718eSchristos
236*a619718eSchristosA: When pppd is used on a machine which already has a connection to
237*a619718eSchristosthe Internet (or to be more precise, one which has a default route in
238*a619718eSchristosits routing table), it will require all peers to authenticate
239*a619718eSchristosthemselves.  The reason for this is that if you don't require
240*a619718eSchristosauthentication, you have a security hole, because the peer can
241*a619718eSchristosbasically choose any IP address it wants, even the IP address of some
242*a619718eSchristostrusted host (for example, a host mentioned in some .rhosts file).
243*a619718eSchristos
244*a619718eSchristosOn machines which don't have a default route, pppd does not require
245*a619718eSchristosthe peer to authenticate itself.  The reason is that such machines
246*a619718eSchristoswould mostly be using pppd to dial out to an ISP which will refuse to
247*a619718eSchristosauthenticate itself.  In that case the peer can use any IP address as
248*a619718eSchristoslong as the system does not already have a route to that address.
249*a619718eSchristosFor example, if you have a local ethernet network, the peer can't use
250*a619718eSchristosan address on that network.  (In fact it could if it authenticated
251*a619718eSchristositself and it was permitted to use that address by the pap-secrets or
252*a619718eSchristoschap-secrets file.)
253*a619718eSchristos
254*a619718eSchristosThere are 3 ways around the problem:
255*a619718eSchristos
256*a619718eSchristos1. If possible, arrange for the peer to authenticate itself, and
257*a619718eSchristoscreate the necessary secrets files (/etc/ppp/pap-secrets and/or
258*a619718eSchristos/etc/ppp/chap-secrets).
259*a619718eSchristos
260*a619718eSchristos2. If the peer refuses to authenticate itself, and will always be
261*a619718eSchristosusing the same IP address, or one of a small set of IP addresses, you
262*a619718eSchristoscan create an entry in the /etc/ppp/pap-secrets file like this:
263*a619718eSchristos
264*a619718eSchristos  ""	  *	  ""	  his-ip.his-domain his-other-ip.other-domain
265*a619718eSchristos
266*a619718eSchristos(that is, using the empty string for the client name and password
267*a619718eSchristosfields).  Of couse, you replace the 4th and following fields in the
268*a619718eSchristosexample above with the IP address(es) that the peer may use.  You can
269*a619718eSchristosuse either hostnames or numeric IP addresses.
270*a619718eSchristos
271*a619718eSchristos3. You can add the `noauth' option to the /etc/ppp/options file.
272*a619718eSchristosPppd will then not ask the peer to authenticate itself.  If you do
273*a619718eSchristosthis, I *strongly* recommend that you remove the set-uid bit from the
274*a619718eSchristospermissions on the pppd executable, with a command like this:
275*a619718eSchristos
276*a619718eSchristos	chmod u-s /usr/sbin/pppd
277*a619718eSchristos
278*a619718eSchristosThen, an intruder could only use pppd maliciously if they had already
279*a619718eSchristosbecome root, in which case they couldn't do any more damage using pppd
280*a619718eSchristosthan they could anyway.
281*a619718eSchristos
282*a619718eSchristos
283*a619718eSchristos------------------------------------------------------------------------
284*a619718eSchristos
285*a619718eSchristosQ: What do I need to put in the secrets files?
286*a619718eSchristos
287*a619718eSchristosA: Three things:
288*a619718eSchristos   - secrets (i.e. passwords) to use for authenticating this host to
289*a619718eSchristos     other hosts (i.e., for proving our identity to others);
290*a619718eSchristos   - secrets which other hosts can use for authenticating themselves
291*a619718eSchristos     to us (i.e., so that they can prove their identity to us); and
292*a619718eSchristos   - information about which IP addresses other hosts may use, once
293*a619718eSchristos     they have authenticated themselves.
294*a619718eSchristos
295*a619718eSchristosThere are two authentication files: /etc/ppp/pap-secrets, which
296*a619718eSchristoscontains secrets for use with PAP (the Password Authentication
297*a619718eSchristosProtocol), and /etc/ppp/chap-secrets, which contains secrets for use
298*a619718eSchristoswith CHAP (the Challenge Handshake Authentication Protocol).  Both
299*a619718eSchristosfiles have the same simple format, which is as follows:
300*a619718eSchristos
301*a619718eSchristos- The file contains a series of entries, each of which contains a
302*a619718eSchristossecret for authenticating one machine to another.
303*a619718eSchristos
304*a619718eSchristos- Each entry is contained on a single logical line.  A logical line
305*a619718eSchristosmay be continued across several lines by placing a backslash (\) at
306*a619718eSchristosthe end of each line except the last.
307*a619718eSchristos
308*a619718eSchristos- Each entry has 3 or more fields, separated by whitespace (spaces
309*a619718eSchristosand/or tabs).  These fields are, in order:
310*a619718eSchristos	* The name of the machine that is authenticating itself
311*a619718eSchristos	  (the "client").
312*a619718eSchristos	* The name of the machine that is authenticating the client
313*a619718eSchristos	  (the "server").
314*a619718eSchristos	* The secret to be used for authenticating that client to that
315*a619718eSchristos	  server.  If this field begins with the at-sign `@', the rest
316*a619718eSchristos	  of the field is taken as the name of a file containing the
317*a619718eSchristos	  actual secret.
318*a619718eSchristos	* The 4th and any following fields list the IP address(es)
319*a619718eSchristos	  that the client may use.
320*a619718eSchristos
321*a619718eSchristos- The file may contain comments, which begin with a `#' and continue
322*a619718eSchristosto the end of the line.
323*a619718eSchristos
324*a619718eSchristos- Double quotes `"' should be used around a field if it contains
325*a619718eSchristoscharacters with special significance, such as space, tab, `#', etc.
326*a619718eSchristos
327*a619718eSchristos- The backslash `\' may be used before characters with special
328*a619718eSchristossignificance (space, tab, `#', `\', etc.) to remove that significance.
329*a619718eSchristos
330*a619718eSchristosSome important points to note:
331*a619718eSchristos
332*a619718eSchristos* A machine can be *both* a "client" and a "server" for the purposes
333*a619718eSchristosof authentication - this happens when both peers require the other to
334*a619718eSchristosauthenticate itself.  So A would authenticate itself to B, and B would
335*a619718eSchristosalso authenticate itself to A (possibly using a different
336*a619718eSchristosauthentication protocol).
337*a619718eSchristos
338*a619718eSchristos* If both the "client" and the "server" are running ppp-2.x, they need
339*a619718eSchristosto have a similar entry in the appropriate secrets file; the first two
340*a619718eSchristosfields are *not* swapped on the client, compared to the server.  So
341*a619718eSchristosthe client might have an entry like this:
342*a619718eSchristos
343*a619718eSchristos	ay	bee	"our little secret"	-
344*a619718eSchristos
345*a619718eSchristosand the corresponding entry on the server could look like this:
346*a619718eSchristos
347*a619718eSchristos	ay	bee	"our little secret"	123.45.67.89
348*a619718eSchristos
349*a619718eSchristos
350*a619718eSchristos------------------------------------------------------------------------
351*a619718eSchristos
352*a619718eSchristosQ: Explain about PAP and CHAP?
353*a619718eSchristos
354*a619718eSchristosPAP stands for the Password Authentication Protocol.  With this
355*a619718eSchristosprotocol, the "client" (the machine that needs to authenticate itself)
356*a619718eSchristossends its name and a password, in clear text, to the "server".  The
357*a619718eSchristosserver returns a message indicating whether the name and password are
358*a619718eSchristosvalid.
359*a619718eSchristos
360*a619718eSchristosCHAP stands for the Challenge Handshake Authentication Protocol.  It
361*a619718eSchristosis designed to address some of the deficiencies and vulnerabilities of
362*a619718eSchristosPAP.  Like PAP, it is based on the client and server having a shared
363*a619718eSchristossecret, but the secret is never passed in clear text over the link.
364*a619718eSchristosInstead, the server sends a "challenge" - an arbitrary string of
365*a619718eSchristosbytes, and the client must prove it knows the shared secret by
366*a619718eSchristosgenerating a hash value from the challenge combined with the shared
367*a619718eSchristossecret, and sending the hash value back to the server.  The server
368*a619718eSchristosalso generates the hash value and compares it with the value received
369*a619718eSchristosfrom the client.
370*a619718eSchristos
371*a619718eSchristosAt a practical level, CHAP can be slightly easier to configure than
372*a619718eSchristosPAP because the server sends its name with the challenge.  Thus, when
373*a619718eSchristosfinding the appropriate secret in the secrets file, the client knows
374*a619718eSchristosthe server's name.  In contrast, with PAP, the client has to find its
375*a619718eSchristospassword (i.e. the shared secret) before it has received anything from
376*a619718eSchristosthe server.  Thus, it may be necessary to use the `remotename' option
377*a619718eSchristosto pppd when using PAP authentication so that it can select the
378*a619718eSchristosappropriate secret from /etc/ppp/pap-secrets.
379*a619718eSchristos
380*a619718eSchristosMicrosoft also has a variant of CHAP which uses a different hashing
381*a619718eSchristosarrangement from normal CHAP.  There is a client-side (authenticatee)
382*a619718eSchristosimplementation of Microsoft's CHAP in ppp-2.3; see README.MSCHAP80.
383*a619718eSchristosIn ppp-2.4.2, server-side (authenticator) support was added as well as
384*a619718eSchristossupport for Microsoft CHAP v2; see README.MSCHAP81.
385*a619718eSchristos
386*a619718eSchristos
387*a619718eSchristos------------------------------------------------------------------------
388*a619718eSchristos
389*a619718eSchristosQ: When the modem hangs up, without the remote system having
390*a619718eSchristosterminated the connection properly, pppd does not notice the hangup,
391*a619718eSchristosbut just keeps running.  How do I get pppd to notice the hangup and
392*a619718eSchristosexit?
393*a619718eSchristos
394*a619718eSchristosA: Pppd detects modem hangup by looking for an end-of-file indication
395*a619718eSchristosfrom the serial driver, which should be generated when the CD (carrier
396*a619718eSchristosdetect) signal on the serial port is deasserted.  For this to work:
397*a619718eSchristos
398*a619718eSchristos- The modem has to be set to assert CD when the connection is made and
399*a619718eSchristosdeassert it when the phone line hangs up.  Usually the AT&C1 modem
400*a619718eSchristoscommand sets this mode.
401*a619718eSchristos
402*a619718eSchristos- The cable from the modem to the serial port must connect the CD
403*a619718eSchristossignal (on pin 8).
404*a619718eSchristos
405*a619718eSchristos- Some serial drivers have a "software carrier detect" mode, which
406*a619718eSchristosmust be *disabled*.  The method of doing this varies between systems.
407*a619718eSchristosUnder SunOS, use the ttysoftcar command.  Under NetBSD, edit /etc/ttys
408*a619718eSchristosto remove the "softcar" flag from the line for the serial port, and
409*a619718eSchristosrun ttyflags.
410*a619718eSchristos
411*a619718eSchristos
412*a619718eSchristos------------------------------------------------------------------------
413*a619718eSchristos
414*a619718eSchristosQ: Why should I use PPP compression (BSD-Compress or Deflate) when my
415*a619718eSchristosmodem already does V.42 compression?  Won't it slow the CPU down a
416*a619718eSchristoslot?
417*a619718eSchristos
418*a619718eSchristosA: Using PPP compression is preferable, especially when using modems
419*a619718eSchristosover phone lines, for the following reasons:
420*a619718eSchristos
421*a619718eSchristos- The V.42 compression in the modem isn't very strong - it's an LZW
422*a619718eSchristostechnique (same as BSD-Compress) with a 10, 11 or 12 bit code size.
423*a619718eSchristosWith BSD-Compress you can use a code size of up to 15 bits and get
424*a619718eSchristosmuch better compression, or you can use Deflate and get even better
425*a619718eSchristoscompression ratios.
426*a619718eSchristos
427*a619718eSchristos- I have found that enabling V.42 compression in my 14.4k modem
428*a619718eSchristosincreases the round-trip time for a character to be sent, echoed and
429*a619718eSchristosreturned by around 40ms, from 160ms to 200ms (with error correction
430*a619718eSchristosenabled).  This is enough to make it feel less responsive on rlogin or
431*a619718eSchristostelnet sessions.  Using PPP compression adds less than 5ms (small
432*a619718eSchristosenough that I couldn't measure it reliably).  I admit my modem is a
433*a619718eSchristoscheapie and other modems may well perform better.
434*a619718eSchristos
435*a619718eSchristos- While compression and decompression do require some CPU time, they
436*a619718eSchristosreduce the amount of time spent in the serial driver to transmit a
437*a619718eSchristosgiven amount of data.  Many machines require an interrupt for each
438*a619718eSchristoscharacter sent or received, and the interrupt handler can take a
439*a619718eSchristossignificant amount of CPU time.  So the increase in CPU load isn't as
440*a619718eSchristosgreat as you might think.  My measurements indicate that a system with
441*a619718eSchristosa 33MHz 486 CPU should be able to do Deflate compression for serial
442*a619718eSchristoslink speeds of up to 100kb/s or more.  It depends somewhat on the type
443*a619718eSchristosof data, of course; for example, when compressing a string of nulls
444*a619718eSchristoswith Deflate, it's hard to get a high output data rate from the
445*a619718eSchristoscompressor, simply because it compresses strings of nulls so well that
446*a619718eSchristosit has to eat a very large amount of input data to get each byte of
447*a619718eSchristosoutput.
448*a619718eSchristos
449*a619718eSchristos
450*a619718eSchristos------------------------------------------------------------------------
451*a619718eSchristos
452*a619718eSchristosQ: I get messages saying "Unsupported protocol (...) received".  What do
453*a619718eSchristosthese mean?
454*a619718eSchristos
455*a619718eSchristosA: If you only get one or two when pppd starts negotiating with the
456*a619718eSchristospeer, they mean that the peer wanted to negotiate some PPP protocol
457*a619718eSchristosthat pppd doesn't understand.  This doesn't represent a problem, it
458*a619718eSchristossimply means that there is some functionality that the peer supports
459*a619718eSchristosthat pppd doesn't, so that functionality can't be used.
460*a619718eSchristos
461*a619718eSchristosIf you get them sporadically while the link is operating, or if the
462*a619718eSchristosprotocol numbers (in parentheses) don't correspond to any valid PPP
463*a619718eSchristosprotocol that the peer might be using, then the problem is probably
464*a619718eSchristosthat characters are getting corrupted on the receive side, or that
465*a619718eSchristosextra characters are being inserted into the receive stream somehow.
466*a619718eSchristosIf this is happening, most packets that get corrupted should get
467*a619718eSchristosdiscarded by the FCS (Frame Check Sequence, a 16-bit CRC) check, but a
468*a619718eSchristossmall number may get through.
469*a619718eSchristos
470*a619718eSchristosOne possibility may be that you are receiving broadcast messages on
471*a619718eSchristosthe remote system which are being sent over your serial link.  Another
472*a619718eSchristospossibility is that your modem is set for XON/XOFF (software) flow
473*a619718eSchristoscontrol and is inserting ^Q and ^S characters into the receive data
474*a619718eSchristosstream.
475*a619718eSchristos
476*a619718eSchristos
477*a619718eSchristos------------------------------------------------------------------------
478*a619718eSchristos
479*a619718eSchristosQ: I get messages saying "Protocol-Reject for unsupported protocol ...".
480*a619718eSchristosWhat do these mean?
481*a619718eSchristos
482*a619718eSchristosA: This is the other side of the previous question.  If characters are
483*a619718eSchristosgetting corrupted on the way to the peer, or if your system is
484*a619718eSchristosinserting extra bogus characters into the transmit data stream, the
485*a619718eSchristospeer may send protocol-reject messages to you, resulting in the above
486*a619718eSchristosmessage (since your pppd doesn't recognize the protocol number
487*a619718eSchristoseither.)
488*a619718eSchristos
489*a619718eSchristos
490*a619718eSchristos------------------------------------------------------------------------
491*a619718eSchristos
492*a619718eSchristosQ: I get a message saying something like "ioctl(TIOCSETD): Operation
493*a619718eSchristosnot permitted".  How do I fix this?
494*a619718eSchristos
495*a619718eSchristosA: This is because pppd is not running as root.  If you have not
496*a619718eSchristosinstalled pppd setuid-root, you will have to be root to run it.  If
497*a619718eSchristosyou have installed pppd setuid-root and you still get this message, it
498*a619718eSchristosis probably because your shell is using some other copy of pppd than
499*a619718eSchristosthe installed one - for example, if you are in the pppd directory
500*a619718eSchristoswhere you've just built pppd and your $PATH has . before /usr/sbin (or
501*a619718eSchristoswherever pppd gets installed).
502*a619718eSchristos
503*a619718eSchristos
504*a619718eSchristos------------------------------------------------------------------------
505*a619718eSchristos
506*a619718eSchristosQ: Has your package been ported to HP/UX or IRIX or AIX?
507*a619718eSchristos
508*a619718eSchristosA: No.  I don't have access to systems running HP/UX or AIX.  No-one
509*a619718eSchristoshas volunteered to port it to HP/UX.  I had someone who did a port for
510*a619718eSchristosAIX 4.x, but who is no longer able to maintain it.  And apparently AIX
511*a619718eSchristos3.x is quite different, so it would need a separate port.
512*a619718eSchristos
513*a619718eSchristosIRIX includes a good PPP implementation in the standard distribution,
514*a619718eSchristosas far as I know.
515*a619718eSchristos
516*a619718eSchristos
517*a619718eSchristos------------------------------------------------------------------------
518*a619718eSchristos
519*a619718eSchristosQ: Under SunOS 4, when I try to modload the ppp modules, I get the
520*a619718eSchristosmessage "can't open /dev/vd: No such device".
521*a619718eSchristos
522*a619718eSchristosA: First check in /dev that there is an entry like this:
523*a619718eSchristos
524*a619718eSchristoscrw-r--r--  1  root         57,   0 Oct 2  1991 vd
525*a619718eSchristos
526*a619718eSchristosIf not, make one (mknod /dev/vd c 57 0).  If the problem still exists,
527*a619718eSchristosprobably your kernel has been configured without the vd driver
528*a619718eSchristosincluded.  The vd driver is needed for loadable module support.
529*a619718eSchristos
530*a619718eSchristosFirst, identify the config file that was used.  When you boot your
531*a619718eSchristosmachine, or if you run /etc/dmesg, you'll see a line that looks
532*a619718eSchristossomething like this:
533*a619718eSchristos
534*a619718eSchristosSunOS Release 4.1.3_U1 (CAP_XBOX) #7: Thu Mar 21 15:31:56 EST 1996
535*a619718eSchristos			^^^^^^^^
536*a619718eSchristos			this is the config file name
537*a619718eSchristos
538*a619718eSchristosThe config file will be in the /sys/`arch -k`/conf directory (arch -k
539*a619718eSchristosshould return sun4m for a SparcStation 10, sun3x for a Sun 3/80,
540*a619718eSchristosetc.).  Look in there for a line saying "options VDDRV".  If that line
541*a619718eSchristosisn't present (or is commented out), add it (or uncomment it).
542*a619718eSchristos
543*a619718eSchristosYou then need to rebuild the kernel as described in the SunOS
544*a619718eSchristosmanuals.  Basically you need to run config and make like this:
545*a619718eSchristos
546*a619718eSchristos	/usr/etc/config CAP_XBOX
547*a619718eSchristos	cd ../CAP_XBOX
548*a619718eSchristos	make
549*a619718eSchristos
550*a619718eSchristos(replacing the string CAP_XBOX by the name of the config file for your
551*a619718eSchristoskernel, of course).
552*a619718eSchristos
553*a619718eSchristosThen copy the new kernel to /:
554*a619718eSchristos
555*a619718eSchristos	mv /vmunix /vmunix.working
556*a619718eSchristos	cp vmunix /
557*a619718eSchristos
558*a619718eSchristosand reboot.  Modload should then work.
559*a619718eSchristos
560*a619718eSchristos
561*a619718eSchristos------------------------------------------------------------------------
562*a619718eSchristos
563*a619718eSchristosQ: I'm running Linux (or NetBSD or FreeBSD), and my system comes with
564*a619718eSchristosPPP already.  Should I consider installing this package?  Why?
565*a619718eSchristos
566*a619718eSchristosA: The PPP that is already installed in your system is (or is derived
567*a619718eSchristosfrom) some version of this PPP package.  You can find out what version
568*a619718eSchristosof this package is already installed with the command "pppd --help".
569*a619718eSchristosIf this is older than the latest version, you may wish to install the
570*a619718eSchristoslatest version so that you can take advantage of the new features or
571*a619718eSchristosbug fixes.
572*a619718eSchristos
573*a619718eSchristos
574*a619718eSchristos------------------------------------------------------------------------
575*a619718eSchristos
576*a619718eSchristosQ: I'm running pppd in demand mode, and I find that pppd often dials
577*a619718eSchristosout unnecessarily when I try to make a connection within my local
578*a619718eSchristosmachine or with a machine on my local LAN.  What can I do about this?
579*a619718eSchristos
580*a619718eSchristosA: Very often the cause of this is that a program is trying to contact
581*a619718eSchristosa nameserver to resolve a hostname, and the nameserver (specified in
582*a619718eSchristos/etc/resolv.conf, usually) is on the far side of the ppp link.  You
583*a619718eSchristoscan try executing a command such as `ping myhost' (where myhost is the
584*a619718eSchristosname of the local machine, or some other machine on a local LAN), to
585*a619718eSchristossee whether that starts the ppp link.  If it does, check the setup of
586*a619718eSchristosyour /etc/hosts file to make sure you have the local machine and any
587*a619718eSchristoshosts on your local LAN listed, and /etc/resolv.conf and/or
588*a619718eSchristos/etc/nsswitch.conf files to make sure you resolve hostnames from
589*a619718eSchristos/etc/hosts if possible before trying to contact a nameserver.
590*a619718eSchristos
591*a619718eSchristos
592*a619718eSchristos------------------------------------------------------------------------
593*a619718eSchristos
594*a619718eSchristosQ: Since I installed ppp-2.3.6, dialin users to my server have been
595*a619718eSchristosgetting this message when they run pppd:
596*a619718eSchristos
597*a619718eSchristospeer authentication required but no suitable secret(s) found for
598*a619718eSchristosauthenticating any peer to us (ispserver)
599*a619718eSchristos
600*a619718eSchristosA: In 2.3.6, the default is to let an unauthenticated peer only use IP
601*a619718eSchristosaddresses to which the machine doesn't already have a route.  So on a
602*a619718eSchristosmachine with a default route, everyone has to authenticate.  If you
603*a619718eSchristosreally don't want that, you can put `noauth' in the /etc/ppp/options
604*a619718eSchristosfile.  Note that there is then no check on who is using which IP
605*a619718eSchristosaddress.  IMHO, this is undesirably insecure, but I guess it may be
606*a619718eSchristostolerable as long as you don't use any .rhosts files or anything like
607*a619718eSchristosthat.  I recommend that you require dialin users to authenticate, even
608*a619718eSchristosif just with PAP using their login password (using the `login' option
609*a619718eSchristosto pppd).  If you do use `noauth', you should at least have a pppusers
610*a619718eSchristosgroup and set the permissions on pppd to allow only user and group to
611*a619718eSchristosexecute it.
612*a619718eSchristos
613*a619718eSchristos------------------------------------------------------------------------
614*a619718eSchristos
615*a619718eSchristosQ: When running pppd as a dial-in server, I often get the message
616*a619718eSchristos"LCP: timeout sending Config-Requests" from pppd.  It seems to be
617*a619718eSchristosrandom, but dial-out always works fine.  What is wrong?
618*a619718eSchristos
619*a619718eSchristosA: Most modern modems auto-detects the speed of the serial line
620*a619718eSchristosbetween the modem and the computer.  This auto-detection occurs when
621*a619718eSchristosthe computer sends characters to the modem, when the modem is in
622*a619718eSchristoscommand mode.  It does not occur when the modem is in data mode.
623*a619718eSchristosThus, if you send commands to the modem at 2400 bps, and then change
624*a619718eSchristosthe serial port speed to 115200 bps, the modem will not detect this
625*a619718eSchristoschange until something is transmitted from the computer to the modem.
626*a619718eSchristosWhen running pppd in dial-in mode (i.e. without a connect script),
627*a619718eSchristospppd sets the speed of the serial port, but does not transmit
628*a619718eSchristosanything.  If the modem was already running at the specified speed,
629*a619718eSchristoseverything is fine, but if not, you will just receive garbage from the
630*a619718eSchristosmodem.  To cure this, use an init script such as the following:
631*a619718eSchristos
632*a619718eSchristos	pppd ttyS0 115200 modem crtscts init "chat '' AT OK"
633*a619718eSchristos
634*a619718eSchristosTo reset the modem and enable auto-answer, use:
635*a619718eSchristos
636*a619718eSchristos	pppd ttyS0 115200 modem crtscts init "chat '' ATZ OK ATS0=1 OK"
637