1 .\" $FreeBSD: src/usr.sbin/pppctl/pppctl.8,v 1.12.2.8 2003/03/11 22:31:30 trhodes Exp $
2 .\" $DragonFly: src/usr.sbin/pppctl/pppctl.8,v 1.2 2003/06/17 04:30:01 dillon Exp $
8 .Nd PPP control program
14 .Xo Oo Ar host : Oc Ns
15 .Ar Port | LocalSocket
19 .Ar command Oo ; Ar command Oc Ar ...
23 This utility provides command line control of the
25 daemon. Its primary use is to facilitate simple scripts that
26 control a running daemon.
30 utility is passed at least one argument, specifying the socket on which
32 is listening. Refer to the
36 for details. If the socket contains a leading '/', it
39 socket. If it contains a colon, it is treated as a
41 pair, otherwise it is treated as a TCP port specification on the
42 local machine (127.0.0.1). Both the
46 may be specified numerically if you wish to avoid a DNS lookup
47 or don't have an entry for the given port in
50 All remaining arguments are concatenated to form the
52 that will be sent to the
54 daemon. If any semi-colon characters are found, they are treated as
56 delimiters, allowing more than one
61 .Bd -literal -offset indent
62 pppctl 3000 set timeout 300\\; show timeout
65 Don't forget to escape or quote the ';' as it is a special character
72 enters interactive mode, where commands are read from standard input.
73 When reading commands, the
75 library is used, allowing command-line editing (with
77 defining editing behaviour). The history size
81 The following command line options are available:
84 Display all data sent to and received from the
88 displays only non-prompt lines received. This option is ignored in
93 instead of the default 2 seconds when connecting. This may be required
94 if you wish to control a daemon over a slow (or even a dialup) link.
96 Specify the password required by the
98 daemon. If this switch is not used,
100 will prompt for a password once it has successfully connected to
110 can be used to automate many frequent tasks (you can actually control
112 in any mode except interactive mode). Use of the
114 option is discouraged (even in scripts that aren't readable by others)
117 listing may reveal your secret.
119 The best way to allow easy, secure
121 access is to create a local server socket in
122 .Pa /etc/ppp/ppp.conf
123 (in the correct section) like this:
124 .Bd -literal -offset indent
125 set server /var/run/internet "" 0177
130 to create a local domain socket, with srw------- permissions and no
131 password, allowing access only to the user that invoked
135 man page for further details.
137 You can now create some easy-access scripts. To connect to the internet:
138 .Bd -literal -offset indent
140 test $# -eq 0 && time=300 || time=$1
141 exec pppctl /var/run/internet set timeout $time\\; dial
145 .Bd -literal -offset indent
147 exec pppctl /var/run/internet set timeout 300\\; close
150 To check if the line is up:
151 .Bd -literal -offset indent
153 pppctl -p '' -v /var/run/internet quit | grep ^PPP >/dev/null
154 if [ $? -eq 0 ]; then
161 You can even make a generic script:
162 .Bd -literal -offset indent
164 exec pppctl /var/run/internet "$@"
169 to control when dial-on-demand works. Suppose you want
171 to run all the time, but you want to prevent dial-out between 8pm and 8am
172 each day. However, any connections active at 8pm should continue to remain
173 active until they are closed or naturally time out.
177 entry for 8pm which runs
178 .Bd -literal -offset indent
179 pppctl /var/run/internet set filter dial 0 deny 0 0
182 will block all further dial requests, and the corresponding 8am entry
183 .Bd -literal -offset indent
184 pppctl /var/run/internet set filter dial -1
187 will allow them again.
189 The following environment variables are understood by
191 when in interactive mode:
192 .Bl -tag -width XXXXXXXXXX
194 The number of history lines. The default is 20.
196 The edit mode. Only values of "emacs" and "vi" are accepted. Other values
197 are silently ignored. This environment variable will override the
213 utility first appeared in