OPNsense Forum

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

Title: OPNsense 26.1.4 VLAN odd behavior
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.