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