]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/slattach/slattach.8
This commit was generated by cvs2svn to compensate for changes in r75406,
[FreeBSD/FreeBSD.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$
35 .\"
36 .Dd April 4, 1993
37 .Dt SLATTACH 8
38 .Os BSD 4.3
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 .Nm Slattach
62 is used to assign a tty line to a network interface,
63 and to define the network source and destination addresses.
64 .Pp
65 The following options are available:
66 .Bl -tag -width indent
67 .It Fl a
68 Autoenable the VJ header compression option, if the other end of the link
69 is capable of VJ header compression then it will be used otherwise normal
70 headers will be used.
71 .It Fl c
72 Enable the VJ header compression option.  Note that both ends of the link
73 must be able to use VJ header compression for this to work.
74 .It Fl e Ar exit-command
75 Specify a command to be invoked within a shell
76 .Ql sh \-c Ar exit-command
77 before
78 .Nm
79 exits.
80 .It Fl f
81 Disable the invocation of daemon() 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 .Ql 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 .Ql Nm "sh -c" Ar unit-command \-1 new
128 is run.
129 When
130 .Nm
131 is disconnected,
132 .Ql Nm "sh -c" Ar unit-command old \-1
133 is run.
134 .Nm Slattach
135 will abort if the unit number
136 changes and
137 .Ql Fl u Ar \%unit-command
138 was not specified.
139 .It Fl z
140 Force redial
141 .Ar redial-command
142 upon startup irrespective of carrier.
143 .It Fl L
144 Use uucp-style device locking.
145 You need it unless you start
146 .Nm
147 from external program which already does uucp locking.
148 Default case is no uucp locking to satisfy such programs.
149 .It Fl K Ar keepalive
150 Set SLIP "keep alive" timeout in seconds.
151 If FRAME_END is not received in
152 this amount of time, re-connect occurs.
153 The default value is no timeout.
154 .It Fl O Ar outfill
155 Set SLIP "out fill" timeout in seconds.  It forces at least one FRAME_END
156 to be sent during this time period, which is necessary for the "keep alive"
157 timeout on the remote side.
158 The default value is no timeout.
159 .It Fl S Ar unit
160 Set the SLIP unit number directly.
161 Use with caution, because no check is made
162 for two interfaces with same number.
163 By default sliplogin dynamically assigns the unit number.
164 .It Ar ttyname
165 Specify the name of the tty device.
166 .Ar Ttyname
167 should be a string of the form 
168 .Ql ttyXX
169 or
170 .Ql /dev/ttyXX .
171 .El
172 .Pp
173 Only the super-user may attach a network interface.
174 .Pp
175 To detach the interface, use
176 .Dq Li ifconfig interface-name down
177 after killing off the
178 .Nm
179 process using
180 .Ql kill -INT .
181 .Ar Interface-name
182 is the name that is shown by
183 .Xr netstat 1 .
184 .Pp
185 To setup
186 .Nm
187 to redial the phone when carrier is lost, use the
188 .Fl r Ar redial-command
189 option to specify a script or executable that will reconnect the
190 serial line to the slip server.  For example, the script could redial
191 the server and log in, etc.
192 .Pp
193 To reconfigure the network interface in case the slip unit number
194 changes, use the
195 .Fl u Ar unit-command
196 option to specify a script or executable that will be invoked as 
197 .Ql sh \-c Ar unit-command old new
198 where
199 .Ar old
200 and
201 .Ar new
202 are the slip unit numbers before and after
203 reconnecting the line.  The unit number can change if you have more
204 than one line disconnect at the same time.  The first to succeed in
205 reconnecting will get the lowest unit number.
206 .Pp
207 To kill
208 .Nm
209 use
210 .Ql kill -INT
211 (SIGINT) which causes it to close the tty and exit.
212 .Pp
213 To force a redial, use
214 .Ql kill -HUP
215 (SIGHUP) which causes
216 .Nm
217 to think carrier was lost and thus invoke
218 .Ql sh \-c Ar redial-command
219 to reconnect to the server.
220 .Pp
221 If you use a hard-wired connection rather than a modem, invoke
222 .Nm
223 with the
224 .Fl l
225 option in order to ignore carrier on the slip line.
226 .Sh EXAMPLES
227 .Bd -literal -offset indent -compact
228 slattach ttyd8
229 slattach \-s 4800 /dev/ttyd1
230 slattach \-c \-s 38400 /dev/cuaa1
231 slattach \-r 'kermit -y dial.script >kermit.log 2>&1'
232 .Ed
233 .Sh DIAGNOSTICS
234 Look for error messages in
235 .Pa /var/log/messages
236 .No ( Nm
237 is a daemon).
238 Messages indicating the specified interface does not exit, the
239 requested address is unknown, the user is not privileged and tried to
240 alter an interface's configuration are logged there.
241 .Nm Slattach
242 also logs failure to set the controlling terminal or failure to install
243 signal handlers.  Upon connection and redial the ttyname and baud rate
244 are logged and on shutdown the ttyname is logged.
245 .Pp
246 .Sh FILES
247 .Bl -tag -width /usr/share/examples/slattach/* -compact
248 .It Pa /var/run/slattach.<tty>.pid
249 with
250 .Ar tty
251 replaced by the terminal path name component of
252 .Ar ttyname .
253 This file contains the numerical process ID of the
254 .Nm
255 process and can be examined by scripts in order to send a signal to
256 .Nm
257 .It Pa /usr/share/examples/slattach/*
258 .El
259 .Sh SEE ALSO
260 .Xr netstat 1 ,
261 .Xr startslip 1 ,
262 .Xr uustat 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 command appeared in
271 .Bx 4.3 .