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

    Restart IPsec VPN after a few minutes

    Scheduled Pinned Locked Moved IPsec
    2 Posts 2 Posters 981 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.
    • U
      ualucas
      last edited by

      Hello everyone,

      My company just upgraded to a Netgate router with pfSense, and we're having some trouble keeping one tunnel up.

      After a few minutes, it just stops working, although in Status it shows as "Established". If I manually disconnect it and connect it again, it works, and then it dies after a few minutes again.

      I was experimenting with the command "ipsec restart" but it restarts every single connection. Is there a way to restart just the connection that I want? Or perhaps a better, automated solution?

      Thanks.

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        The best thing to do would be to figure out why it's disconnecting and correct that. The logs would be helpful with that.

        Failing that, you can use the ipsec up and ipsec down command on 2.4.x to up/down single tunnels, for reference look at how it's done when clicking the buttons on on status_ipsec.php https://github.com/pfsense/pfsense/blob/RELENG_2_4_4/src/usr/local/www/status_ipsec.php#L54

        On 2.5.0 it's similar but there it uses swanctl --initiate and swanctl --terminate

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

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