[BACK]Return to pair.4 CVS log [TXT][DIR] Up to [local] / src / share / man / man4

File: [local] / src / share / man / man4 / pair.4 (download)

Revision 1.4, Fri Oct 30 10:48:55 2015 UTC (8 years, 7 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, HEAD
Changes since 1.3: +20 -1 lines

Add an example about using the Spanning Tree Protocol (STP) to prevent
potential loops between bridges and pairs.

OK jmc@ sthen@

.\"	$OpenBSD: pair.4,v 1.4 2015/10/30 10:48:55 reyk Exp $
.\"
.\" Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
.\" Copyright (c) 2009 Theo de Raadt <deraadt@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: October 30 2015 $
.Dt PAIR 4
.Os
.Sh NAME
.Nm pair
.Nd virtual Ethernet interface pair
.Sh SYNOPSIS
.Cd "pseudo-device pair"
.Sh DESCRIPTION
The
.Nm
interface simulates a normal Ethernet interface by encapsulating
standard network frames with an Ethernet header, specifically for use
in a pair of interfaces that are interconnected with each other.
.Pp
To use it, the administrator needs to create two
.Nm
interfaces and connect them;
the interfaces are
.Sq patched ,
as would be done with physical network ports.
All packets that are sent on the first interface are received on the
second interface.
.Sh EXAMPLES
Set up a pair of interfaces where each of them is a member of a different
.Xr rdomain 4 :
.Bd -literal -offset indent
# ifconfig pair1 rdomain 1 10.1.1.1/24 up
# ifconfig pair2 rdomain 2 10.1.1.2/24 up
# ifconfig pair1 patch pair2
# route -T 1 exec ping 10.1.1.2
.Ed
.Pp
When adding multiple
.Nm
to multiple
.Xr bridge 4
interfaces, it is possible to create a loop;
the system load will go up while it is busy sending packets from one
bridge to another and back.
By design, the driver does not prevent such loops by itself, but it is
possible to use the Spanning Tree Protocol (STP) to detect and remove
loops in the virtual network topology:
.Bd -literal -offset indent
# ifconfig pair0 up
# ifconfig pair1 rdomain 1 patch pair0 up
# ifconfig pair2 up
# ifconfig pair3 rdomain 1 patch pair2 up
# ifconfig bridge0 add pair0 add pair2 stp pair0 stp pair2 up
# ifconfig bridge1 add pair1 add pair3 stp pair1 stp pair3 up
.Ed
.Sh SEE ALSO
.Xr bridge 4 ,
.Xr inet 4 ,
.Xr inet6 4 ,
.Xr rdomain 4 ,
.Xr vether 4 ,
.Xr hostname.if 5 ,
.Xr ifconfig 8 ,
.Xr netstart 8
.Sh HISTORY
The
.Nm
interface first appeared in
.Ox 5.9 .
.Sh AUTHORS
The
.Nm
driver is based on
.Xr vether 4
by
.An Theo de Raadt Aq Mt deraadt@openbsd.org .
It has been extended and turned into
.Nm
by
.An Reyk Floeter Aq Mt reyk@openbsd.org .
.Sh CAVEATS
Unlike
.Xr vether 4 ,
the
.Nm
interface cannot be used as a stand-alone member in a
.Xr bridge 4 :
the link state remains down until it is connected to the second interface.
Any associated routes will be marked down until it is patched.
Use
.Xr vether 4
as a bridge endpoint for routing purposes instead.
.Sh BUGS
Like
.Xr tun 4 ,
the Ethernet address chosen will be partially random, and may
occasionally collide with another address.