Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
24.7 Production Series
»
State tracking issue with OPNsense in single-interface public IP setup
« previous
next »
Print
Pages: [
1
]
Author
Topic: State tracking issue with OPNsense in single-interface public IP setup (Read 154 times)
pefen
Newbie
Posts: 3
Karma: 0
State tracking issue with OPNsense in single-interface public IP setup
«
on:
December 02, 2024, 03:28:40 pm »
I have the following setup:
- Proxmox host with a /29 public subnet (148.251.196.80/29)
- OPNsense VM: 148.251.196.85, gateway: 148.251.196.80
- Web servers VMs: .81, .82, .83 with gateway set to .85 (OPNsense)
- Single WAN interface, no LAN
The goal is to have all traffic from web servers pass through OPNsense for filtering before reaching the provider's gateway.
Issue:
- With state tracking set to "keep state", traffic gets blocked with "Default deny / state violation rule"
- Only works when state tracking is set to "none"
- Floating rules don't help
- Even with global setting "Firewall Optimization" set to "conservative"
Basic connectivity works (ping, web traffic) but I'd like to understand:
1. Why state tracking doesn't work in this setup?
2. Is using "none" state tracking a secure approach?
3. Is there a better way to achieve this?
Thank you for any insights.
«
Last Edit: December 02, 2024, 04:34:11 pm by pefen
»
Logged
Patrick M. Hausen
Hero Member
Posts: 6925
Karma: 583
Re: State tracking issue with OPNsense in single-interface public IP setup
«
Reply #1 on:
December 02, 2024, 03:35:59 pm »
The gateway 148.251.196.80 will send request from clients to the web servers .81, .82, .83 directly. The webservers will send the answers to OPNsense.
OPNsense not having seen the initial SYN packet of the TCP connection setup and now seeing a SYN/ACK without a preceeding SYN, will drop the packets for a state violation.
You should place your web servers in a private network behind your OPNsense.
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do.
(Isaac Asimov)
pefen
Newbie
Posts: 3
Karma: 0
Re: State tracking issue with OPNsense in single-interface public IP setup
«
Reply #2 on:
December 02, 2024, 04:09:53 pm »
Thanks for the explanation. Since moving servers to a private network is not an option (due to Enhance control panel requirements for public IPs), is there a way to handle this asymmetric routing situation?
Specifically, can OPNsense be configured to properly handle state tracking when:
Initial SYN packets go directly from gateway (.80) to servers
Return traffic (SYN/ACK) goes through OPNsense (.85)
I understand this is not ideal, but disabling state tracking doesn't seem secure. Are there any settings for asymmetric routing that could help?
«
Last Edit: December 02, 2024, 04:32:05 pm by pefen
»
Logged
dseven
Sr. Member
Posts: 337
Karma: 36
Re: State tracking issue with OPNsense in single-interface public IP setup
«
Reply #3 on:
December 02, 2024, 04:37:56 pm »
There's a state tracking mode called "sloppy", which
https://man.freebsd.org/cgi/man.cgi?pf.conf(5
) describes as:
" sloppy
Uses a sloppy TCP connection tracker that does not check sequence
numbers at all, which makes insertion and ICMP teardown attacks
way easier. This is intended to be used in situations where one
does not see all packets of a connection, e.g. in asymmetric
routing situations. Cannot be used with modulate or synproxy
state."
TL;DR the conversation above, so not sure if it fits for you, but it is an option for rules in OPNsense.....
Logged
Patrick M. Hausen
Hero Member
Posts: 6925
Karma: 583
Re: State tracking issue with OPNsense in single-interface public IP setup
«
Reply #4 on:
December 02, 2024, 04:40:38 pm »
No and no.
Only way would be to use a proxy in OPNsense like Caddy to terminate all incoming connections on OPNsense itself.
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do.
(Isaac Asimov)
pefen
Newbie
Posts: 3
Karma: 0
Re: State tracking issue with OPNsense in single-interface public IP setup
«
Reply #5 on:
December 02, 2024, 04:47:42 pm »
Thank you all for your advice. I'm a bit confused, I thought my scenario wasn't unusual and wouldn't require complicated solutions, but I guess I'm wrong.
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
24.7 Production Series
»
State tracking issue with OPNsense in single-interface public IP setup