Skip to main content

network-bridge

The network-bridge driver joins two or more of the bench's network ports into one Layer 2 network, the same as plugging them into one switch. Use it to put several DUTs on one segment, or to connect a DUT port straight to the network the bench itself uses.

A bridge is a virtual peripheral: there's no hardware behind it beyond the ports it joins.

PropertyValue
kindnetwork-bridge
Interfacesethernet
locationsTwo or more bench port names, such as [wired1, wired2]

Examples​

Two DUT ports on one segment, with the bench holding an address on it:

lab_bridge:
kind: network-bridge
name: "Lab bridge"
description: "wired1 + wired2 on one segment"
locations: [wired1, wired2]
interfaces:
- type: ethernet
config:
mode: static
address: 192.168.77.1/24
gateway: 192.168.77.254

A DUT port on the bench's own network:

wan_bridge:
kind: network-bridge
name: "WAN bridge"
description: "Exposes wired3 to the DUT's real network"
locations: [wired3, upstream]
interfaces:
- type: ethernet
config:
mode: disabled

Symbol​

The bench uses a bridge's symbol as the name of the Linux bridge it creates, so the symbol has extra rules:

  • It's at most 15 characters long.
  • It isn't one of the bench's own port names: upstream, upstream-br, wired<N>, or wifi<N>.

Locations​

A bridge uses locations, a list of port names, instead of location:

  • List at least two ports, each once. See network-interface for the port names.
  • A port belongs to at most one bridge, and can't also be a network-interface entry.
  • A bridge can't list another bridge.

Joining the bench's own network​

upstream is allowed in locations, though not as a network-interface location. Listing it adds the other ports to the bridge that carries the bench's own connection. A DUT on one of those ports sits on the same network as the bench, and gets its address from that network's DHCP server.

The bench keeps managing its own address on that bridge, so the interface block must use mode: disabled, or you can leave the interface out entirely. [wired3, upstream] counts as two ports.

caution

A DUT on an upstream bridge is directly on your site network, with no isolation from other devices there. Use it only where the DUT is allowed on that network.

Interface​

A bridge that doesn't include upstream declares exactly one ethernet interface. It takes the same settings as a network-interface Ethernet port, with a narrower set of modes:

ModeWhat the bench does
disabledTakes the bridge's link down.
staticTakes a fixed address on the bridge.
dhcp-clientTakes an address from a DHCP server on the bridged network.
dhcp-serverServes DHCP and DNS to devices on every port of the bridge.

The WiFi modes aren't available on a bridge.

Use it​

Check the bridge's link, mode, and addresses:

mimick peripheral info lab_bridge