|PAIR(4)||Device Drivers Manual||PAIR(4)|
pairinterface 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.
To use it, the administrator needs to create two
pair interfaces and connect them; the interfaces are
‘patched’, as would be done with physical network ports. All
packets that are sent on the first interface are received on the second
# 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
When adding multiple
pair to multiple
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:
# 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
pairinterface first appeared in OpenBSD 5.9.
pairdriver is based on vether(4) by Theo de Raadt <email@example.com>. It has been extended and turned into
pairinterface cannot be used as a stand-alone member in a 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 vether(4) as a bridge endpoint for routing purposes instead.
|October 30, 2015||OpenBSD-current|