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