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

    IPSec VTI 0.0.0.0/0

    Scheduled Pinned Locked Moved General pfSense Questions
    10 Posts 3 Posters 1.2k Views 3 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.
    • S
      silviub
      last edited by

      Hello,

      I was wondering, can I use 0.0.0.0/0 in a routed (VTI) IPSec tunnel? From my understanding, the answer would be no, because it needs an IP to set the static routes but I haven't found any official documentation.

      Thank you!

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

        @silviub Routing is established via Phase 1 peer addresses. Therefore yes, 0.0.0.0/0 (i.e., route all client traffic through the tunnel) is a valid Phase 2 route.

        block out log on { ix0 } inet from any to any
        block out log on { ix0 } inet6 from any to any

        S 1 Reply Last reply
        Reply Quote 1
        • S
          silviub @tinfoilmatt
          last edited by

          @tinfoilmatt Is this tried and tested? I'm asking because when I add a static route and run netstat -4rn | grep <route> I see something like:

          Internet:
          Destination        Gateway            Flags         Netif Expire
          10.41.62.0/24      10.254.254.26      UGS          ipsec3
          

          My P2 routes for this tunnel are:

          Local: 10.254.254.25
          Remote: 10.254.254.26
          

          Wondering if I set them to 0.0.0.0/0 what would happend :D
          Since this is a production system, I'd have to replicate the setup in order to be able to test it out, and I was hoping someone else already tried it before me :D

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

            @silviub There is comprehensive official documentation on the subject.

            block out log on { ix0 } inet from any to any
            block out log on { ix0 } inet6 from any to any

            S 1 Reply Last reply
            Reply Quote 0
            • stephenw10S
              stephenw10 Netgate Administrator
              last edited by

              You can just set the VTI gateway as default if that's what you want.

              1 Reply Last reply
              Reply Quote 1
              • S
                silviub @tinfoilmatt
                last edited by

                @tinfoilmatt there is and I've read a fair bit of it, but the issue is that I haven't found any mention of 0.0.0.0/0 in Phase 2 config. That's why I'm asking.
                @stephenw10 I don't. I don't want the VTI as the default gateway, but I'm linking it to a Fortigate who's using 0.0.0.0/0 and I get messages in the logs saying that the P2 doesn't match, but it establishes the tunnel.

                I guess I'll just setup a test env and see what happens.

                1 Reply Last reply
                Reply Quote 0
                • S
                  silviub
                  last edited by

                  Back with an answer: In an IPSec where P2 is set to VTI you CANNOT set 0.0.0.0/0 as the local/remote gateway, as it will not work.
                  What I've tried:
                  Add an IPSec tunnel with P2 as 10.10.10.1 and 10.10.10.2 and push a route via that tunnel gateway, everything worked.
                  I've edited the P2 and set both the local and remote to 0.0.0.0, applied, restarted the tunnel, checked the routes - not present. I tried rebooting the VM, restarting the tunnel from the other side, etc. Unless there's a valid IP address, it seems that the route cannot be added.

                  1 Reply Last reply
                  Reply Quote 0
                  • stephenw10S
                    stephenw10 Netgate Administrator
                    last edited by

                    Is the Fortigate not using VTI mode then? The only reason have 0/0 in the P2 is to allow it to carry all traffic in policy mode usually.

                    S 1 Reply Last reply
                    Reply Quote 0
                    • S
                      silviub @stephenw10
                      last edited by

                      @stephenw10 on the Fortigate, I don't see a way to pick VTI / Tunneled. The Fortigate seems to behave as a VTI when using 0.0.0.0/0 as I need to set routes for the traffic to be sent via a specific interface.
                      Anyways, I've got the answer to my question: if I set 0.0.0.0/0 to P2 in the PFSense, it won't work. It needs an IP address (one that's not in the same VLAN as your LAN / WAN / known routes) to be used as a route gateway.

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

                        @silviub said in IPSec VTI 0.0.0.0/0:

                        Anyways, I've got the answer to my question: if I set 0.0.0.0/0 to P2 in the PFSense, it won't work. It needs an IP address (one that's not in the same VLAN as your LAN / WAN / known routes) to be used as a route gateway.

                        This specific point is contemplated by the official documentation as expected behavior—more specifically discussing routed IPsec caveats with the platform here.

                        block out log on { ix0 } inet from any to any
                        block out log on { ix0 } inet6 from any to any

                        1 Reply Last reply
                        Reply Quote 1

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • First post
                          Last post
                        Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
                        Privacy Policy · Cookie Policy