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