Skip to content

bridge: epair pairs and jail loopback on FreeBSD - #11

Merged
ahze merged 1 commit into
mainfrom
feat/bridge-epair-freebsd
Nov 14, 2026
Merged

ahze merged 1 commit into
mainfrom
feat/bridge-epair-freebsd

Conversation

@ahze

@ahze ahze commented Nov 13, 2026

Copy link
Copy Markdown
Member

Give the bridge driver a FreeBSD create_veth_pair: create an epair,
rename the a end to the host name when one is given, set MTU and MAC on
the b end, move it into the jail, rename it there and add the a end to
the bridge, then continue with the shared address, route and up steps.

On teardown the bridge is removed when its member list from BRDGGIFS is
empty, where Linux filters a link dump by controller. Interface indexes
are global across vnets on FreeBSD, so the jail's lo0 is not index 1
and setup addresses it by name there.

With this, setup against a VNET jail gives it eth0 with address, route
and loopback, and the jail pings its gateway; teardown removes the epair
and the empty bridge.

Give the bridge driver a FreeBSD create_veth_pair: create an epair,
rename the a end to the host name when one is given, set MTU and MAC on
the b end, move it into the jail, rename it there and add the a end to
the bridge, then continue with the shared address, route and up steps.

On teardown the bridge is removed when its member list from BRDGGIFS is
empty, where Linux filters a link dump by controller. Interface indexes
are global across vnets on FreeBSD, so the jail's lo0 is not index 1
and setup addresses it by name there.

With this, setup against a VNET jail gives it eth0 with address, route
and loopback, and the jail pings its gateway; teardown removes the epair
and the empty bridge.

Signed-off-by: Michael Johnson <buhnux@gmail.com>
@ahze
ahze merged commit c8fef5f into main Nov 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant