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

    Two different VPN in pfsense

    Scheduled Pinned Locked Moved General pfSense Questions
    7 Posts 3 Posters 1.1k 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
      denis_ts
      last edited by

      HI, please hekp me) pfsens is installed, the first provider with IPVPN is connected to it, the second provider with open Internet is also connected, I want to make the first provider always active, but as soon as it falls, pfsens switches to IPSEC through the second provider, can I implement such a scheme?

      JKnottJ 1 Reply Last reply Reply Quote 0
      • JKnottJ
        JKnott @denis_ts
        last edited by

        @denis_ts

        What you're looking for is the metric for an interface. If you run ifconfig, you will see each interface has the default metric of 0. If you want to increase the metric or cost of an interface, you use the metric option in ifconfig. So, you'd leave the main interface at 0 and assign some other number to the VPN. This way, the VPN would be used only when the main connection is failed. I haven't tried this in pfSense or FreeBSD, but it works on my Linux notebook, where WiFi has a higher metric than Ethernet and so is used only when there is no Ethernet connection. You might also have to use gateway monitoring to ensure failure detection.

        PfSense running on Qotom mini PC
        i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
        UniFi AC-Lite access point

        I haven't lost my mind. It's around here...somewhere...

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

          You can do that as long as the IPSec connection is route based (VTI).

          To failover like that you need to use gateway groups and only a route based IPSec tunnel creates a gateway you can use there.
          https://docs.netgate.com/pfsense/en/latest/multiwan/load-balance-and-failover.html

          Steve

          D 1 Reply Last reply Reply Quote 0
          • D
            denis_ts @stephenw10
            last edited by denis_ts

            @stephenw10 hello, VTI will most likely help me, but I don’t understand how to deal with routing. Site A and site B are connected through the main channel of the IPVPN, IPSEC is a backup channel. When site A and site B are connected via IPVPN, the route from the 10.212.25.0/24 network to the 10.222.0.0/16 network will receive the BGP from the site B list prefix, the packets are transmitted, everything works. When IPVPN link goes down, traffic should be sent over IPsec link, but traffic is not transmitted, no route, when I create static route 10.222.0.0/16 gateway 10.244.244.2, traffic starts going from site A to site B. When IPVPN link goes up, traffic is still transmitted through the IPSEC channel, when IPSEC is disabled, traffic is not transmitted through the IPVPN, since I made a static route for IPSEC, I delete the static route 10.222.0.0 and only then traffic from site A to site B begins to be transmitted. I don’t understand how to use MULTIWAN and DINAMICROUTE in this scheme. Need to make a route specifically to a specific site
            pfsense.jpg

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

              @denis_ts said in Two different VPN in pfsense:

              VTI will most likely help me

              VTI is the only way is can work with IPSec. With policy based IPSec the traffic will always use the IPSec tunnel so you must be using VTI before troubleshooting further.

              What VPN type is "IPVPN" using? OpenVPN? As long as it's also route based (like OpenBPN) it should work.

              Do you see the BGP announcements working over both VPN links?

              D 1 Reply Last reply Reply Quote 0
              • D
                denis_ts @stephenw10
                last edited by

                @stephenw10 HI, IPVPN is a service from the ISP, they let our local traffic through their routers. If I have IPVPN and IPSEC active, IPVPN works until I add routes to remote nodes through IPSEC, I add new a route and traffic stops going trough IPVPN, how much can I automatically add routes through IPSEC when IPVPN is not available?

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

                  You are using BGP to add the routes over IPSec right?

                  If it's always sending traffic across that then it's becoming the preferred route and you need to reduce it's preference so it's only used as backup.

                  How is the BGP over IPVPN setup though. Is that just between your routers or does that also include the ISPs routers centrally? That could complicate things significantly.

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