This commit was manufactured by cvs2svn to create tag 'FreeBSD-release/1.0'.
[unix-history] / sbin / slattach / slattach.8
CommitLineData
15637ed4
RG
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.\"
78ed81a3 32.\" from: @(#)slattach.8 6.4 (Berkeley) 3/16/91
15637ed4 33.\"
78ed81a3 34.\" $Id$
35.\"
36.Dd April 4, 1993
15637ed4
RG
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 SYOPNSIS
43.Nm Slattach
78ed81a3 44.Op \-a
45.Op \-c
46.Op \-e exit-command
47.Op \-f
48.Op \-h
49.Op \-l
50.Op \-n
51.Op \-r redial-command
52.Op \-s baudrate
53.Op \-u unit-command
54.Op \-z
55.Ar ttyname
15637ed4
RG
56.Sh DESCRIPTION
57.Nm Slattach
58is used to assign a tty line to a network interface,
59and to define the network source and destination addresses.
60The following operands are supported by
61.Nm slattach :
62.Bl -tag -width Ar
78ed81a3 63.It Ar \-a
64Autoenable the VJ header compression option, if the other end of the link
65is capable of VJ header compression then it will be used otherwise normal
66headers will be used.
67.It Ar \-c
68Enables the VJ header compression option. Note that both ends of the link
69must be able to use VJ header compression for this to work.
70.It Ar \-e exit-command
71Specifies a command to be invoked within a shell (sh -c exit-command)
72before slattach exits.
73.It Ar \-f
74Disables the invocation of daemon() to run slattach in the background.
75.It Ar \-h
76Turn on cts/rts style flow control on the slip port, by default no flow
77control is done.
78.It Ar \-l
79disable modem control (CLOCAL) and ignore carrier detect on the slip
80port. By default the redial-command is invoked upon carrier drop and
81slattach aborts if no redial-command is specified.
82.It Ar \-n
83Throw away ICMP packets. The slip interface will ignore ICMP packets
84to prevent slow lines being saturated by ICMP responses.
85.It Ar \-r redial-command
86Specifies a command to be invoked within a shell (sh -c
87redial-command) whenever carrier is lost on the line.
88.It Ar \-s baudrate
89Specifies the speed of the connection. If not specified, the
90default of 9600 is used.
91.It Ar \-u unit-command
92When the line is switched to slip discipline, run
93.Ql sh \-c unit-command <last> <current>
94where <last> and <current> are the slip unit numbers when the line was
95last opened and the unit number of the current slip connection
96respecitvely. The unit number can change after redialing if you are
97using more than one slip line. Slattach will abort if the unit number
98changes and
99.Ql \-u unit-command
100was not specified.
101.It Ar \-z
102forces redial
103redial-cmd upon startup irrespective of carrier.
15637ed4
RG
104.It Ar ttyname
105Specifies the name of the tty device.
106.Ar Ttyname
78ed81a3 107should be a string of the form
108.Ql ttyXX or
109.Ql /dev/ttyXX.
15637ed4
RG
110.El
111.Pp
112Only the super-user may attach a network interface.
113.Pp
114To detach the interface, use
115.Dq Li ifconfig interface-name down
116after killing off the
117.Nm slattach
78ed81a3 118process using
119.Ql kill -INT .
15637ed4
RG
120.Ar Interface-name
121is the name that is shown by
122.Xr netstat 1
78ed81a3 123.Pp
124To setup slattach to redial the phone when carrier is lost, use the
125.Ql \-r redial-cmd
126option to specify a script or executable that will reconnect the
127serial line to the slip server. For example, the script could redial
128the server and log in, etc.
129.Pp
130To reconfigure the network interface in case the slip unit number
131changes, use the
132.Ql \-u unit-cmd
133option to specify a script or executable that will be invoked as
134.Ql sh \-c unit-cmd old new,
135where old and new are the slip unit numbers before and after
136reconnecting the line. The unit number can change if you have more
137than one line disconnect at the same time. The first to succeed in
138reconnecting will get the lowest unit number.
139.Pp
140To kill slattach use
141.Ql kill -INT
142(SIGINT) which causes it to close the tty and exit.
143.Pp
144To force a redial, use
145.Ql kill -HUP
146(SIGHUP) which causes slattach to think carrier was lost and thus invoke
147.Ql sh -c redial-command
148to reconnect to the server.
149.Pp
150If you use a hard-wired connection rather than a modem, invoke
151slattach with the
152.Ql \-l
153option in order to ignore carrier on the slip line.
15637ed4
RG
154.Sh EXAMPLES
155.Bd -literal -offset indent -compact
156slattach ttyh8
78ed81a3 157slattach \-s 4800 /dev/tty01
158slattach \-c \-s 38400 /dev/sio01
159slattach \-r 'kermit -y dial.script >kermit.log 2>&1'
15637ed4
RG
160.Ed
161.Sh DIAGNOSTICS
78ed81a3 162Look for error messages in /var/log/messages (slattach is a daemon).
15637ed4 163Messages indicating the specified interface does not exit, the
78ed81a3 164requested address is unknown, the user is not privileged and tried to
165alter an interface's configuration are logged there. Slattach also
166logs failure to set the controlling terminal or failure to install
167signal handlers. Upon connection and redial the ttyname and baud rate
168are logged and on shutdown the ttyname is logged.
169.Pp
15637ed4
RG
170.Sh SEE ALSO
171.Xr netstat 1 ,
172.Xr netintro 4 ,
173.Xr ifconfig 8 ,
174.Xr rc 8
175.Sh HISTORY
176The
177.Nm
178command appeared in
179.Bx 4.3 .