Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - beneix

#1
I have used OPNSense for over five years now. I have gradually introduced more and more advanced configurations such as road warrior Wireguard access, OpenVPN client, VLANs, various plugins, etc. All along, I have felt that I was behind the learning curve on really understanding the firewall rules, NAT, interfaces/aliases and gateways. I have somehow managed to get things working, but sometimes without understanding why. I find the interaction between these concepts particularly confusing.

Now I would like to address my knowledge deficit and learn these things properly before I attempt the long-delayed migration from legacy firewall rules. I would appreciate pointers to good learning resources that will help.
#2
26.7, 26.10 Series / Re: Setting up WAN failover
October 19, 2026, 07:04:33 PM
I rebooted the router. Now everything is working (beats me).

Next step is to take the plunge on migrating my legacy firewall rules...I think I will let that wait until I have my fibre broadband back, the hassle around this failover WAN setup has caused enough pain 😊.
#3
26.7, 26.10 Series / Re: Setting up WAN failover
October 19, 2026, 05:41:17 PM
Quote from: viragomann on October 19, 2026, 05:16:03 PM
Quote from: beneix on October 19, 2026, 04:30:42 PMI am still running legacy rules, and this is what I have added to enable the failover:

LAN: Any source and port to any destination and port via gateway WAN_FAILOVER (my new group): pass
This rule forces all LAN traffic to the active gateway. If this rule is on upper position, it also catches traffic, which is destined to OPNsense itself, e.g. DNS requests.

If the default route goes to this gateway group, there is no need to state it in the rule at all. So this rule would only be applied to outbound traffic.

Otherwise you need separate rules to allow access to local destinations, which you have put above of the policy routing rule.
That rule is at the botttom. I have just added a rule above it for DNS from the LAN to reach the router itself. Thats has actually fixed general traffic from my LAN to the failover WAN so now I have achieved my prinicpal objective. I also had to add rules similar to the DNS for two services running on the router at different ports. Thanks for the pointer.

I just have one last problem - the router itself can't reach the internet for system updates, plugins, announcements, etc. I find that strange since the new WAN has the same rules as the main one, and on the LAN there are no rules for standard traffic with the source (self). What do I need to add to give OPNSense access to the new WAN via the new gateway group?
#4
Thanks Cedrik. I have opened a new thread under 26.7, since that is what I am running and the topic has changed.
#5
26.7, 26.10 Series / Setting up WAN failover
October 19, 2026, 04:30:42 PM
I lost our fibre connection this morning so I am trying to set up WAN failover. I have got far enough that I can ping ip addresses but not web addresses from my OPNSense and from LAN clients, but I have no other connectivity. That leads me to believe I have a problem with my firewall. I am still running legacy rules, and this is what I have added to enable the failover:

LAN: (in) Any source and port to any destination and port via gateway WAN_FAILOVER (my new group): pass
WAN_tethered_USB: only auto-generated rules
NAT outbound: only auto-generated rules, which includes newly created rules for my failover WAN identical to the ones for the fibre WAN.

The new WAN_FAILOVER gateway group has my fibre gateway as Tier 1 and my new USB modem as Tier 2. The modem interface is showing green and, as I said, I can ping the world from an SSH shell on the box. No other traffic seems to work (including the "Announcements" section on the dashboard).

The fact that I can ping out tells me that there is no problem with the interface, gateway or gateway group setup but that there must be a firewall issue. Any suggestions?
#6
Thanks @Patrick. Since my OPNsense router has no connectivity, I need to perform an offline install of the plugin. Is this the correct plugin?

https://pkg.opnsense.org/FreeBSD:15:amd64/26.7/latest/All/os-firewall-legacy-1.1.pkg
#7
Quote from: Monviech (Cedrik) on July 02, 2026, 10:33:27 AMOld rules have a distinct command button that opens the legacy rule page, and cannot be deleted/cloned in the new GUI

You still have to migrate eventually.

In 26.7 the old rules will be turned into a plugin, so they will still work. No pressure to migrate yet.
I have not yet taken the plunge to migrate. Today, I went to my rules for the first time in years and was going to edit one of my rules because I need to add a failover 5G gateway as my fibre broke this morning. To my surprise, all my rules seem to be read-only – the only command button is the button that takes me to the migration instructions, there is no edit button. Is this to be expected – that in order to make changes to my rules I have to migrate?

Incidentally, I am using Firefox but tried the same page in Chrome as well.
#8
Quote from: viragomann on October 04, 2026, 07:59:46 PMApart from a proper Wireguard configuration and a rule on the wg interface, which allow access to any destination, you need a source NAT rule like this:

interface: WAN
source: wg tunnel subnet
destination: any
translation: interface address (default)

Thanks! That is all that was needed. Now I just need to gather courage to one day migrate my legacy rules...😊
#9
I have set up a Wireguard tunnel on my OPNSense router so that I can connect remotely via this to my LAN. I am able to reach both the OPNsense router itself and clients/servers on my LAN. However, I cannot reach the WAN and the internet. Occasionally when travelling, it could be useful to access the internet and get my home IP.

I assume this is a simple firewall rule, but for the life of me, I have not managed to open up the access (I have always found the whole firewall rules topic very confusing). Does anyone else have the same configuration and a wokring WAN access rule?
#10
Quote from: lmoore on August 18, 2026, 08:12:28 PMOne cause can be a corrupt configuration file. Go to Services -> Apcupsd -> Settings and apply the settings.

HTH.

OK, that never helped, but after upgrading to 26.7.5 the error has gone away.
#11
I do not have NUT installed. I found these entries in the backend log, but they aren't too helpful as there is no clue to why apcaccess returns exit status 1:

2026-08-18T16:56:49
Error
configd.py
[ba0645b2-b032-4318-b12a-b5c037461565] Script action failed with Command '/usr/local/sbin/apcaccess ' returned non-zero exit status 1. at Traceback (most recent call last): File "/usr/local/opnsense/service/modules/actions/script_output.py", line 93, in execute subprocess.run(script_command, env=self.config_environment, shell=True, ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ check=not self.disable_errors, stdout=output_stream, stderr=error_stream) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/subprocess.py", line 577, in run raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '/usr/local/sbin/apcaccess ' returned non-zero exit status 1.
2026-08-18T16:56:39
Error
configd.py
[4740dfe5-0cc3-4a44-8aec-902f153d0d7f] Script action failed with Command '/usr/local/sbin/apcaccess ' returned non-zero exit status 1. at Traceback (most recent call last): File "/usr/local/opnsense/service/modules/actions/script_output.py", line 93, in execute subprocess.run(script_command, env=self.config_environment, shell=True, ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ check=not self.disable_errors, stdout=output_stream, stderr=error_stream) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/subprocess.py", line 577, in run raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '/usr/local/sbin/apcaccess ' returned non-zero exit status 1.
2026-08-18T16:56:29
Error
configd.py
[f34fb567-56f2-4914-b3dd-083688ded618] Script action failed with Command '/usr/local/sbin/apcaccess ' returned non-zero exit status 1. at Traceback (most recent call last): File "/usr/local/opnsense/service/modules/actions/script_output.py", line 93, in execute subprocess.run(script_command, env=self.config_environment, shell=True, ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ check=not self.disable_errors, stdout=output_stream, stderr=error_stream) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/subprocess.py", line 577, in run raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '/usr/local/sbin/apcaccess ' returned non-zero exit status 1.
2026-08-18T16:56:19
Error
configd.py
[edd0785d-d8de-4189-888c-146b543a9198] Script action failed with Command '/usr/local/sbin/apcaccess ' returned non-zero exit status 1. at Traceback (most recent call last): File "/usr/local/opnsense/service/modules/actions/script_output.py", line 93, in execute subprocess.run(script_command, env=self.config_environment, shell=True, ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ check=not self.disable_errors, stdout=output_stream, stderr=error_stream) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/subprocess.py", line 577, in run raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '/usr/local/sbin/apcaccess ' returned non-zero exit status 1.
2026-08-18T16:56:09
Error
configd.py
[1282142a-6513-4ea2-896c-b806c61638fe] Script action failed with Command '/usr/local/sbin/apcaccess ' returned non-zero exit status 1. at Traceback (most recent call last): File "/usr/local/opnsense/service/modules/actions/script_output.py", line 93, in execute subprocess.run(script_command, env=self.config_environment, shell=True, ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ check=not self.disable_errors, stdout=output_stream, stderr=error_stream) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/subprocess.py", line 577, in run raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '/usr/local/sbin/apcaccess ' returned non-zero exit status 1.
#12
I performed a series of updates after returning from holidays. I updated 26.1.8_5 --> 26.1.11_10 --> 26.7.1_1 --> 26.7.2_2. The apcupsd plugin no longer starts and on the dashboard it states "Error: empty output from apcaccess". I think it broke already with the update to 26.1.11_10, but I am not sure.

Is this a known issue? There is no error in the log, just a notice that apcupsd is starting.
#13
In the client peer definition, it's 0.0.0.0/0. On the OPNSense side, it's 192.168.5.2/32.
#14
I must admit that no matter how much I read about firewall rules, it never becomes intuitive or clear to me...so please, if anyone can help me here.

I have a working Wireguard set-up so that I can access my OPNSense router at home from any external location. When I connect, I get access to the LAN, I can manage my router and I can access my NAS via the LAN. However, I cannot access the WAN. I assume I need to add some rule to the firewall, but I really can't figure out how this rule should be defined.

I have attached screenshots of the existing rules for Wireguard and Wireguard (group).
#15
Quote from: viragomann on October 03, 2025, 01:09:34 PM
Quote from: beneix on October 02, 2025, 09:54:06 PMOK, what I am missing is the part of how to set up the VLAN so that all traffic from it routes via the VPN.

All necessary steps are explained above.

If you have trouble anyway, show all details of your settings, please.
OK, here goes. It's the first time I respond to that type of request so if there is a different way I should share the settings, please let me know.
VPN:



Gateways:



The two relevant VPN interfaces:


Details:



Assignments:


Devices:


Aliases:


Firewall:





DHCP: