OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Tutorials and FAQs »
  • Building a Transparent Bridge Filter with OPNsense
« previous next »
  • Print
Pages: [1]

Author Topic: Building a Transparent Bridge Filter with OPNsense  (Read 596 times)

rgnldo

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Building a Transparent Bridge Filter with OPNsense
« on: November 05, 2024, 03:56:52 pm »
This how-to aims to guide you through the easy configuration of a Transparent Filtering Bridge on the OPNsense firewall, as explained below.


1. Hardware Initial Setup

Ensure you have at least 3 network interfaces:

LAN (internal network)
WAN (internet connection)
Additional interface for bridge

2. Bridge Configuration

Access Interfaces → Other Types → Bridge
Click "+" to add a new bridge
Configure the following parameters:
Code: [Select]
Description: Bridge_LAN_WAN
Member interfaces: [Select your interfaces]
Enable: checked
Advanced options: Keep default settings
Click "Save"

3. Interface Configuration

Go to Interfaces → Assignments
Add the newly created bridge
Configure member interfaces:
Code: [Select]
IPv4/IPv6 Configuration Type: none
IP address: leave empty
MTU: default
Device Configuration:
- Promiscuous mode: checked

4. Firewall Configuration

Access Firewall → Rules
Configure bridge rules:
Code: [Select]
Action: pass/block
Interface: [your_bridge]
Direction: in/out
Protocol: any/specific
Source/Destination: as needed

5. Enable Filtering

Go to System → Settings → Tunables
Add or verify these parameters:
Code: [Select]
net.link.bridge.pfil_member=1
net.link.bridge.pfil_bridge=0

6. System Commands for Verification:
Code: [Select]
# Check bridge status
ifconfig bridge0

# Verify interface status
ifconfig em0
ifconfig em1

# Check system logs
tail -f /var/log/system.log

# Monitor bridge traffic
tcpdump -i bridge0

7. Network Testing Commands:
Code: [Select]
# Test connectivity
ping 1.1.1.1

# Check routing table
netstat -rn

# View bridge status
pfctl -s state

# Monitor interface traffic
tcpdump -ni em0

Quote
Important Tips

- Back up the configuration before starting

- Maintain physical access to the equipment during configuration

- Document all changes made

- Test in a controlled environment before deploying to production

Common Troubleshooting

Check Connectivity:
Code: [Select]
# Check interface status
ifconfig

# View system messages
dmesg | tail

# Check firewall logs
tail -f /var/log/filter.log

Check Bridge:
Code: [Select]
# Bridge status
ifconfig bridge0

# Bridge statistics
pfctl -s info

Monitoring:
Code: [Select]
# Real-time traffic monitoring
tcpdump -ni bridge0

# System status
top

« Last Edit: November 05, 2024, 04:40:42 pm by rgnldo »
Logged

Monviech (Cedrik)

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: 178
    • View Profile
Re: Building a Transparent Bridge Filter with OPNsense
« Reply #1 on: November 05, 2024, 04:35:33 pm »
This kinda looks like AI generated content at first glance, especially the Key Benefits section.
« Last Edit: November 05, 2024, 04:37:28 pm by Monviech »
Logged
Hardware:
DEC740

Patrick M. Hausen

  • Hero Member
  • *****
  • Posts: 6923
  • Karma: 583
    • View Profile
Re: Building a Transparent Bridge Filter with OPNsense
« Reply #2 on: November 05, 2024, 04:41:09 pm »
Quote from: Monviech on November 05, 2024, 04:35:33 pm
This kinda looks like AI generated content at first glance, especially the Key Benefits section.

And I cannot see any added benefit compared to the official guide:

https://docs.opnsense.org/manual/how-tos/transparent_bridge.html
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Monviech (Cedrik)

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: 178
    • View Profile
Re: Building a Transparent Bridge Filter with OPNsense
« Reply #3 on: November 05, 2024, 04:46:19 pm »
I have no issue with it. If it was a genuine effort, thank you.

If one of your steps here are different or improve the original documentation, please feel free to improve that guide on github.

As reference, some people have issued with the original guide, so if you can improve it: https://github.com/opnsense/docs/issues/614
« Last Edit: November 05, 2024, 04:47:54 pm by Monviech »
Logged
Hardware:
DEC740

rgnldo

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: Building a Transparent Bridge Filter with OPNsense
« Reply #4 on: November 05, 2024, 06:53:50 pm »
Quote from: Monviech on November 05, 2024, 04:35:33 pm
This kinda looks like AI generated content at first glance, especially the Key Benefits section.

My language is Portuguese, and I'm not fluent in written English. I used some correction and suggestion tools for the introduction of the how-to and chose to publish it in English.
Logged

rgnldo

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: Building a Transparent Bridge Filter with OPNsense
« Reply #5 on: November 05, 2024, 06:57:08 pm »
Quote from: Patrick M. Hausen on November 05, 2024, 04:41:09 pm
Quote from: Monviech on November 05, 2024, 04:35:33 pm
This kinda looks like AI generated content at first glance, especially the Key Benefits section.

And I cannot see any added benefit compared to the official guide:

https://docs.opnsense.org/manual/how-tos/transparent_bridge.html

I hope this helps in some way.
Logged

EricPerl

  • Full Member
  • ***
  • Posts: 108
  • Karma: 4
    • View Profile
Re: Building a Transparent Bridge Filter with OPNsense
« Reply #6 on: November 05, 2024, 09:35:31 pm »
Coming from someone who started on OPNsense with a transparent filtering bridge a few weeks back:

Neither of the guides makes recommendations with regards to physical implementation on the existing network, specifically in relationship with an existing router.

The OPN guide disables bogons/privates on the WAN side, merely implying the bridge is within a private network.

This guide says nothing about bogons/privates BTW.

In https://github.com/opnsense/docs/issues/614, the author has it between modem and router, which could actually explain why he has issues accessing the bridge (presumably from the LAN side of the router) depending on the IP used on the management interface. Step 4 in the OPN guide is light on details for noobs.
With a 3rd physical interface used for management, it's my understanding that the bridge could be accessed more naturally from the LAN side.

Another guide I found when I started mentioned that a big drawback of using the bridge on the WAN side of the router meant it would only be exposed to NAT traffic from the main LAN, making correlation to LAN traffic painful at best. That made sense to me.
Logged

rgnldo

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: Building a Transparent Bridge Filter with OPNsense
« Reply #7 on: November 07, 2024, 01:24:28 pm »
Quote from: EricPerl on November 05, 2024, 09:35:31 pm
Coming from someone who started on OPNsense with a transparent filtering bridge a few weeks back:

Neither of the guides makes recommendations with regards to physical implementation on the existing network, specifically in relationship with an existing router.

The OPN guide disables bogons/privates on the WAN side, merely implying the bridge is within a private network.

This guide says nothing about bogons/privates BTW.

In https://github.com/opnsense/docs/issues/614, the author has it between modem and router, which could actually explain why he has issues accessing the bridge (presumably from the LAN side of the router) depending on the IP used on the management interface. Step 4 in the OPN guide is light on details for noobs.
With a 3rd physical interface used for management, it's my understanding that the bridge could be accessed more naturally from the LAN side.

Another guide I found when I started mentioned that a big drawback of using the bridge on the WAN side of the router meant it would only be exposed to NAT traffic from the main LAN, making correlation to LAN traffic painful at best. That made sense to me.

The suggestion of a dedicated third physical interface for management appears to be a logical solution, as it would allow more direct access from the LAN side without NAT restrictions.

Another important point you raised is about exposing the bridge to NAT traffic when placed on the WAN side of the router—a configuration that can complicate detailed LAN traffic analysis and monitoring. This reinforces the need for an implementation where LAN traffic can be easily correlated, perhaps making it more practical to place the bridge on the internal network side.

This could provide good feedback. If there’s a practical effect, we can improve this how-to further.
Logged

Monviech (Cedrik)

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1660
  • Karma: 178
    • View Profile
Re: Building a Transparent Bridge Filter with OPNsense
« Reply #8 on: November 07, 2024, 01:51:03 pm »
It looks like the Zenarmor guide for this goes with 3 interfaces by default.

https://www.zenarmor.com/docs/network-security-tutorials/how-to-configure-transparent-filtering-bridge-on-opnsense
Logged
Hardware:
DEC740

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Tutorials and FAQs »
  • Building a Transparent Bridge Filter with OPNsense
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2