]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - usr.sbin/sliplogin/sliplogin.8
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / usr.sbin / sliplogin / sliplogin.8
1 .\" Copyright (c) 1990, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 4. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)sliplogin.8 8.2 (Berkeley) 1/5/94
29 .\" $FreeBSD$
30 .\"
31 .Dd January 5, 1994
32 .Dt SLIPLOGIN 8
33 .Os
34 .Sh NAME
35 .Nm sliplogin
36 .Nd attach a serial line network interface
37 .Sh SYNOPSIS
38 .Nm
39 .Op Ar loginname Op Ar device
40 .Sh DESCRIPTION
41 The
42 .Nm
43 utility is used to turn the terminal line on standard input (or
44 .Ar device )
45 into a Serial Line IP
46 .Pq Tn SLIP
47 link to a remote host.
48 To do this, the program
49 searches the file
50 .Pa /etc/sliphome/slip.hosts
51 for an entry matching
52 .Ar loginname
53 (which defaults to the current login name if omitted).
54 If a matching entry is found, the line is configured appropriately
55 for slip (8-bit transparent i/o) and converted to
56 .Tn SLIP
57 line discipline using the optional line discipline parameters.
58 .Pp
59 The optional line discipline parameters consist of one or more of
60 the following;
61 .Sq normal ,
62 .Sq compress ,
63 .Sq noicmp ,
64 or
65 .Sq autocomp
66 which correspond respectively to
67 .Sq use normal line discipline
68 (no header compression),
69 .Sq enable VJ header compression ,
70 .Sq throw away ICMP packets ,
71 and
72 .Sq auto enable VJ header compression
73 (only if the remote end of the link also supports it).
74 .Pp
75 Then a shell script is invoked to initialize the slip
76 interface with the appropriate local and remote
77 .Tn IP
78 address,
79 netmask, etc.
80 .Pp
81 The usual initialization script is
82 .Pa /etc/sliphome/slip.login
83 but, if particular hosts need special initialization, the file
84 .Pa /etc/sliphome/slip.login. Ns Ar loginname
85 will be executed instead if it exists.
86 The script is invoked with the parameters
87 .Bl -tag -width slipunit
88 .It Em slipunit
89 The unit number of the slip interface assigned to this line.
90 E.g.,
91 .Sy 0
92 for
93 .Sy sl0 .
94 .It Em speed
95 The speed of the line.
96 .It Em args
97 The arguments from the
98 .Pa /etc/sliphome/slip.hosts
99 entry, in order starting with
100 .Ar loginname .
101 .El
102 .Pp
103 Only the super-user may attach a network interface.
104 The interface is
105 automatically detached when the other end hangs up or the
106 .Nm
107 process dies.
108 If the kernel slip
109 module has been configured for it, all routes through that interface will
110 also disappear at the same time.
111 If there is other processing a site
112 would like done on hangup, the file
113 .Pa /etc/sliphome/slip.logout
114 or
115 .Pa /etc/sliphome/slip.logout. Ns Ar loginname
116 is executed if it exists.
117 It is given the same arguments as the login script.
118 .Ss Format of /etc/sliphome/slip.hosts
119 Comments (lines starting with a `#') and blank lines (or started
120 with space) are ignored.
121 Other lines must start with a
122 .Ar loginname
123 but the remaining arguments can be whatever is appropriate for the
124 .Pa slip.login
125 file that will be executed for that name.
126 Arguments are separated by white space and follow normal
127 .Xr sh 1
128 quoting conventions (however,
129 .Ar loginname
130 cannot be quoted).
131 Usually, lines have the form
132 .Bd -literal -offset indent
133 loginname local-address remote-address netmask opt-args
134 .Ed
135 .Pp
136 where
137 .Em local-address
138 and
139 .Em remote-address
140 are the IP host names or addresses of the local and remote ends of the
141 slip line and
142 .Em netmask
143 is the appropriate IP netmask.
144 These arguments are passed
145 directly to
146 .Xr ifconfig 8 .
147 .Em Opt-args
148 are optional arguments used to configure the line.
149 .Sh FreeBSD Additions
150 An additional SLIP configuration file (if present) is
151 .Pa /etc/sliphome/slip.slparms .
152 If particular hosts need different configurations, the file
153 .Pa /etc/sliphome/slip.slparms. Ns Ar loginname
154 will be parsed instead if it exists.
155 .Ss Format of /etc/sliphome/slip.slparms*
156 Comments (lines starting with a `#') and blank lines (or started with
157 space) are ignored.
158 This file contains from one to three numeric parameters separated with spaces,
159 in order:
160 .Ar keepalive ,
161 .Ar outfill
162 and
163 .Ar slunit .
164 .Bl -tag -width keepalive
165 .It Ar keepalive
166 Set SLIP "keep alive" timeout in seconds.
167 If FRAME_END is not received in
168 this amount of time,
169 .Nm
170 closes the line and exits.
171 The default value is no timeout (zero).
172 .It Ar outfill
173 Set SLIP "out fill" timeout in seconds.
174 It forces at least one FRAME_END
175 to be sent during this time period, which is necessary for the "keep alive"
176 timeout on the remote side.
177 The default value is no timeout (zero).
178 .It Ar slunit
179 Set the SLIP unit number directly.
180 Use with caution, because no check is made
181 for two interfaces with same number.
182 By default sliplogin dynamically assigns the unit number.
183 .El
184 .Pp
185 If latter two parameters are omitted, they will not affect the
186 corresponding SLIP configuration.
187 If any of first two parameters is equal to zero, it will not affect
188 the corresponding SLIP configuration.
189 .Sh FILES
190 .Bl -tag -width indent
191 .It Pa /etc/sliphome/slip.hosts
192 list of host login names and parameters.
193 .It Pa /etc/sliphome/slip.login
194 script executed when a connection is made.
195 .It Pa /etc/sliphome/slip.login. Ns Ar loginname
196 script executed when a connection is made by
197 .Ar loginname .
198 .It Pa /etc/sliphome/slip.logout
199 script executed when a connection is lost.
200 .It Pa /etc/sliphome/slip.logout. Ns Ar loginname
201 script executed when a connection is lost by
202 .Ar loginname .
203 .It Pa /etc/sliphome/slip.slparms
204 extra parameters file.
205 .It Pa /etc/sliphome/slip.slparms. Ns Ar loginname
206 extra parameters file for
207 .Ar loginname .
208 .It Pa /var/run/ Ns Ar ttyXn Ns Pa .if
209 contains the name of the network interface used by the sliplogin process on
210 .Ar ttyXn .
211 .It Pa /var/run/ Ns Ar slX Ns Pa .pid
212 contains the PID of the sliplogin process which is using interface
213 .Ar slX .
214 .El
215 .Sh EXAMPLES
216 The normal use of
217 .Nm
218 is to create a
219 .Pa /etc/passwd
220 entry for each legal, remote slip site with
221 .Nm
222 as the shell for that entry.
223 E.g.,
224 .Bd -literal
225 Sfoo:ikhuy6:2010:1:slip line to foo:/tmp:/usr/sbin/sliplogin
226 .Ed
227 .Pp
228 (Our convention is to name the account used by remote host
229 .Ar hostname
230 as
231 .Em Shostname . )
232 Then an entry is added to
233 .Pa slip.hosts
234 that looks like:
235 .Pp
236 .Bd -literal -offset indent -compact
237 Sfoo    `hostname`      foo     netmask
238 .Ed
239 .Pp
240 where
241 .Em `hostname`
242 will be evaluated by
243 .Xr sh 1
244 to the local host name and
245 .Em netmask
246 is the local host IP netmask.
247 .Pp
248 Note that
249 .Nm
250 must be setuid to root and, while not a security hole, moral defectives
251 can use it to place terminal lines in an unusable state and/or deny
252 access to legitimate users of a remote slip line.
253 To prevent this,
254 .Nm
255 is installed as user
256 .Em root ,
257 group
258 .Em network
259 and mode 4550 so that only members of group
260 .Em network
261 may run
262 .Nm .
263 The system administrator should make sure that all legitimate users
264 are a member of the correct group.
265 .Sh DIAGNOSTICS
266 The
267 .Nm
268 utility logs various information to the system log daemon,
269 .Xr syslogd 8 ,
270 with a facility code of
271 .Em daemon .
272 The messages are listed here, grouped by severity level.
273 .Pp
274 .Sy Error Severity
275 .Bl -tag -width Ds -compact
276 .It Sy ioctl (TCGETS): Em reason
277 A
278 .Dv TCGETS
279 .Fn ioctl
280 to get the line parameters failed.
281 .Pp
282 .It Sy ioctl (TCSETS): Em reason
283 A
284 .Dv TCSETS
285 .Fn ioctl
286 to set the line parameters failed.
287 .Pp
288 .It Sy /etc/sliphome/slip.hosts: Em reason
289 The
290 .Pa /etc/sliphome/slip.hosts
291 file could not be opened.
292 .Pp
293 .It Sy access denied for Em user
294 No entry for
295 .Em user
296 was found in
297 .Pa /etc/sliphome/slip.hosts .
298 .El
299 .Pp
300 .Sy Notice Severity
301 .Bl -tag -width Ds -compact
302 .It Sy "attaching slip unit" Em unit Sy for Ar loginname
303 .Tn SLIP
304 unit
305 .Em unit
306 was successfully attached.
307 .El
308 .Sh SEE ALSO
309 .Xr slattach 8 ,
310 .Xr syslogd 8
311 .Pp
312 .Pa /usr/share/examples/sliplogin
313 .Sh HISTORY
314 The
315 .Nm
316 utility appeared in
317 .Bx 4.3 Reno .