xref: /openbsd/share/man/man4/lo.4 (revision 133306f0)
1.\"	$OpenBSD: lo.4,v 1.12 2000/11/06 22:16:33 matthieu Exp $
2.\"	$NetBSD: lo.4,v 1.3 1994/11/30 16:22:23 jtc Exp $
3.\"
4.\" Copyright (c) 1983, 1991, 1993
5.\"	The Regents of the University of California.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\"    must display the following acknowledgement:
17.\"	This product includes software developed by the University of
18.\"	California, Berkeley and its contributors.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\"    may be used to endorse or promote products derived from this software
21.\"    without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\"     @(#)lo.4	8.1 (Berkeley) 6/5/93
36.\"
37.Dd June 5, 1993
38.Dt LO 4
39.Os
40.Sh NAME
41.Nm lo
42.Nd software loopback network interface
43.Sh SYNOPSIS
44.Sy pseudo-device Nm loop Em <number>
45.Sh DESCRIPTION
46The
47.Nm loop
48interface is a software loopback mechanism which may be
49used for performance analysis, software testing, and/or local
50communication.
51As with other network interfaces, the loopback interface must have
52network addresses assigned for each address family with which it is to be used.
53These addresses
54may be set or changed with the
55.Dv SIOCSIFADDR
56.Xr ioctl 2 .
57The loopback interface should be the last interface configured,
58as protocols may use the order of configuration as an indication of priority.
59The loopback should
60.Em never
61be configured first unless no hardware
62interfaces exist.
63.Pp
64Configuring a loopback interface for
65.Xr inet 4
66with the
67.Em link1
68flag set will make the interface answer to the whole set of
69addresses identified as being in super-net which is specified
70by the address and netmask. Obviously you should not set the
71.Em link1
72flag on interface
73.Nm lo0 Ns ,
74but instead use another interface like
75.Nm lo1 Ns .
76.Sh DIAGNOSTICS
77.Bl -diag
78.It lo%d: can't handle af%d.
79The interface was handed
80a message with addresses formatted in an unsuitable address
81family; the packet was dropped.
82.El
83.Sh EXAMPLES
84ifconfig lo1 inet 192.168.1.1 netmask 255.255.255.0 link1
85.Pp
86is equivalent to:
87.Pp
88awk 'BEGIN {for(i=1;i<255;i++) \
89print "ifconfig lo1 inet 192.168.1."i" netmask 255.255.255.255 alias"}'|sh
90.Sh SEE ALSO
91.Xr inet 4 ,
92.Xr inet6 4 ,
93.Xr netintro 4 ,
94.Xr ns 4 ,
95.Xr ifconfig 8
96.Sh HISTORY
97The
98.Nm
99device appeared in
100.Bx 4.2 .
101.Pp
102The wildcard functionality first appeared in
103.Ox 2.3 .
104.Sh BUGS
105Previous versions of the system enabled the loopback interface
106automatically, using a nonstandard Internet address (127.1).
107Use of that address is now discouraged; a reserved host address
108for the local network should be used instead.
109.Pp
110You should be careful using
111.Xr ipnat 8
112with
113.Em link1
114set on an interface, because it may believe the packets are coming
115from a loopback address.
116