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

    Dynamic routing over IPSec tunnels

    General pfSense Questions
    4
    7
    839
    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.
    • T
      travis.fleming
      last edited by

      Hello,
      We have a remote site that is a PaloAlto. That Palo has 2 internet connections, so we have established 2 IPSec tunnels between the Palo and our pfSense firewall (with 1 internet connection). We setup the Phase 2 on the pfsense as a routing vti.

      My question is how do I get the traffic to to go over the secondary IPSec when the primary goes down? Currently I have a static route that sais if you are trying to get to the 10.10.240.0/21 subnet that lives at the Palo side, go down the ifSense IPSec gateway 1. When that IPSec tunnel goes down, I have to manually change the route and it works to send traffic over the other gateway.

      How do I get this to work dynamically?

      M 1 Reply Last reply Reply Quote 0
      • M
        michmoor LAYER 8 Rebel Alliance @travis.fleming
        last edited by

        @travis-fleming said in Dynamic routing over IPSec tunnels:

        uestion is how do I get the traffic to to go over the secondary IPSec when the primary goes down? Currently I have a static route that sais if you are trying to get to the 10.10.240.0/21 subnet that lives at the Palo si

        Use dynamic routing probably would be easier. OSPF you can set cost. BGP you can set local-pref.
        Netgate has fantastic documentation on the different way of using dynamic routing.

        Firewall: NetGate,Palo Alto-VM,Juniper SRX
        Routing: Juniper, Arista, Cisco
        Switching: Juniper, Arista, Cisco
        Wireless: Unifi, Aruba IAP
        JNCIP,CCNP Enterprise

        JKnottJ T 2 Replies Last reply Reply Quote 0
        • JKnottJ
          JKnott @michmoor
          last edited by

          @michmoor

          If there is a primary that is used most of the time and the secondary is a fallback, then he could set the metric for a connection. The available connection with the lowest metric wins. This is possible with regular interfaces, but I'm not sure about IPSec.

          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...

          M 1 Reply Last reply Reply Quote 0
          • M
            michmoor LAYER 8 Rebel Alliance @JKnott
            last edited by

            @jknott How can he set the metric?
            I think routed IPsec with dynamic routing (frr) in this case would be more flexible especially if there would be more networks that need to be routed to on either side in the future.

            Firewall: NetGate,Palo Alto-VM,Juniper SRX
            Routing: Juniper, Arista, Cisco
            Switching: Juniper, Arista, Cisco
            Wireless: Unifi, Aruba IAP
            JNCIP,CCNP Enterprise

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

              @michmoor

              How can he set the metric?

              With interfaces, the ifconfig command. With IPSec I don't know. With OpenVPN, the metric is shown as 0, however, it can be changed with the route metric option.

              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
              • T
                travis.fleming @michmoor
                last edited by

                @michmoor Thank you. We were leaning toward this but wanted someone else to suggest it first. I think we will implement OSPF, it looks pretty simplistic!

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

                  You can't route via a gateway group and you can't set a metric on a route directly so using dynamic routing, like OSPF, is usually how this is done.

                  You could just use policy routing if the PA can do some sort of reply-to to make sure replies come back over the same link. And if you only need to open connections toward the PA.

                  Steve

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