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