top of page

OPNSense - Bridging LAN ports

  • snowleopard8753
  • Mar 24, 2024
  • 3 min read

By default, for every interface/port added into OPNSense, they will be isolated from each other, hence, each port has it's own subnet. For example, eth1 has a gateway @ 192.168.18.1 while eth2 has a gateway @ 192.168.19.1


So in this post, we will bridge all the LAN ports together and shared a single gateway 192.168.18.1 just like a typical consumer router off the shelf.


OPNSense machine with 6 ethernet ports labelled

Before we begin, it will be helpful to visit one of the earlier post whereby the OPNSense was installed from scratch.


So we will assumed the following state:

  • OPNSense installed

    • eth0 as WAN

    • eth1 as LAN @ 192.168.1.1 (default)

  • Add the remaining interfaces (eth2, eth3, eth4 and eth5) are added and ENABLED without any further configuration as shown below


OPNSense dashboard interfaces


  • Click Interfaces -> Other Types -> Bridge -> + icon

OPNSense adding a bridge interface

  • Select eth2, eth3, eth4 and eth5 and click Save

  • Skip eth1 (for now) as we need the interface to continue configuring the OPNSense @ 192.168.1.1

OPNSense creating a bridge interface


  • Click Interfaces -> Assignment -> Add -> click Save

OPNSense adding a bridge interface

  • Click Interfaces -> OPT5 -> check "Enable Interface" box -> rename description -> Select "Static IPv4" -> set IPv4 address @ 192.168.18.1/24 -> Click Save

  • Finally click Apply changes @ top right hand corner (not shown below)

OPNSense enable newly added interface


  • Click Services -> ISC DHCPv4 -> BridgeLAN

    • Check "Enable DHCP server on the BridgeLAN interface"

    • Key in the IP range from 192.168.18.10 - 192.168.18.254

      • Start from 10 to reserve some IPs for static purposes (e.g. 192.168.18.9)

    • Click Save

    • Click restart DHCP at top right hand corner

OPNSense enable DHCP service


  • Click Firewall -> Rules -> BridgeLAN -> + icon

OPNSense add firewall rule


  • Leave all settings @ default and click Save

  • Click Apply changes @ top right hand corner (not shown below)

OPNSense create firewall rule


  • A single firewall rule has been created for BridgeLAN (for internet purposes)

  • Click + icon to create another rule

OPNSense summary of firewall rules


  • Select "BridgeLAN" for interface

  • Select "BridgeLAN net" for both source and destination

  • Click Save and Apply changes (not shown below)

OPNSense create firewall rule


  • Finally, 2 firewall rules (internet & intranet) have been created for BridgeLAN

OPNSense summary of firewall rules


  • Click System -> Settings -> Tunables

  • Using your browser "Ctrl+F" to search for "bridge"

OPNSense tunables for bridge interface


  • Type a value "1" (default: 0) and click Save

OPNSense tunables enable filtering on bridge interface

  • Type a value "0" (default: 1) and click Save

  • Click Apply changes @ top right hand corner (not shown below)

OPNSense tunables disable filtering on bridge members interface



We have now setup a bridge with eth2, eth3, eth4 and eth5 included and configuration (interface enabled, DHCP, firewall & tunables) have been configured.


Now is the time to include the last eth1 which we are using to access the OPNSense WebGUI to perform the earlier configuration. Do note that, you will lose assess to the WebGUI due to a change in gateway from 192.168.1.1 to 192.168.18.1.


  • Click Services -> ISC DHCPv4 -> eth1 -> Uncheck "Enable DHCP" box

  • Click Save (not shown below)

OPNSense disable DHCP on interface


  • Click Interfaces -> eth1 -> Select "None" @ IPv4 configuration type

  • Click Save and Apply changes at top-right hand corner (not shown below)

OPNSense disable static IPv4 at interface

Right at this moment, you will lose connection to the OPNSense WebGUI since DHCP and gateway IP have been removed for eth1.


You can plug into eth2 and access the OPNSense WebGUI via your browser @ 192.168.18.1 to finish up the remaining configuration.


  • Click Interfaces -> Other Types -> Bridge -> Edit icon

OPNSense edit bridge interface


  • Select "eth1" to select (ensure there's a black tick beside it)

  • Click Save

OPNSense add an interface to bridge

  • Finally, all (except eth0 for WAN) interfaces/ports have been added into the BridgeLAN family

OPNSense summary of all interfaces at bridge



Testing the bridge interface


Below is a recommended testing matrix with a single connection:


  • Using the same ethernet port @ notebook (thus, same MAC address), you should get the same IP address (192.168.18.10) issued from the Bridge DHCP regardless which port you plug into the OPNSense machine

Ports / Test cases

Correct IP from DHCP?

Internet access?

OPNSense WebGUI access?

eth1

192.168.18.10

OK

OK

eth2

192.168.18.10

OK

OK

eth3

192.168.18.10

OK

OK

eth4

192.168.18.10

OK

OK

eth5

192.168.18.10

OK

OK


Below is a recommended testing matrix for conducting a ping test between ports:


Ports

eth1

eth2

eth3

eth4

eth5

eth1


OK

OK

OK

OK

eth2

OK


OK

OK

OK

eth3

OK

OK


OK

OK

eth4

OK

OK

OK


OK

eth5

OK

OK

OK

OK


eth2 @ 192.168.18.11

eth5 @ 192.168.18.10


Ping from eth2 to eth5

OPNSense ping test

Ping from eth5 to eth2

OPNSense ping test

Congratulations! You have successfully bridged all the LAN ports with a single gateway @ 192.168.18.1!


Recommended posts


  1. Click here for hardware and assembly used in this post

  2. Click here for a fresh installation of OPNSense

Comments


bottom of page