xref: /dragonfly/usr.sbin/sliplogin/sliplogin.8 (revision cf89a63b)
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.\" 3. 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: src/usr.sbin/sliplogin/sliplogin.8,v 1.12.2.5 2003/03/11 22:31:33 trhodes Exp $
30.\" $DragonFly: src/usr.sbin/sliplogin/sliplogin.8,v 1.4 2006/04/17 18:01:38 swildner Exp $
31.\"
32.Dd January 5, 1994
33.Dt SLIPLOGIN 8
34.Os
35.Sh NAME
36.Nm sliplogin
37.Nd attach a serial line network interface
38.Sh SYNOPSIS
39.Nm
40.Op Ar loginname Op Ar device
41.Sh DESCRIPTION
42The
43.Nm
44utility is used to turn the terminal line on standard input (or
45.Ar device )
46into a Serial Line IP
47.Pq Tn SLIP
48link to a remote host.  To do this, the program
49searches the file
50.Pa /etc/sliphome/slip.hosts
51for an entry matching
52.Ar loginname
53(which defaults to the current login name if omitted).
54If a matching entry is found, the line is configured appropriately
55for slip (8-bit transparent i/o) and converted to
56.Tn SLIP
57line discipline using the optional line discipline parameters.
58.Pp
59The optional line discipline parameters consist of one or more of
60the following;
61.Sq normal ,
62.Sq compress ,
63.Sq noicmp ,
64or
65.Sq autocomp
66which 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 ,
71and
72.Sq auto enable VJ header compression
73(only if the remote end of the link also supports it).
74.Pp
75Then a shell script is invoked to initialize the slip
76interface with the appropriate local and remote
77.Tn IP
78address,
79netmask, etc.
80.Pp
81The usual initialization script is
82.Pa /etc/sliphome/slip.login
83but, if particular hosts need special initialization, the file
84.Pa /etc/sliphome/slip.login. Ns Ar loginname
85will be executed instead if it exists.
86The script is invoked with the parameters
87.Bl -tag -width slipunit
88.It Em slipunit
89The unit number of the slip interface assigned to this line.  E.g.,
90.Sy 0
91for
92.Sy sl0 .
93.It Em speed
94The speed of the line.
95.It Em args
96The arguments from the
97.Pa /etc/sliphome/slip.hosts
98entry, in order starting with
99.Ar loginname .
100.El
101.Pp
102Only the super-user may attach a network interface.  The interface is
103automatically detached when the other end hangs up or the
104.Nm
105process dies.  If the kernel slip
106module has been configured for it, all routes through that interface will
107also disappear at the same time.  If there is other processing a site
108would like done on hangup, the file
109.Pa /etc/sliphome/slip.logout
110or
111.Pa /etc/sliphome/slip.logout. Ns Ar loginname
112is executed if it exists.  It is given the same arguments as the login script.
113.Ss Format of /etc/sliphome/slip.hosts
114Comments (lines starting with a `#') and blank lines (or started
115with space) are ignored.
116Other lines must start with a
117.Ar loginname
118but the remaining arguments can be whatever is appropriate for the
119.Pa  slip.login
120file that will be executed for that name.
121Arguments are separated by white space and follow normal
122.Xr sh 1
123quoting conventions (however,
124.Ar loginname
125cannot be quoted).
126Usually, lines have the form
127.Bd -literal -offset indent
128loginname local-address remote-address netmask opt-args
129.Ed
130.Pp
131where
132.Em local-address
133and
134.Em remote-address
135are the IP host names or addresses of the local and remote ends of the
136slip line and
137.Em netmask
138is the appropriate IP netmask.  These arguments are passed
139directly to
140.Xr ifconfig 8 .
141.Em Opt-args
142are optional arguments used to configure the line.
143.Sh FreeBSD Additions
144An additional SLIP configuration file (if present) is
145.Pa /etc/sliphome/slip.slparms .
146If particular hosts need different configurations, the file
147.Pa /etc/sliphome/slip.slparms. Ns Ar loginname
148will be parsed instead if it exists.
149.Ss Format of /etc/sliphome/slip.slparms*
150Comments (lines starting with a `#') and blank lines (or started with
151space) are ignored.
152This file contains from one to three numeric parameters separated with spaces,
153in order:
154.Ar keepalive ,
155.Ar outfill
156and
157.Ar slunit .
158.Bl -tag -width keepalive
159.It Ar keepalive
160Set SLIP "keep alive" timeout in seconds.
161If FRAME_END is not received in
162this amount of time,
163.Nm
164closes the line and exits.
165The default value is no timeout (zero).
166.It Ar outfill
167Set SLIP "out fill" timeout in seconds.
168It forces at least one FRAME_END
169to be sent during this time period, which is necessary for the "keep alive"
170timeout on the remote side.
171The default value is no timeout (zero).
172.It Ar slunit
173Set the SLIP unit number directly.
174Use with caution, because no check is made
175for two interfaces with same number.
176By default sliplogin dynamically assigns the unit number.
177.El
178.Pp
179If latter two parameters are omitted, they will not affect the
180corresponding SLIP configuration.
181If any of first two parameters is equal to zero, it will not affect
182the corresponding SLIP configuration.
183.Sh FILES
184.Bl -tag -width indent
185.It Pa /etc/sliphome/slip.hosts
186list of host login names and parameters.
187.It Pa /etc/sliphome/slip.login
188script executed when a connection is made.
189.It Pa /etc/sliphome/slip.login. Ns Ar loginname
190script executed when a connection is made by
191.Ar loginname .
192.It Pa /etc/sliphome/slip.logout
193script executed when a connection is lost.
194.It Pa /etc/sliphome/slip.logout. Ns Ar loginname
195script executed when a connection is lost by
196.Ar loginname .
197.It Pa /etc/sliphome/slip.slparms
198extra parameters file.
199.It Pa /etc/sliphome/slip.slparms. Ns Ar loginname
200extra parameters file for
201.Ar loginname .
202.It Pa /var/run/ Ns Ar ttyXn Ns Pa .if
203contains the name of the network interface used by the sliplogin process on
204.Ar ttyXn .
205.It Pa /var/run/ Ns Ar slX Ns Pa .pid
206contains the PID of the sliplogin process which is using interface
207.Ar slX .
208.El
209.Sh EXAMPLES
210The normal use of
211.Nm
212is to create a
213.Pa /etc/passwd
214entry for each legal, remote slip site with
215.Nm
216as the shell for that entry.  E.g.,
217.Bd -literal
218Sfoo:ikhuy6:2010:1:slip line to foo:/tmp:/usr/sbin/sliplogin
219.Ed
220.Pp
221(Our convention is to name the account used by remote host
222.Ar hostname
223as
224.Em Shostname . )
225Then an entry is added to
226.Pa slip.hosts
227that looks like:
228.Pp
229.Bd -literal -offset indent -compact
230Sfoo	`hostname`	foo	netmask
231.Ed
232.Pp
233where
234.Em `hostname`
235will be evaluated by
236.Xr sh 1
237to the local host name and
238.Em netmask
239is the local host IP netmask.
240.Pp
241Note that
242.Nm
243must be setuid to root and, while not a security hole, moral defectives
244can use it to place terminal lines in an unusable state and/or deny
245access to legitimate users of a remote slip line.  To prevent this,
246.Nm
247is installed as user
248.Em root ,
249group
250.Em network
251and mode 4550 so that only members of group
252.Em network
253may run
254.Nm .
255The system administrator should make sure that all legitimate users
256are a member of the correct group.
257.Sh DIAGNOSTICS
258The
259.Nm
260utility logs various information to the system log daemon,
261.Xr syslogd 8 ,
262with a facility code of
263.Em daemon .
264The messages are listed here, grouped by severity level.
265.Pp
266.Sy Error Severity
267.Bl -tag -width Ds -compact
268.It Sy ioctl (TCGETS): Em reason
269A
270.Dv TCGETS
271.Fn ioctl
272to get the line parameters failed.
273.Pp
274.It Sy ioctl (TCSETS): Em reason
275A
276.Dv TCSETS
277.Fn ioctl
278to set the line parameters failed.
279.Pp
280.It Sy /etc/sliphome/slip.hosts: Em reason
281The
282.Pa /etc/sliphome/slip.hosts
283file could not be opened.
284.Pp
285.It Sy access denied for Em user
286No entry for
287.Em user
288was found in
289.Pa /etc/sliphome/slip.hosts .
290.El
291.Pp
292.Sy Notice Severity
293.Bl -tag -width Ds -compact
294.It Sy "attaching slip unit" Em unit Sy for Ar loginname
295.Tn SLIP
296unit
297.Em unit
298was successfully attached.
299.El
300.Sh SEE ALSO
301.Xr slattach 8 ,
302.Xr syslogd 8
303.Pp
304.Pa /usr/share/examples/sliplogin
305.Sh HISTORY
306The
307.Nm
308utility appeared in
309.Bx 4.3 Reno .
310