OPNsense Forum

English Forums => 25.7 Series => Topic started by: rarcel on September 10, 2025, 02:45:13 PM

Title: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: rarcel on September 10, 2025, 02:45:13 PM
Hi,

I have a strange issue since the upgrade to 25.7.3_3.

On a wireguard interface, an existing rule with an alias in the source address field doesn't work anymore. If I put "Any" instead of the alias, the rule works again (even if it's not what I want ^^ ).

Do I miss a breaking change ?

Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: franco on September 10, 2025, 02:59:16 PM
Hi,

If you had 25.7.3 and grabbed 25.7.3 did you also hit "apply" under firewall: aliases?

And which alias type would that be exactly that doesn't work?


Cheers,
Franco
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: rarcel on September 10, 2025, 03:18:57 PM
 Hi,

I just did it, and unfortunately, it still doesn't work.

Aliases types are all "Hosts" in my case.
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: Patrick M. Hausen on September 10, 2025, 03:19:43 PM
And a packet trace or firewall log shows that the packets in question really match the source address in the alias?
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: rarcel on September 10, 2025, 03:23:36 PM
Yes it matches the alias, sorry I should mention it
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: rarcel on September 10, 2025, 03:27:42 PM
Here is the content of the capture (nc -v 192.168.1.8 22 from 192.168.21.4 ) :

length 64: (tos 0x0, ttl 64, id 19606, offset 0, flags [DF], proto TCP (6), length 60)
    192.168.21.4.60366 > 192.168.1.8.22: Flags , cksum 0x5721 (correct), seq 840528611, win 65424, options [mss 1392,sackOK,TS val 3660705569 ecr 0,nop,wscale 7], length 0

Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: Patrick M. Hausen on September 10, 2025, 03:39:30 PM
Ok, then please show the rule definition.
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: rarcel on September 10, 2025, 03:39:42 PM
I think I see why it doesn't work, in Diagnotistics/ Aliases, the alias I try to use is empty, whatever I do (I tried to change the content, Hit the apply button), the table is still empty
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: Patrick M. Hausen on September 10, 2025, 03:40:54 PM
Then show the alias definition in the UI.
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: rarcel on September 10, 2025, 03:42:13 PM
I don't know if it's a coincidence, but it seems that all my aliases that contains two underscore in the name are empty. Others seems to be fine.
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: rarcel on September 10, 2025, 03:44:02 PM
Finally it seems to be random ( I have more than 100 aliases )
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: franco on September 10, 2025, 03:44:36 PM
> don't know if it's a coincidence, but it seems that all my aliases that contains two underscore in the name are empty.

This is odd, because 25.7.3_3 fixes exactly this.


Cheers,
Franco
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: rarcel on September 10, 2025, 03:46:04 PM
Searching in the logs, I found this :

[ba512d3a-0fe9-4e3b-8872-24a007932bed] Script action failed with Command '/usr/local/bin/flock -n -E 0 -o /tmp/filter_update_tables.lock /usr/local/opnsense/scripts/filter/update_tables.py ' returned non-zero exit status 1. at Traceback (most recent call last): File "/usr/local/opnsense/service/modules/actions/script_output.py", line 78, in execute subprocess.run(script_command, env=self.config_environment, shell=True, File "/usr/local/lib/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '/usr/local/bin/flock -n -E 0 -o /tmp/filter_update_tables.lock /usr/local/opnsense/scripts/filter/update_tables.py ' returned non-zero exit status 1.
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: franco on September 10, 2025, 03:57:11 PM
Ok, what happens when you manually run "/usr/local/opnsense/scripts/filter/update_tables.py" then?
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: rarcel on September 10, 2025, 04:02:06 PM
this appens:

Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: rarcel on September 10, 2025, 04:09:16 PM
The error was self-explained, I don't know why, after the update in System/Settings/General, dns servers list was empty ( it was not the case before).

My issue is resolved :)
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: rarcel on September 10, 2025, 04:28:31 PM
For information, I have a 2 nodes cluster in HA, and the same thing happens on the second node.

I had to change the configuration this way to make it works again.

i'm quite sure that it was not needed before the update ( My dns server is adguard running locally on opnsense).

Moreover, without adding 127.0.0.1 as a nameserver, I had dns resolution from the cli, but not from the gui

Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: nbca2 on September 10, 2025, 06:06:54 PM
Quote from: rarcel on September 10, 2025, 04:28:31 PMMoreover, without adding 127.0.0.1 as a nameserver, I had dns resolution from the cli, but not from the gui



do you have in one of your alias the "content" populated with nameserver in letter ? example (site.com)
if yes which "type" of alias is ? (url or host/s)
if it is url try to change to host/s
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: franco on September 10, 2025, 07:13:11 PM
Can you try this patch?

# opnsense-patch https://github.com/opnsense/core/commit/0425834f9

Still investigating why this changed, a bit short on time this evening so far.


Cheers,
Franco
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: franco on September 11, 2025, 07:14:58 AM
Nobody?


Cheers,
Franco
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: nbca2 on September 11, 2025, 09:14:12 AM
Quote from: franco on September 11, 2025, 07:14:58 AMNobody?


Cheers,
Franco

tried, but i cannot recreate the error (also reverting the configuration of the aliases before the last change).
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: franco on September 11, 2025, 11:46:33 AM
The bug appears to have been added 7 years ago. May have explained a few unclear cases in the past. I think what 25.7.3 has done is invalidate the cached alias and caused the bug to happen. Personally, I'm very glad it was reported and fixed.

It obviously goes without saying that host aliases with no way to resolve them are a problematic combination that can come back at any time and cause indeterministic results (at least from the top).


Thanks,
Franco
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: nbca2 on September 11, 2025, 01:44:38 PM
Quote from: franco on September 11, 2025, 11:46:33 AMThe bug appears to have been added 7 years ago. May have explained a few unclear cases in the past. I think what 25.7.3 has done is invalidate the cached alias and caused the bug to happen. Personally, I'm very glad it was reported and fixed.

It obviously goes without saying that host aliases with no way to resolve them are a problematic combination that can come back at any time and cause indeterministic results (at least from the top).


Thanks,
Franco

👍

thank you for yor time and work!
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: rarcel on September 11, 2025, 03:12:13 PM
Sorry for the late answer.

I cannot reproduce what I had yesterday by removing the dns server.

I can only tell you that I applied the patch after failing to reproduce, and it doesn't break anything on my installation
Title: Re: 25.7.3_3 - Filtering by source ip on a wireguard interface doesn't work
Post by: Burthouse4563 on September 11, 2025, 03:34:05 PM
Quote from: franco on September 11, 2025, 07:14:58 AMNobody?


Cheers,
Franco

Franco,

Sorry wasn't able to break the network again before calling it a night. People get upset during TV time. Anyways, I updated to _7, changed the alias back to URL vice Host, flushed the alias via diagnostics and it refreshed correctly pulling the information. I'll watch the logs on it and let you know if it doesn't hold.

Thanks for correcting the problem.