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



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


Log in to reply