Floating-state rule for IPsec VTI is generated for the wrong interface when reqid ≠ ikeid, causing TCP stalls after ~64 KiB
-
Subject: Floating-state rule for IPsec VTI is generated for the wrong interface when reqid ≠ ikeid, causing TCP stalls after ~64 KiB
Version: 2.8.1-RELEASE (the same call is present on GitHub master as of 2026-02-18).
Setup: two pfSense VMs joined by a route-based IPsec (VTI) tunnel. On site A the VTI phase 1 has ikeid 2 but its phase 2 has reqid 6 (reqids 1–5 belong to another tunnel's phase 2 entries), so the interface is
ipsec6. On site B ikeid = reqid = 2 (ipsec2).Symptom: TCP connections initiated from site A across the tunnel stall after ~64 KiB (retransmissions never acknowledged). Connections initiated from site B work. ICMP of any size works, and PMTUD is fine (VTI MTU 1400).
Cause: in /etc/inc/filter.inc (~line 4546),
ipsec_get_ifname($phase1_config, $phase1_config['ikeid'])passes the ikeid as the reqid argument. The interface is namedipsec<reqid>, so the "IPsec VTI floating states" rule is generated foripsec2(nonexistent on site A) instead of ipsec6. Outbound packets onipsec6then match the default "let out anything IPv4 from firewall host itself" rule, which creates an interface-bound state onipsec6. Replies arrive viaenc0and never update it. The state staysSYN_SENT:CLOSED, and pf drops data outside the initial window (state-mismatchcounter grows).Evidence:
pfctl -ss -vvshows two states for one connection (oneipsec6state stuck inSYN_SENT:CLOSEDwith 0 reply packets, one floatingESTABLISHED). Captures show packets entering the LAN and never leaving the VTI. A floating pass-out rule with a floating state policy on the affected traffic fixes it (50 MB in 0.8 s).Expected: the floating-states rule should use the actual interface name,
ipsec<reqid>of the VTI phase 2.Related: #15430 and #15431 (interface-bound state policy and VTI). This may duplicate or extend them.
-
https://redmine.pfsense.org/issues/17151
-
@marcosm Thank you for your action and feedback.
Privacy Policy · Cookie Policy