Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    TCP traffic over IPSec stalls with some packets not appearing on enc0

    Scheduled Pinned Locked Moved IPsec
    21 Posts 2 Posters 439 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      Pentium100 @Pentium100
      last edited by

      Sorry for double post, but I found something else interesting.
      I am not too familiar with BSD, I am more familiar with Linux, but this looks weird to me:

      If I start the iperf3 test, then while it is running (stalled transfer) I run
      pfctl -s state | grep 192.168.0.x | grep 192.168.10.x | grep 5201
      I get this:

      vtnet2 tcp 192.168.0.x:5201 <- 192.168.10.x:42202       ESTABLISHED:ESTABLISHED
      ipsec30 tcp 192.168.10.x:42202 -> 192.168.0.x:5201       SYN_SENT:CLOSED
      all tcp 192.168.10.x:42202 -> 192.168.0.x:5201       ESTABLISHED:ESTABLISHED
      

      So, on "all" and vtnet2 it says ESTABLISHED, but on ipsec30 it says CLOSED.
      Are the states supposed to look like this?

      I checked this on another pfsense router (older version 2.6.0) and all states there are on "all" and not separate interfaces. What is the difference here?

      tinfoilmattT 1 Reply Last reply Reply Quote 0
      • tinfoilmattT Offline
        tinfoilmatt LAYER 8 @Pentium100
        last edited by

        What does the firewall ruleset look like on both IPsec and IPsec30 tabs?

        I checked this on another pfsense router (older version 2.6.0) and all states there are on "all" and not separate interfaces.

        Obvious question, but is that system also using Routed IPsec or no?

        P 1 Reply Last reply Reply Quote 0
        • P Offline
          Pentium100 @tinfoilmatt
          last edited by

          @tinfoilmatt said in TCP traffic over IPSec stalls with some packets not appearing on enc0:

          Obvious question, but is that system also using Routed IPsec or no?

          Yes. It's the only other pfsense with routed IPsec..

          @tinfoilmatt said in TCP traffic over IPSec stalls with some packets not appearing on enc0:

          What does the firewall ruleset look like on both IPsec and IPsec30 tabs?

          IPSec tab has only one rule
          c9283e3a-bac9-4278-9137-0f3d69f5f119-image.png

          ipsec30 interface does not have its own firewall tab. That's probably because I have this setting on:
          afbef87c-da7d-46e8-a926-8bafd9a8c0bc-image.png

          This is because there are policy-based IPsec tunnels too, so I cannot change it.
          This setting is the same on both routers, as both have a combination of routed IPsec and policy-based.

          tinfoilmattT 1 Reply Last reply Reply Quote 0
          • tinfoilmattT Offline
            tinfoilmatt LAYER 8 @Pentium100
            last edited by

            ipsec30 interface does not have its own firewall tab. That's probably because I have this setting on:
            afbef87c-da7d-46e8-a926-8bafd9a8c0bc-image.png

            So then you're aware that that's literally the setting preventing you from using "per-interface rules, NAT, or reply-to" reliably.

            Maybe there's a way to make this behavior more reliable/consistent using static routing?

            P 1 Reply Last reply Reply Quote 0
            • P Offline
              Pentium100 @tinfoilmatt
              last edited by

              @tinfoilmatt Changing the setting will break the policy-based VPNs.

              I do not really need per-interface rules, as I just have allowed everything in the IPsec tab and it works correctly on the other router with an older pfsense version.

              As I only have two such routers I cannot say if the other one works because of the version of something else.

              tinfoilmattT 1 Reply Last reply Reply Quote 0
              • tinfoilmattT Offline
                tinfoilmatt LAYER 8 @Pentium100
                last edited by

                The issue is not the firewall ruleset.

                1 Reply Last reply Reply Quote 0
                • tinfoilmattT Offline
                  tinfoilmatt LAYER 8
                  last edited by

                  Why does this P2 require "Routed (VTI)" mode?

                  tinfoilmattT P 2 Replies Last reply Reply Quote 0
                  • tinfoilmattT Offline
                    tinfoilmatt LAYER 8 @tinfoilmatt
                    last edited by

                    And can we assume you've read this section of the documentation, IPsec Interface Assignment?

                    1 Reply Last reply Reply Quote 0
                    • P Offline
                      Pentium100 @tinfoilmatt
                      last edited by

                      @tinfoilmatt
                      Because using policy based it would be something like 30 phase2 entries and we had a problem where some of them would stop working at random.

                      Anyway, I found a solution to this.
                      Firewall State Policy - set to "Floating States" (default was "Interface Bound States" and apparently this default was different on the older pfsense version)
                      Now it seems to work

                      tinfoilmattT 1 Reply Last reply Reply Quote 0
                      • tinfoilmattT Offline
                        tinfoilmatt LAYER 8 @Pentium100
                        last edited by

                        If it works and it's messy, it still works.

                        P 1 Reply Last reply Reply Quote 0
                        • P Offline
                          Pentium100 @tinfoilmatt
                          last edited by

                          @tinfoilmatt Yeah. I have to use routed ipsec for this and also have to use policy-based tunnels. If there is no other way to make this work, then using floating states (like it is in the older version) seems like a solution.

                          tinfoilmattT 1 Reply Last reply Reply Quote 0
                          • tinfoilmattT Offline
                            tinfoilmatt LAYER 8 @Pentium100
                            last edited by

                            If there is no other way to make this work

                            I think there might be. I'd need to confirm for myself to be sure.

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.