xref: /freebsd/share/man/man4/epair.4 (revision cb2887746f8b9dd4ad6b1e757cdc053a08b25a2e)
1.\"-
2.\" Copyright (c) 2008 The FreeBSD Foundation
3.\"
4.\" This software was developed by CK Software GmbH under sponsorship
5.\" from the FreeBSD Foundation.
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.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.Dd August 12, 2025
29.Dt EPAIR 4
30.Os
31.Sh NAME
32.Nm epair
33.Nd A pair of virtual back-to-back connected Ethernet interfaces
34.Sh SYNOPSIS
35To compile this driver into the kernel,
36place the following line in your
37kernel configuration file:
38.Bd -ragged -offset indent
39.Cd "device epair"
40.Ed
41.Pp
42Alternatively, to load the driver as a
43module at boot time, place the following line in
44.Xr loader.conf 5 :
45.Bd -literal -offset indent
46if_epair_load="YES"
47.Ed
48.Sh DESCRIPTION
49The
50.Nm
51is a pair of Ethernet-like software interfaces,
52which are connected back-to-back with a virtual cross-over cable.
53.Pp
54Each
55.Nm
56interface pair is created at runtime using interface cloning.
57This is most easily done with the
58.Xr ifconfig 8
59.Cm create
60command or using the
61.Va cloned_interfaces
62variable in
63.Xr rc.conf 5 .
64While for cloning you only give either
65.Pa epair
66or
67.Pa epair<n>
68the
69.Nm
70pair will be named like
71.Pa epair<n>[ab] .
72This means the names of the first
73.Nm
74interfaces will be
75.Pa epair0a
76and
77.Pa epair0b .
78.Pp
79Like any other Ethernet interface, an
80.Nm
81needs to have a network address.
82If the tunable
83.Va net.link.epair.ether_gen_addr Ns
84=0, each
85.Nm
86will be assigned a random locally administered address,
87that is only guaranteed to be unique within one network stack.
88The tunable
89.Va net.link.epair.ether_gen_addr Ns
90=1 will generate a stable MAC address with
91.Fx
92OUI using
93.Xr ether_gen_addr 9 .
94This tunable defaults to 1 in
95.Fx 15.0 and might be removed in
96.Fx 16.0 .
97To change the default addresses one may use the SIOCSIFADDR
98.Xr ioctl 2 or
99.Xr ifconfig 8 utility.
100.Pp
101The basic intent is to provide connectivity between two virtual
102network stack instances.
103When connected to an
104.Xr if_bridge 4 ,
105one end of the interface pair can also be part of another (virtual) LAN.
106As with any other Ethernet interface,
107.Nm epair
108can have a
109.Xr vlan 4
110configured on top of it.
111.Sh SEE ALSO
112.Xr ioctl 2 ,
113.Xr altq 4 ,
114.Xr bpf 4 ,
115.Xr if_bridge 4 ,
116.Xr vlan 4 ,
117.Xr loader.conf 5 ,
118.Xr rc.conf 5 ,
119.Xr ifconfig 8
120.Sh HISTORY
121The
122.Nm
123interface first appeared in
124.Fx 8.0 .
125.Sh AUTHORS
126The
127.Nm
128interface was written by
129.An Bjoern A. Zeeb, CK Software GmbH,
130under sponsorship from the FreeBSD Foundation.
131