Pure non-filering bridge

Started by Cenkron, November 27, 2026, 08:48:25 PM

Previous topic - Next topic
This is clearly an off-mainstram use of OpnSense.

I have a four port device.  I want to configure it as a pure four port (non-filtering) layer 2 bridge, like a switch.
Fire-walling is not a desired or needed feature; the usage is entirely within a protected LAN.
The purpose is to use the built-in traffic measurement capabilities for measuring traffic between devices on the LAN.
The bridge is intended to be used by connecting the measured device(s) to one (or more) port(s) on the bridge, and another port to the rest of the LAN.
Access to the management portion of OpnSense is also desired from any suitable device on the LAN.

I have attempted to set this up, in various ways, but it always seems to be true that no traffic is passed to/from the gateway of the LAN, which is itself an OpnSense router configured normally for its connection to the external WAN.  In addition, OpnSense itself is unable to update because even its traffic can't see the gateway.  No computer on any port of the bridge can see the gateway, which is accessible on another port of the bridge.
All involved LAN networks are the same /24 subnet.

Other than those issues, all other traffic is passed through the bridge between the connected LAN devices.

I have configured the gateway manually.
I have tried configuring rules for passing all traffic through the firewall.
I have tried including the WAN in the bridge, or not.
I have run out of ideas.  I should mention that I am a longtime software engineer that did in the past write protocol level software related to TCP, including the STP protocol, though I am surely a bit rusty on some details of this subject.

Perfectly possible but easier with plain FreeBSD, IMHO.

In OPNsense:

- You do not need a gateway.
- You can disable the firewall.

I ran an OPNsense as a VPN gateway with a single interface, firewalling disabled globally, could have easily replaced the single interface with a bridge spanning all four ports.

So:

- delete WAN (Interfaces > Assignments)
- configure LAN to use DHCP so the system itself can e.g. install updates
- disable firewall
- replace LAN with bridge across all four ports

HTH,
Patrick
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Does it not need to set the bridge tunables too?
If measuring is an important requirement, hardware-depending, it might be an idea to install one of the DRT variants, where you can install the yamon metrics monitor. Linux only.

Quote from: cookiemonster on November 27, 2026, 09:35:17 PMDoes it not need to set the bridge tunables too?

If you disable the firewall, i.e. the "pf" packet filter globally - no.

Just do this, create the bridge, assign "LAN" to the bridge with DHCP (or static, whatever you prefer) so the system can pull updates.

But that's it. A four port system configured as a single bridge will work perfectly well up to Gigabit speeds with FreeBSD. Don't know specifically about 10G and beyond. But probably even 10G will be fine.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Patrick,
Thank you for your quick response.  I had not realized the WAN interface could be deleted.

I have not been able to find how to disable the firewall.

I have done everything else as you gave me.

The bridge works fine on all four ports, but still won't pass the gateway address (which it auto configured using DHCP).
And, still can't update.


Looking further, I finally found the Disable firewall in Firewall | Advanced.
Still, no traffic to the gateway address is passing through the bridge.

Quote from: Cenkron on November 27, 2026, 09:41:39 PMI have not been able to find how to disable the firewall.

Firewall > Settings > Advanced > Disable Firewall

Report back what is missing after that and we will find a solution.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

I misstated the path to the disable control, but I have now disabled the firewall.
It has auto installed the LAN_DHCP gateway, and is correct (192.168.1.1 in my case).
Still, all traffic flows through all four ports of the bridge (using ping) except if to/from the gateway.
(For instance I can list a directory of a machine through the bridge, but can't ping the gateway.)
And, it still won't update, even though it knows the gateway (The gateway router will update).
I can ping the gateway directly (not going through the bridge).

So, I reconfigured LAN to a static address so it would not assign a LAN gateway.
I also saved and scanned the configuration file to make sure the gateway was not configured for anything and it was not.
Pinging the gateway still doesn't work, and other activity through the bridge works, unless it needs to go through the gateway.
I also noticed that the dashboard announcements widget is failing, but I am assuming that is the same problem.

And, I further manually configured a LAN_DHCP gateway, and it changes nothing.
I made sure the LAN interface is included in the bridge interfaces; it is.
The gateway is shown as active, as expected.

Nothing changed.

This is actually the configuration I preferred, since it makes the Dashboard easier to open from the browser.

Just to be clear, "nothing changed" means the bridge is still not passing traffic to/from the gateway.
And, the static address of the LAN management interface is different from the gateway.

Quote from: Cenkron on November 27, 2026, 11:15:57 PMI reconfigured LAN to a static address so it would not assign a LAN gateway

Did you change this because your DNS server is on the same subnet as your DHCP client address but you couldn't resolve names?