Pure non-filering bridge

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

Previous topic - Next topic
Quote from: Cenkron on November 29, 2026, 08:15:29 PMThe one thing I did not do is make a separate management physical interface, because I don't want that.

And you don't need to. All layer 2 ports members of bridge, layer 3 (LAN) assigned to bridge, IP address on that, firewall disabled, done. Seriously. There is no fundamental issue with a configuration like this in FreeBSD, so something is different in your particular case that nobody has yet thought of.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

@Cenkron As you said, a bridge is a layer 2 device. From a layer 2 perspective, a gateway is just a host like any other one.

The discussion does not make it clear what frames are lost where. As Patrick said: Packet capture. Look at what's actually going on on the wire. Work your way up: When attempting to ping the gateway from the OPNsense bridge device itself, does it send corresponding ARP requests? Do these arrive at the gateway? Does the gateway send ARP responses? Do these reach the igc interface on the bridge device? And then the bridge0 interface? If that's all a yes, then check the same for ICMP. If not, at what point does it fail?

Cheers
Maurice
OPNsense virtual machine images
OPNsense aarch64 firmware repository

Commercial support & engineering available. PM for details (en / de).

Today at 06:53:51 AM #47 Last Edit: Today at 08:27:36 AM by lmoore
My digression earlier with IPFW sysctls was related to a problem whereby ARP requests didn't traverse the bridge when dummynet was being used. I didn't record that specific issue and how I overcame it, but after reflecting upon it, I believe it was with Vanilla FreeBSD 15.1 installation where the problem arose and not in OPNsense.

Quote from: Cenkron on November 29, 2026, 08:15:29 PMPerhaps I will try doing it that way, but then I would just have to add another cable to the network switch.

I reviewed my notes from the other month and cobbled together (and tested) notes to simply set up OPNsense with a management interface and a bridge.

It is straightforward to get working with OPNsense, as Patrick has indicated.

If you are plugging all the bridge ports in to a switch, have you considered if STP may be influencing the connections?

Quote
Configuring OPNsense to simply act as a bridge without any firewall features being enabled.

Configuration Information used in this example.

Interface assignments:

   em0    -> [MGMT]
   igb0   -> [BM0]
   igb1   -> [BM1]
   igb2   -> [BM2]

Management IP address: 10.200.128.2/24
Management Gateway address: 10.200.128.1
Internal DNS server: 10.199.201.254

Configuration steps to prepare a system as a Bridge without Firewall using the console.

Lines beginning with '-->' are where input is required in the Command Line Interface (CLI).

Perform a Factory Reset of OPNsense.

 - Connect a computer to the serial port on the OPNsense device using a baud rate of 115200

Note: The same configurations can be performed when using a Video console.
 
 - Power on OPNsense device

Ignore the configuration importer. 

   >>> Invoking import script 'importer'
   Press any key to start the configuration importer: .......

When the message appears regarding interface assignment options, press a key when prompted.

   Default interfaces not found -- Running interface assignment option.

   Press any key to start the manual interface assignment: ..

-->   Do you want to configure LAGGs now? [y/N]: <Enter>

-->   Do you want to configure VLANs now? [y/N]: <Enter>

The list of available interfaces is presented.

   Valid interfaces are:

   igb0             b4:96:91:8c:a0:f8 Intel(R) I350 (Copper)
   igb1             b4:96:91:8c:a0:f9 Intel(R) I350 (Copper)
   igb2             b4:96:91:8c:a0:fa Intel(R) I350 (Copper)
   igb3             b4:96:91:8c:a0:fb Intel(R) I350 (Copper)
   re0              f4:f2:6d:05:4d:60 RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet
   em0              48:4d:7e:ee:1b:4e Intel(R) I219-LM SPT(5)

   If you do not know the names of your interfaces, you may choose to use
   auto-detection. In that case, disconnect all interfaces now before
   hitting 'a' to initiate auto detection.

-->   Enter the WAN interface name or 'a' for auto-detection: <Enter>

   Enter the LAN interface name or 'a' for auto-detection
   NOTE: this enables full Firewalling/NAT mode.
-->   (or nothing if finished): <Enter>

   Enter the Optional interface 1 name or 'a' for auto-detection
-->   (or nothing if finished): em0

   Enter the Optional interface 2 name or 'a' for auto-detection
-->   (or nothing if finished): <Enter>

   The interfaces will be assigned as follows:

   OPT1 -> em0

-->   Do you want to proceed? [y/N]: y

The system will continue booting to the OPNsense banner.

   *** OPNsense.internal: OPNsense 26.7.10 (amd64) ***

    OPT1 (em0)      ->

    HTTPS: SHA256 36 04 DE 9A 62 99 50 75 CA 46 24 CE AD 54 A1 3E
               77 8C A0 C0 17 41 DC 99 43 C8 CE 87 42 B9 13 98

   FreeBSD/amd64 (OPNsense.internal) (ttyu0)

-->   login: root

Log in as root.

   ------------------------------------------------
   |       Hello, this is OPNsense 26.7           |           :::::::.
   |                                              |           :::::::::.
   |  Website:     https://opnsense.org/          |        :::        :::
   |  Handbook:    https://docs.opnsense.org/     |        :::        :::
   |  Forums:      https://forum.opnsense.org/    |        :::        :::
   |  Code:        https://github.com/opnsense    |         `:::::::::
   |  Reddit:      https://reddit.com/r/opnsense  |           `:::::::
   ------------------------------------------------

   *** OPNsense.internal: OPNsense 26.7.10 (amd64) ***

    OPT1 (em0)      ->

    HTTPS: SHA256 36 04 DE 9A 62 99 50 75 CA 46 24 CE AD 54 A1 3E
               77 8C A0 C0 17 41 DC 99 43 C8 CE 87 42 B9 13 98

     0) Logout                              7) Ping host
     1) Assign interfaces                   8) Shell
     2) Set interface IP address            9) pfTop
     3) Reset the root password            10) Firewall log
     4) Reset to factory defaults          11) Reload all services
     5) Power off system                   12) Update from console
     6) Reboot system                      13) Restore a backup

-->   Enter an option: 2

-->   Configure IPv4 address OPT1 interface via DHCP? [y/N] <Enter>

   Enter the new OPT1 IPv4 address. Press <ENTER> for none:
-->   > 10.200.128.2


   Subnet masks are entered as bit counts (like CIDR notation).
   e.g. 255.255.255.0 = 24
       255.255.0.0   = 16
       255.0.0.0     = 8

   Enter the new OPT1 IPv4 subnet bit count (1 to 32):
-->   > 24

   For a WAN, enter the new OPT1 IPv4 upstream gateway address.
   For a LAN, press <ENTER> for none:
-->   > 10.200.128.1

-->   Do you want to use the gateway as the IPv4 name server, too? [Y/n] n
   Enter the IPv4 name server or press <ENTER> for none:
-->   > 10.199.201.254

-->   Configure IPv6 address OPT1 interface via DHCP6? [y/N] <Enter>

   Enter the new OPT1 IPv6 address. Press <ENTER> for none:
-->   > <Enter>

-->   Do you want to enable the DHCP server on OPT1? [y/N] <Enter>

-->   Do you want to change the web GUI protocol from HTTPS to HTTP? [y/N] <Enter>

-->   Do you want to generate a new self-signed web GUI certificate? [y/N] <Enter>

-->   Restore web GUI access defaults? [y/N] <Enter>

The OPNsense banner after IP assignment.

   You can now access the web GUI by opening
   the following URL in your web browser:

      https://10.200.128.2

   *** OPNsense.internal: OPNsense 26.7.10 (amd64) ***

    OPT1 (em0)      -> v4: 10.200.128.2/24

    HTTPS: SHA256 36 04 DE 9A 62 99 50 75 CA 46 24 CE AD 54 A1 3E
               77 8C A0 C0 17 41 DC 99 43 C8 CE 87 42 B9 13 98

     0) Logout                              7) Ping host
     1) Assign interfaces                   8) Shell
     2) Set interface IP address            9) pfTop
     3) Reset the root password            10) Firewall log
     4) Reset to factory defaults          11) Reload all services
     5) Power off system                   12) Update from console
     6) Reboot system                      13) Restore a backup

-->   Enter an option: 3

   The root user login behaviour will be restored to its defaults.

-->   Do you want to proceed? [y/N]: y

-->   Type a new password: <some new password>
-->   Confirm new password: <re-enter new password>

   The root user has been reset successfully.

   *** OPNsense.internal: OPNsense 26.7.10 (amd64) ***

    OPT1 (em0)      -> v4: 10.200.128.2/24

    HTTPS: SHA256 41 F9 BC 9E 68 DB C6 2A 56 01 3A E9 8C EA B0 29
               4F 15 B2 AF 4A 71 16 86 CC 05 B8 19 EB 44 6F 20

     0) Logout                              7) Ping host
     1) Assign interfaces                   8) Shell
     2) Set interface IP address            9) pfTop
     3) Reset the root password            10) Firewall log
     4) Reset to factory defaults          11) Reload all services
     5) Power off system                   12) Update from console
     6) Reboot system                      13) Restore a backup

-->   Enter an option: 0


   FreeBSD/amd64 (OPNsense.internal) (ttyu0)

   login:


Patch the network cable from your management network in to em0 and log in using the WebGUI.

Wait for the System: Configuration: Wizard to appear and click on the Abort button.

 - System Configuration Wizard
   - Welcome tab
   - Click 'Abort'

Disable Hostwatch Discovery.

 - Interfaces -> Hostwatch-> Settings
   - Enabled: untick
   - Click 'Apply'


Update description for OPT1.

 - Interfaces -> [OPT1]
   - Lock: 'tick' - Prevent interface removal
   - Description: MGMT
   - Click 'Save'
   - Click 'Apply changes'

Assign the interfaces which will be used as bridge members.

 - Interfaces -> Assignments
   - Add
   - Description: BM0
   - Select device from drop-down list: igb0 (b4:96:91:8c:a0:f8)
   - Click 'Save'

   - Add
   - Description: BM1
   - Select device from drop-down list: igb1 (b4:96:91:8c:a0:f9)
   - Click 'Save'

   - Add
   - Description: BM2
   - Select device from drop-down list: igb2 (b4:96:91:8c:a0:fa)
   - Click 'Save'

Add and assign the Bridge interface.

 - Interfaces -> Devices -> Bridge
   - Add
   - Member interfaces: BM0, BM1, & BM2
   - Description: BRIDGE0
   - Enable link-local address 'tick'
   - Click 'Save'
   - Click 'Apply'

 - Interfaces -> Assignments
   - Add
   - Description: BRIDGE0
   - Select device from drop-down list: bridge0 (BRIDGE0)
   - Click 'Save'
   - Click 'Apply'

If you do not see the newly assigned BRIDGE0 interface under Interfaces, refresh the browser page (F5).

 - Interfaces -> [BRIDGE0]
   - Enable: 'tick'
   - Lock: 'tick' - Prevent interface removal
   - IPv4 Configuration Type: None
   - IPV6 Configuration Type: None
   - Click 'Save'
   - Click 'Apply changes'

Disable firewall functions.

 - Firewall -> Settings -> Advanced
   - Disable Firewall: 'tick' Disable all packet filtering
   - Click 'Save'

Configure System DNS settings

 - System -> Settings -> General -> Networking
   - DNS Server options: 'tick' Do not use the local DNS service as a nameserver for this system
   - Click 'Save'

Disable the Unbound service.

 - Services -> Unbound -> General
   - Enable Unbound: 'un-ticked'
   - Click 'Apply'

Patch the network lead from the other OPNsense router/firewall in to igb0.

Patch the network lead from the device under test in to igb1.

If the device under test is able to respond to icmp-echo requests, it will respond to ping.

Review the status of the interfaces in Interfaces -> Overview.

Quote
         +-----------------+                 +-----------------+
Internet |                 |      BM0 (igc0) |     (Bridge)    |     BM1 (igc1)
-------->| OPNsense Router |---------------->|     OPNsense    |----------> DUT
         |                 |                 |    No Firewall  |
         +-----------------+                 |                 |     BM2 (igc2)
                                             |                 |----------> DUT
                                             |                 |
                                             +-----------------+
                                                      | Management - MGMT (em0)
                                                      |-------------------> Switch - Access port