OPNsense Forum

English Forums => 26.1, 26,4 Series => Topic started by: Shoresy on March 23, 2026, 02:06:03 PM

Title: OPNsense 26.1.4 VLAN odd behavior [SOLVED]
Post by: Shoresy on March 23, 2026, 02:06:03 PM
I'm troubleshooting an internal DNS issue on OPNsense 26.1.4 / FreeBSD 14.3.
Setup
Problem
A client on the client VLAN repeatedly sends DNS queries to two internal DNS servers. The DNS servers reply immediately, but the client keeps retrying the same queries as if it never receives the responses.
Packet capture results
I captured on:
What I see:
Rule/state details
pfctl -vvsr shows the DNS traffic is matching the intended explicit client VLAN DNS allow rules, specifically the VLAN interface rules for UDP/53 to each DNS server.
pfctl -vvss shows states being created for both directions of the flow.
So this does not appear to be:
Additional notes
Question
Has anyone seen OPNsense / FreeBSD behave like this:
I'm trying to determine whether this points to:
Title: Re: OPNsense 26.1.4 VLAN odd behavior
Post by: viragomann on March 23, 2026, 05:35:56 PM
Check the client VLAN interface settings. Maybe you've stated a wrong mask, so that the concerned client is outside of its subnet.
Title: Re: OPNsense 26.1.4 VLAN odd behavior
Post by: Shoresy on March 23, 2026, 09:09:16 PM
The VLANs are intentionally separate routed /24 networks. The problem is not that the client can't identify its own subnet; the problem is that DNS replies are visible arriving on the services VLAN but are not visible leaving back toward the client VLAN.
Title: Re: OPNsense 26.1.4 VLAN odd behavior
Post by: viragomann on March 23, 2026, 09:15:17 PM
Well, and a possible reason for this behavior could be, that the network mask is set wrongly for the client VLAN interface on OPNsense.

"client VLAN" is, how you called the network in your initial post.
Title: Re: OPNsense 26.1.4 VLAN odd behavior
Post by: Shoresy on March 23, 2026, 10:00:53 PM
I checked the live interface config on OPNsense. The client VLAN interface is 192.168.20.1/24 (255.255.255.0), which matches the intended subnet. So the client VLAN interface mask on OPNsense does not appear to be incorrect.

The client on the VLAN network is getting a valid IP/subnet mask/gateway/DNS server assignment as well. Appreciate the input so far.
Title: Re: OPNsense 26.1.4 VLAN odd behavior
Post by: viragomann on March 23, 2026, 10:16:48 PM
Did you state a gateway on any of the involved interfaces by any chance?
Title: Re: OPNsense 26.1.4 VLAN odd behavior
Post by: Shoresy on March 23, 2026, 10:24:06 PM
No explicit gateway is set on the involved VLAN20 (client)/VLAN40 (Services) DNS rules. The VLAN20 and VLAN40 interfaces are just the local routed interfaces (192.168.20.1/24 and 192.168.40.1/24). So this does not appear to be caused by a gateway being attached to the DNS pass rules.
Title: Re: OPNsense 26.1.4 VLAN odd behavior
Post by: pfry on March 23, 2026, 10:47:26 PM
Have you enabled logging on all rules? I would expect logs to be available for state mismatches. There are lots of ways to (generally inadvertently) stop traffic flow (e.g. using reply-to incorrectly, using "bind states to interface" when you have alternate paths, etc.) - a state mismatch might offer a clue. Say... can you ping the client from the firewall? I didn't see that noted.
Title: Re: OPNsense 26.1.4 VLAN odd behavior
Post by: Shoresy on March 23, 2026, 10:57:26 PM

Logging is not enabled on every rule, only selectively. For the DNS path itself, the explicit VLAN20 DNS pass rules are matching, and packet captures show the DNS queries leaving VLAN20 and the replies arriving on VLAN40. I did not get a useful drop/state-mismatch-specific clue from pflog yet.I agree the nonzero state-mismatch counter may still be relevant.I have not yet tested ping from the firewall to the affected client, so that is a good suggestion and I'll check that next. Client->firewall ping was not useful because ICMP to the gateway was intentionally disabled on that VLAN during testing.
Title: Re: OPNsense 26.1.4 VLAN odd behavior
Post by: Shoresy on March 24, 2026, 03:34:02 AM
I fixed the problem, well, not a complete fix, but a fix nonetheless. I defined those VLANs I was working with awhile back, perhaps a year ago, and left them as-is, with default setups, just skeleton VLAN definitions. When I created new VLANs through the GUI, connectivity worked fine, no odd behavior. So I deleted those old VLAN definitions I had created awhile back, and created new VLANs from scratch. The new ones worked perfectly fine. No more problems. 

I have no idea what was causing the other, older VLANs to not pass traffic, even though the rules, DHCP, interface assignments all looked good. This can be closed as resolved, I just don't know how to resolve these threads or if it needs to be done by a moderator.
Title: Re: OPNsense 26.1.4 VLAN odd behavior
Post by: Patrick M. Hausen on March 24, 2026, 07:57:24 AM
You edit the subject line of your first post and write e.g. "[SOLVED]" in it.
Title: Re: OPNsense 26.1.4 VLAN odd behavior
Post by: Shoresy on March 24, 2026, 01:55:16 PM
Quote from: Patrick M. Hausen on March 24, 2026, 07:57:24 AMYou edit the subject line of your first post and write e.g. "[SOLVED]" in it.
Thanks, easy enough!