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