xref: /dragonfly/sbin/slattach/slattach.8 (revision 19fe1c42)
1.\" Copyright (c) 1986, 1991 The Regents of the University of California.
2.\" 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. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"     @(#)slattach.8	6.4 (Berkeley) 3/16/91
33.\"
34.\" $FreeBSD: src/sbin/slattach/slattach.8,v 1.16.2.6 2003/02/23 21:17:43 trhodes Exp $
35.\" $DragonFly: src/sbin/slattach/slattach.8,v 1.4 2008/05/09 20:31:04 swildner Exp $
36.\"
37.Dd April 4, 1993
38.Dt SLATTACH 8
39.Os
40.Sh NAME
41.Nm slattach
42.Nd attach serial lines as network interfaces
43.Sh SYNOPSIS
44.Nm
45.Op Fl a
46.Op Fl c
47.Op Fl e Ar exit-command
48.Op Fl f
49.Op Fl h
50.Op Fl l
51.Op Fl n
52.Op Fl z
53.Op Fl L
54.Op Fl r Ar redial-command
55.Op Fl s Ar baudrate
56.Op Fl u Ar unit-command
57.Op Fl K Ar keepalive
58.Op Fl O Ar outfill
59.Op Fl S Ar unit
60.Ar ttyname
61.Sh DESCRIPTION
62The
63.Nm
64utility is used to assign a tty line to a network interface,
65and to define the network source and destination addresses.
66.Pp
67The following options are available:
68.Bl -tag -width indent
69.It Fl a
70Autoenable the VJ header compression option, if the other end of the link
71is capable of VJ header compression then it will be used otherwise normal
72headers will be used.
73.It Fl c
74Enable the VJ header compression option.  Note that both ends of the link
75must be able to use VJ header compression for this to work.
76.It Fl e Ar exit-command
77Specify a command to be invoked within a shell
78.Ql sh \-c Ar exit-command
79before
80.Nm
81exits.
82.It Fl f
83Disable the invocation of daemon() to run
84.Nm
85in the background.
86.It Fl h
87Turn on cts/rts style flow control on the slip port, by default no flow
88control is done.
89.It Fl l
90Disable modem control (CLOCAL) and ignore carrier detect on the slip
91port.  By default the
92.Ar redial-command
93is invoked upon carrier drop and
94.Nm
95aborts if no
96.Ar redial-command
97is specified.
98.It Fl n
99Throw away ICMP packets.  The slip interface will ignore ICMP packets
100to prevent slow lines being saturated by ICMP responses.
101.It Fl r Ar redial-command
102Specify a command to be invoked within a shell
103.Ql sh \-c Ar redial-command
104whenever carrier is lost on the modem line.
105Empty
106.Ar redial-command
107(i.e.\&
108.Fl r Qq "" )
109cause connection reestablishing on leased line
110without any external command invoked.
111.It Fl s Ar baudrate
112Specify the speed of the connection.
113If not specified, the
114default of 9600 is used.
115.It Fl u Ar unit-command
116When the line is switched to slip discipline, run
117.Dq Nm "sh -c" Ar unit-command old new
118where
119.Ar old
120and
121.Ar new
122are the slip unit numbers when the line was
123last opened and the unit number of the current slip connection
124respectively.  The unit number can change after redialing if you are
125using more than one slip line.
126When
127.Nm
128is connected for the first time,
129.Dq Nm "sh -c" Ar unit-command \-1 new
130is run.
131When
132.Nm
133is disconnected,
134.Dq Nm "sh -c" Ar unit-command old \-1
135is run.
136The
137.Nm
138utility will abort if the unit number
139changes and
140.Dq Fl u Ar \%unit-command
141was not specified.
142.It Fl z
143Force redial
144.Ar redial-command
145upon startup irrespective of carrier.
146.It Fl L
147Use uucp-style device locking.
148You need it unless you start
149.Nm
150from external program which already does uucp locking.
151Default case is no uucp locking to satisfy such programs.
152.It Fl K Ar keepalive
153Set SLIP "keep alive" timeout in seconds.
154If FRAME_END is not received in
155this amount of time, re-connect occurs.
156The default value is no timeout.
157.It Fl O Ar outfill
158Set SLIP "out fill" timeout in seconds.  It forces at least one FRAME_END
159to be sent during this time period, which is necessary for the "keep alive"
160timeout on the remote side.
161The default value is no timeout.
162.It Fl S Ar unit
163Set the SLIP unit number directly.
164Use with caution, because no check is made
165for two interfaces with same number.
166By default sliplogin dynamically assigns the unit number.
167.It Ar ttyname
168Specify the name of the tty device.
169.Ar Ttyname
170should be a string of the form
171.Ql ttyXX
172or
173.Ql /dev/ttyXX .
174.El
175.Pp
176Only the super-user may attach a network interface.
177.Pp
178To detach the interface, use
179.Dq Li ifconfig interface-name down
180after killing off the
181.Nm
182process using
183.Ql kill -INT .
184.Ar Interface-name
185is the name that is shown by
186.Xr netstat 1 .
187.Pp
188To setup
189.Nm
190to redial the phone when carrier is lost, use the
191.Fl r Ar redial-command
192option to specify a script or executable that will reconnect the
193serial line to the slip server.  For example, the script could redial
194the server and log in, etc.
195.Pp
196To reconfigure the network interface in case the slip unit number
197changes, use the
198.Fl u Ar unit-command
199option to specify a script or executable that will be invoked as
200.Ql sh \-c Ar unit-command old new
201where
202.Ar old
203and
204.Ar new
205are the slip unit numbers before and after
206reconnecting the line.  The unit number can change if you have more
207than one line disconnect at the same time.  The first to succeed in
208reconnecting will get the lowest unit number.
209.Pp
210To kill
211.Nm
212use
213.Ql kill -INT
214.Dv ( SIGINT )
215which causes it to close the tty and exit.
216.Pp
217To force a redial, use
218.Ql kill -HUP
219.Dv ( SIGHUP )
220which causes
221.Nm
222to think carrier was lost and thus invoke
223.Ql sh \-c Ar redial-command
224to reconnect to the server.
225.Pp
226If you use a hard-wired connection rather than a modem, invoke
227.Nm
228with the
229.Fl l
230option in order to ignore carrier on the slip line.
231.Sh FILES
232.Bl -tag -width /usr/share/examples/slattach/* -compact
233.It Pa /var/run/slattach.<tty>.pid
234with
235.Ar tty
236replaced by the terminal path name component of
237.Ar ttyname .
238This file contains the numerical process ID of the
239.Nm
240process and can be examined by scripts in order to send a signal to
241.Nm
242.It Pa /usr/share/examples/slattach/*
243.El
244.Sh EXAMPLES
245.Bd -literal -offset indent -compact
246slattach ttyd8
247slattach \-s 4800 /dev/ttyd1
248slattach \-c \-s 38400 /dev/cuaa1
249slattach \-r 'kermit -y dial.script >kermit.log 2>&1'
250.Ed
251.Sh DIAGNOSTICS
252Look for error messages in
253.Pa /var/log/messages
254.No ( Nm
255is a daemon).
256Messages indicating the specified interface does not exit, the
257requested address is unknown, the user is not privileged and tried to
258alter an interface's configuration are logged there.
259The
260.Nm
261utility
262also logs failure to set the controlling terminal or failure to install
263signal handlers.  Upon connection and redial the ttyname and baud rate
264are logged and on shutdown the ttyname is logged.
265.Sh SEE ALSO
266.Xr netstat 1 ,
267.Xr startslip 1 ,
268.Xr uustat 1 ,
269.Xr netintro 4 ,
270.Xr ifconfig 8 ,
271.Xr rc 8 ,
272.Xr sliplogin 8
273.Sh HISTORY
274The
275.Nm
276utility appeared in
277.Bx 4.3 .
278