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

    How to start one tunnel IPSEC if another tunnel IPSEC is down

    Scheduled Pinned Locked Moved IPsec
    1 Posts 1 Posters 655 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.
    • J
      javcasta
      last edited by

      Hello.

      If i have two IPSEC tunnels defined in VPN > IPSEC > IPsec Tunnels.

      For example:

      P1 Description: Tunnel1 - Status: enable
      P1 Description: Tunnel2 - Status: disable

      How to start (set enable) tunnel2 IPSEC if tunnel1 is down?

      For monitor IPSEC I think maybe this script is good solution:

      #!/bin/bash
      #########################

      MonitorIPSEC.sh

      Create cron with /bin/sh /scripts/MonitorIPSEC.sh

      #########################
      ISDOWN=$(/usr/local/sbin/ipsec status | grep -c none)
      if [ $ISDOWN -eq 1 ]; then

      restart ipsec

      /usr/local/sbin/pfSsh.php playback svc stop ipsec
      /usr/local/sbin/pfSsh.php playback svc start ipsec
      fi

      But for specific tunnel

      /usr/local/sbin/ipsec up <tunnel1>?</tunnel1>

      ?

      Regards.

      Javier Castañón
      Técnico de comunicaciones, soporte y sistemas.

      Mi web: https://javcasta.com/

      Soporte scripting/pfSense https://javcasta.com/soporte/

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