Navigation

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

    How to dis/connect VPN from shell?

    IPsec
    1
    1
    485
    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
      joselebert last edited by

      Hi everyone, thanks in advance for your help!

      We have an IPSec VPN with one of our customers (Checkpoint on the other side) that suddenly loses one of it's SA -shown in the IPSec status page- and we have to manually re-connect the VPN. Imagine what a distress that causes in our team and developers on a saturday morning (specially our IT team!).

      So I created a script to be executed with 'cron' but it doesn't seem to work. It only makes thing worse! The whole VPN goes down.

      Here's the script:

      #!/bin/sh
      
      /usr/local/sbin/ipsec down con6000
      sleep 3
      /usr/local/sbin/ipsec up con6000
      /usr/local/sbin/ipsec route con6000
      
      

      So I'm wondering… how could I create a script to disconnect and reconnect the VPN? The URL that reconnects the VPN in the web admin is: https://pfsense.firewall/status_ipsec.php?act=connect&ikeid=6000

      Any help and hints you could provide will be very much appreciated!

      Thanks!!

      1 Reply Last reply Reply Quote 0
      • First post
        Last post