TPMR(4)
π¦ tpmr β the IEEE 802.1Q Two-Port MAC Relay interface, bestie edition
okay so this page is TPMR(4) from the Kernel Interfaces Manual β it's a section 4 man page, aka a driver/device page, and we're about to make it make sense π
β¨ NAME β¨
tpmr β the IEEE 802.1Q Two-Port MAC Relay interface. that's it, that's the whole name, and honestly? iconic.
π SYNOPSIS π
pseudo-device tpmr
literally one line. we love a low-maintenance icon π«Ά
π DESCRIPTION π
okay so the tpmr driver implements an 802.1Q (originally 802.1aj, for the history girlies) Two-Port MAC Relay, aka a TPMR. think of it as a simplified Ethernet bridge that has exactly two member ports β no more, no fewer, two β and it unconditionally relays Ethernet packets between those ports. no filtering drama, no inner monologue, it just relays. periodt.
you can create tpmr interfaces at runtime in two ways:
- using the
ifconfig tpmrN createcommand, or - by setting up a
hostname.if(5)configuration file fornetstart(8).
ngl, if you want other flavours of Ethernet bridging, those exist too:
and if what you actually want is link aggregation of Ethernet interfaces, that's a whole different vibe β go look at the aggr(4) and trunk(4) drivers.
π₯ IOCTLS π₯
these are the ioctl(2) calls and their structures that get commonly used by tpmr and bridge(4):
SIOCBRDGADDSIOCBRDGDEL
that's the list. short, sweet, two icons only π
β EXAMPLES β
π cross-connecting different physical media
tpmr can be used to cross-connect Ethernet devices that support different physical media β yes, it's giving matchmaker energy π
for example: a device that supports a 100baseTX half-duplex connection can be connected to a switch with 1000baseSX optical ports by using tpmr with a pair of physical network interfaces, each of which supports the required media types.
so if fxp(4) is used to connect to the 100baseTX device, and em(4) is used to connect to the 1000baseSX switch, the following configuration can be used:
# ifconfig tpmr0 create
# ifconfig tpmr0 add fxp0 add em0
# ifconfig fxp0 up
# ifconfig em0 up
# ifconfig tpmr0 up
slay. that's it, that's the setup β¨
π¦ chaining TPMRs to transport traffic over another network
multiple TPMRs can be chained to transport Ethernet traffic for a pair of devices over another network. so given two physically separate Ethernet switches, TPMRs can be used as follows to provide a point-to-point Ethernet link between them.
here's the tea: tpmr with the link0 flag set allows the use of the Link Aggregation Control Protocol (LACP) or Spanning Tree Protocol (STP) by the switches to detect communication failures or connectivity loops respectively β which is not possible using bridge(4), because bridge(4) filters those protocols. so like, it's genuinely the better tool for that specific job. no cap π«Ά
so if Host A connected to Router B has the external IP address 192.0.2.10 on em0, Host D connected to Router C has the external IP address 198.51.100.14 on em0, and both hosts have em1 connected to the switches, the following configuration can be used to connect the switches together. and etherip(4) is what's used to transport the Ethernet packets over the IP network.
here's the diagram, keeping it exactly as it was drawn:
Switch X ---- Host A ---------- tunnel ----------- Host D ---- Switch E
\ /
\ /
+---- Router B ---- Router C ----+
step one: create the tpmr and etherip(4) interfaces:
# ifconfig etherip0 create
# ifconfig tpmr0 create link0
step two: configure the etherip interface:
(on Host A) # ifconfig etherip0 tunnel 192.0.2.10 198.51.100.14 up
(on Host D) # ifconfig etherip0 tunnel 198.51.100.14 192.0.2.10 up
step three: add the etherip interface and physical interface to the TPMR:
# ifconfig tpmr0 add em1 add etherip0 up
and if IP as a transport isn't your vibe, an equivalent setup using MPLS pseudowires instead of IP as the transport can be built using mpw(4) interfaces. options, bestie, we love options π
π SEE ALSO π
go read them, i'll wait π
πΈ HISTORY πΈ
the tpmr driver first appeared in OpenBSD 6.6. baby driver, grown-up energy ππ
and that's the whole page, bestie! this one came from the Debian build of the manual, dated July 28, 2021 β so go forth, relay some packets between exactly two ports, and remember: unconditional means unconditional π β¨π
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2019 David Gwynne <dlg@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms