Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    IPSEC VTI Tunnels

    Scheduled Pinned Locked Moved IPsec
    51 Posts 16 Posters 21.0k Views
    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.
    • D
      dragon2611
      last edited by dragon2611

      Is the VTI patch needed since 4.2.2 patch2, seeing an odd issue where SSH hangs looks like an MTU issue but it doesn't seem to make a blind bit of difference as to what I set the MSS to in the Ipsec settings.

      This was on a new deploy, though it was an LRO issue with vmware, but since upgraded my other firewall from 4.2.2 p1 with the VTI patch to 4.2.2 p2 and are now having the same issue (that one runs in proxmox)

      Edit:

      Setting the MTU on the VTI interface slightly higher than the MSS on IPSEC > Advanced and lower than the physical interface seemed to fix it

      MTU on PHY: 1500
      MTU on VTI: 1450
      MSS on IPSEC > Advanced 1400

      It took me way to long to get to the bottom of that, i'm off to grab a coffee

      1 Reply Last reply Reply Quote 0
      • M
        mountainlion
        last edited by

        @dragon2611 any update? I have been having a reoccurring issue, both ssh issues, and over all routing and connectivity issues through the VTI tunnel. I am also have the phase2 reestablish and not kill off old session/id.
        I followed the hangouts setup verbatim. I know its the VTI as communication via openvpn and client if flawless.

        1 Reply Last reply Reply Quote 0
        • D
          dragon2611
          last edited by dragon2611

          Setting 1400 for MSS (advanced settings on the IPSEC config) and then setting MTU of 1450 on the VTI interface itself (once you've assigned it via assign interface you should then be able to change it's MTU) seemed to fix it for me.

          This is a tunnel over a link that has an MTU of 1500, if you have a tunnel going over something with a lower MTU (E.g PPPoE) you might have to adjust the values downwards slightly.

          1 Reply Last reply Reply Quote 0
          • D
            dragon2611
            last edited by

            It sounds like there is a Bug that causes the MTU set on the VTI interfaces to revert on a reboot/restart.
            Looks like it's already in but as a feature request - https://redmine.pfsense.org/issues/9111 - I'd argue it's a bug because it breaks things by causing MTU issues on the tunnel.

            1 Reply Last reply Reply Quote 0
            • A
              AndrewBucklin
              last edited by

              Has anyone found a way to use Gateway Monitor with Routed IPsec (VTI)?

              I'm attempting to add the Routed IPsec (VTI) tunnel to a Gateway Group, but if/when the IPSEC tunnel goes down, I need the traffic to traverse an alternate gateway.
              Thanks!

              1 Reply Last reply Reply Quote 0
              • M
                mountainlion
                last edited by

                I have not, I have had a really tough time with routing BGP over the VTI, and even static over VTI. Regular IPSEC seems to work fine. There is something broken with VTI, so be aware.

                A 1 Reply Last reply Reply Quote 0
                • A
                  AndrewBucklin @mountainlion
                  last edited by

                  @mountainlion said in IPSEC VTI Tunnels:

                  I have not, I have had a really tough time with routing BGP over the VTI, and even static over VTI. Regular IPSEC seems to work fine. There is something broken with VTI, so be aware.

                  Routed IPSec (VTI) works great for me. Within the firewall rules, I can force certain hosts or entire interfaces to route all their traffic over the IPSec tunnel by forcing the gateway. But what I can't figure out is how to implement gateway monitoring for that 'gateway'. I need the ability for that traffic to failover to a secondary gateway, should the IPSec tunnel go down. Thanks in advance for anyone who can assist.

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    mountainlion @AndrewBucklin
                    last edited by

                    @AndrewBucklin Did you go to {system/ routing / Gateways ?
                    Then look for the field that says "Monitor Gateway"
                    Let me know if that works.

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      AndrewBucklin @mountainlion
                      last edited by

                      @mountainlion No, it doesn’t work. No matter what IP I enter for the Monitor IP, the status will never change to “up”. I can only force it up by disabling gateway monitoring.

                      M 1 Reply Last reply Reply Quote 0
                      • M
                        mountainlion @AndrewBucklin
                        last edited by

                        @AndrewBucklin
                        Assuming you have your ACL for that interface setup properly....

                        A 1 Reply Last reply Reply Quote 1
                        • A
                          AndrewBucklin @mountainlion
                          last edited by

                          @mountainlion Do you mean Firewall Rules? The interface doesn't actually appear under Firewall Rules, but I do have an Allow rule for all traffic under the default "IPsec" firewall rule group:

                          screenshot.png

                          1 Reply Last reply Reply Quote 0
                          • M
                            mohsh86 @jimp
                            last edited by mohsh86

                            @jimp Would you please elaborate a bit more on NAT doesn't work with VTI?

                            I've setup 2 VM's with latest pfSense for simplicity (trying to mimic our office setup between a Huawei 4G modem with CGNAT IP and a HQ pfSense firewall with public static ip). Here is what i found (not sure it is related to what you said about NAT & VTI?)

                            Pfsense1 had Responder only ticked, and remote Gateway in P1 set to 0.0.0.0 didn't work, it would error with

                            /rc.newipsecdns: The command '/sbin/ifconfig 'ipsec1000' create reqid '1000'' returned exit code '1', the output was 'ifconfig: create: bad value'
                            

                            and it will have the symptoms of having Inbound Traffic in IPSec interface (with packet capture), nothing on the VTI interface.

                            if i change the remote Gateway in P1 (in pfSesnse1) to the WAN address of pfSesnse2, it will work.

                            Confusingly, reverting P1 remote gateway to 0.0.0.0 would still work and persist over ipsec service restart. it will only stop working if i delete P2 & P1 entry, (along with VTI interface) and recreate them again with P1's remote gateway set to 0.0.0.0 (or a reboot after setting to 0.0.0.0).

                            I got P1's remote gateway set as 0.0.0.0 to work with IPv4 Tunnel Mode, but am trying to achieve it with VTI since it's easier to manage with static routing rather than ACL's (on Huawei end) and avoid multiple P2 entries on pfSense. The reason behind HQ pfSense remote gateway set to 0.0.0.0 is that branch office with 4G modem is CGNATed as i said earlier

                            Any suggestion would be very much appreciated ☺ !

                            1 Reply Last reply Reply Quote 0
                            • jimpJ
                              jimp Rebel Alliance Developer Netgate
                              last edited by

                              VTI and NAT not working means that you can't NAT to other addresses as traffic exits a VTI inside the tunnel -- it has nothing to do with establishing the tunnel as is your case. VTI won't be possible without a static remote peer, or at least dyndns. It needs to know the remote peer address. That's a topic for another thread, though.

                              Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                              Need help fast? Netgate Global Support!

                              Do not Chat/PM for help!

                              M 1 Reply Last reply Reply Quote 0
                              • M
                                mohsh86 @jimp
                                last edited by

                                @jimp when you say static remote peer or dyndns, you mean a public IP and hence a modem with CGNAT won't work? (given that Huawei modem supports ipsec on logical interfaces.)

                                L 1 Reply Last reply Reply Quote 0
                                • L
                                  lfoerster @mohsh86
                                  last edited by

                                  Maybe an example of a running Cisco pfSense VTI tunnel connection with dynmaic routing helps:
                                  Cisco-pfSense with VTI
                                  Unfortunately in German but ist pretty self explaining.

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