1.\" Copyright (c) 1990, 1991, 1993 2.\" The Regents of the University of California. 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. 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.\" @(#)sliplogin.8 8.2 (Berkeley) 1/5/94 29.\" $FreeBSD: src/usr.sbin/sliplogin/sliplogin.8,v 1.12.2.5 2003/03/11 22:31:33 trhodes Exp $ 30.\" 31.Dd January 5, 1994 32.Dt SLIPLOGIN 8 33.Os 34.Sh NAME 35.Nm sliplogin 36.Nd attach a serial line network interface 37.Sh SYNOPSIS 38.Nm 39.Op Ar loginname Op Ar device 40.Sh DESCRIPTION 41The 42.Nm 43utility is used to turn the terminal line on standard input (or 44.Ar device ) 45into a Serial Line IP 46.Pq Tn SLIP 47link to a remote host. To do this, the program 48searches the file 49.Pa /etc/sliphome/slip.hosts 50for an entry matching 51.Ar loginname 52(which defaults to the current login name if omitted). 53If a matching entry is found, the line is configured appropriately 54for slip (8-bit transparent i/o) and converted to 55.Tn SLIP 56line discipline using the optional line discipline parameters. 57.Pp 58The optional line discipline parameters consist of one or more of 59the following; 60.Sq normal , 61.Sq compress , 62.Sq noicmp , 63or 64.Sq autocomp 65which correspond respectively to 66.Sq use normal line discipline 67(no header compression), 68.Sq enable VJ header compression , 69.Sq throw away ICMP packets , 70and 71.Sq auto enable VJ header compression 72(only if the remote end of the link also supports it). 73.Pp 74Then a shell script is invoked to initialize the slip 75interface with the appropriate local and remote 76.Tn IP 77address, 78netmask, etc. 79.Pp 80The usual initialization script is 81.Pa /etc/sliphome/slip.login 82but, if particular hosts need special initialization, the file 83.Pa /etc/sliphome/slip.login. Ns Ar loginname 84will be executed instead if it exists. 85The script is invoked with the parameters 86.Bl -tag -width slipunit 87.It Em slipunit 88The unit number of the slip interface assigned to this line. E.g., 89.Sy 0 90for 91.Sy sl0 . 92.It Em speed 93The speed of the line. 94.It Em args 95The arguments from the 96.Pa /etc/sliphome/slip.hosts 97entry, in order starting with 98.Ar loginname . 99.El 100.Pp 101Only the super-user may attach a network interface. The interface is 102automatically detached when the other end hangs up or the 103.Nm 104process dies. If the kernel slip 105module has been configured for it, all routes through that interface will 106also disappear at the same time. If there is other processing a site 107would like done on hangup, the file 108.Pa /etc/sliphome/slip.logout 109or 110.Pa /etc/sliphome/slip.logout. Ns Ar loginname 111is executed if it exists. It is given the same arguments as the login script. 112.Ss Format of /etc/sliphome/slip.hosts 113Comments (lines starting with a `#') and blank lines (or started 114with space) are ignored. 115Other lines must start with a 116.Ar loginname 117but the remaining arguments can be whatever is appropriate for the 118.Pa slip.login 119file that will be executed for that name. 120Arguments are separated by white space and follow normal 121.Xr sh 1 122quoting conventions (however, 123.Ar loginname 124cannot be quoted). 125Usually, lines have the form 126.Bd -literal -offset indent 127loginname local-address remote-address netmask opt-args 128.Ed 129.Pp 130where 131.Em local-address 132and 133.Em remote-address 134are the IP host names or addresses of the local and remote ends of the 135slip line and 136.Em netmask 137is the appropriate IP netmask. These arguments are passed 138directly to 139.Xr ifconfig 8 . 140.Em Opt-args 141are optional arguments used to configure the line. 142.Sh FreeBSD Additions 143An additional SLIP configuration file (if present) is 144.Pa /etc/sliphome/slip.slparms . 145If particular hosts need different configurations, the file 146.Pa /etc/sliphome/slip.slparms. Ns Ar loginname 147will be parsed instead if it exists. 148.Ss Format of /etc/sliphome/slip.slparms* 149Comments (lines starting with a `#') and blank lines (or started with 150space) are ignored. 151This file contains from one to three numeric parameters separated with spaces, 152in order: 153.Ar keepalive , 154.Ar outfill 155and 156.Ar slunit . 157.Bl -tag -width keepalive 158.It Ar keepalive 159Set SLIP "keep alive" timeout in seconds. 160If FRAME_END is not received in 161this amount of time, 162.Nm 163closes the line and exits. 164The default value is no timeout (zero). 165.It Ar outfill 166Set SLIP "out fill" timeout in seconds. 167It forces at least one FRAME_END 168to be sent during this time period, which is necessary for the "keep alive" 169timeout on the remote side. 170The default value is no timeout (zero). 171.It Ar slunit 172Set the SLIP unit number directly. 173Use with caution, because no check is made 174for two interfaces with same number. 175By default sliplogin dynamically assigns the unit number. 176.El 177.Pp 178If latter two parameters are omitted, they will not affect the 179corresponding SLIP configuration. 180If any of first two parameters is equal to zero, it will not affect 181the corresponding SLIP configuration. 182.Sh FILES 183.Bl -tag -width indent 184.It Pa /etc/sliphome/slip.hosts 185list of host login names and parameters. 186.It Pa /etc/sliphome/slip.login 187script executed when a connection is made. 188.It Pa /etc/sliphome/slip.login. Ns Ar loginname 189script executed when a connection is made by 190.Ar loginname . 191.It Pa /etc/sliphome/slip.logout 192script executed when a connection is lost. 193.It Pa /etc/sliphome/slip.logout. Ns Ar loginname 194script executed when a connection is lost by 195.Ar loginname . 196.It Pa /etc/sliphome/slip.slparms 197extra parameters file. 198.It Pa /etc/sliphome/slip.slparms. Ns Ar loginname 199extra parameters file for 200.Ar loginname . 201.It Pa /var/run/ Ns Ar ttyXn Ns Pa .if 202contains the name of the network interface used by the sliplogin process on 203.Ar ttyXn . 204.It Pa /var/run/ Ns Ar slX Ns Pa .pid 205contains the PID of the sliplogin process which is using interface 206.Ar slX . 207.El 208.Sh EXAMPLES 209The normal use of 210.Nm 211is to create a 212.Pa /etc/passwd 213entry for each legal, remote slip site with 214.Nm 215as the shell for that entry. E.g., 216.Bd -literal 217Sfoo:ikhuy6:2010:1:slip line to foo:/tmp:/usr/sbin/sliplogin 218.Ed 219.Pp 220(Our convention is to name the account used by remote host 221.Ar hostname 222as 223.Em Shostname . ) 224Then an entry is added to 225.Pa slip.hosts 226that looks like: 227.Pp 228.Bd -literal -offset indent -compact 229Sfoo `hostname` foo netmask 230.Ed 231.Pp 232where 233.Em `hostname` 234will be evaluated by 235.Xr sh 1 236to the local host name and 237.Em netmask 238is the local host IP netmask. 239.Pp 240Note that 241.Nm 242must be setuid to root and, while not a security hole, moral defectives 243can use it to place terminal lines in an unusable state and/or deny 244access to legitimate users of a remote slip line. To prevent this, 245.Nm 246is installed as user 247.Em root , 248group 249.Em network 250and mode 4550 so that only members of group 251.Em network 252may run 253.Nm . 254The system administrator should make sure that all legitimate users 255are a member of the correct group. 256.Sh DIAGNOSTICS 257The 258.Nm 259utility logs various information to the system log daemon, 260.Xr syslogd 8 , 261with a facility code of 262.Em daemon . 263The messages are listed here, grouped by severity level. 264.Pp 265.Sy Error Severity 266.Bl -tag -width Ds -compact 267.It Sy ioctl (TCGETS): Em reason 268A 269.Dv TCGETS 270.Fn ioctl 271to get the line parameters failed. 272.Pp 273.It Sy ioctl (TCSETS): Em reason 274A 275.Dv TCSETS 276.Fn ioctl 277to set the line parameters failed. 278.Pp 279.It Sy /etc/sliphome/slip.hosts: Em reason 280The 281.Pa /etc/sliphome/slip.hosts 282file could not be opened. 283.Pp 284.It Sy access denied for Em user 285No entry for 286.Em user 287was found in 288.Pa /etc/sliphome/slip.hosts . 289.El 290.Pp 291.Sy Notice Severity 292.Bl -tag -width Ds -compact 293.It Sy "attaching slip unit" Em unit Sy for Ar loginname 294.Tn SLIP 295unit 296.Em unit 297was successfully attached. 298.El 299.Sh SEE ALSO 300.Xr slattach 8 , 301.Xr syslogd 8 302.Pp 303.Pa /usr/share/examples/sliplogin 304.Sh HISTORY 305The 306.Nm 307utility appeared in 308.Bx 4.3 Reno . 309