I did a fair bit of reading about how and why one might create a bridge interface
because network engineering has never been my strongest suit. In the end I had questions which
I could only find an answer to by doing it wrong a couple of different ways. So here's my
Just Me Questions with answers.
What information do I need to configure a bridge at minimum?
The 'name unit' names that the kernel calls the network interface cards. Like nfe0 and fxp1 &m.
What if the kernel doesn't id the NIC?
Then it can't be used to bridge. Them's the rules. So solve that, first.
Then what do?
ifconfig bridge create name TacomaNarrows0
What happens if I type that?
The kernel will create a tragically empty bridge named, here, TacomaNarrows0. If the last two words
are left off, it'll be named bridge0, bridge1, bridge2 & so on. There's no need for there to be a number
on the end, so an alphanumeric string like 'TacomaNarrowsBr' is a valid name, up to (as of writing)
15 characters.
Why did I need the Network Interface Card identifiers?
To do this:
ifconfig bridge TacomaNarrows0 addm NIC1 addm NIC2 [addm NIC3 ...] up
Why did I do that?
That puts the support pillars under the bridge. Looked at on a different scale, a bridge is a straw.
The straw needs at least two ends so that packet fluid can come in to the straw & leave the straw.
The straw can even have more than two ends. A bridge support is a straw end is a network interface.
What should defaultrouter be set to in my /etc/rc.conf?
Nothing. Don't need one. The bridge will pass packets through it and is otherwise not making route
decisions for packets.
Do I need the /etc/rc.conf 'gateway_enabled' setting configured to YES?
Greatly surprising me, no. A bridge isn't a router, it makes no decisions beyond copying a packet from one
network interface to send out a different network interface or not doing that copy.
it's not serving as a gateway.
Where do I configure an address to reach the bridge from another machine?
On the bridge. It can be given an inet address including by invoking dhclient against the bridge.
The pillars / added member NICs shouldn't have addresses. They're being used purely for their
low level connections.
Okay that's cool but I did all that & I rebooted & the computer forgot all that stuff. What do?
Use sysrc to inject the configuration straight into your boot.
sysrc cloned_inferfaces+="TacomaNarrows0" # the += appends so we don't clobber existing values
sysrc ifconfig_TacomaNarrows0="addm NIC1 addm NIC2 [addm NIC3 ...] up"
sysrc ifconfig_firstNIC=up
sysrc ifconfig_secondNIC=up &m
How do I know it worked?
Take something now connecting more directly to the internet & move it to attach to the bridge
system, instead. It should see approximately no difference aside from any expected slow down from the
additional network hop(s) introduced by having the bridge in line with traffic.
Is this something I need a fancy new computer to do?
By no means. A hunk of junk potato pulled from curb side abandonment can do it, if it can run freebsd.
With enough NIC cards, entirely frivolous network topologies become possible. USB ethernet dongles exist, too.
Okay but why even do this?
Go back to those links in the opening & read the uses cases. That's some cool as hell stuff one can
do with, to & for the traffic coming through their home internet.
Does this work only with wired NICs?
Not at all. Wireless NICs work as do imaginary (software defined) NICs. But I'm still answering the
questions which I have about WiFi before I tackle that, so you'll need to seek guidance elsewhere
if you go that route.