Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    Pfsense Ipsec not auto connecting when cron job added.

    Scheduled Pinned Locked Moved General pfSense Questions
    8 Posts 3 Posters 273 Views 3 Watching
    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.
    • A
      abarna
      last edited by

      in my cron job
      image.jpeg

      1.)Following is not working in 2.8.0, and above version is it true. can u give explanation?
      2) Also, ipsec tunnel gets auto connected somehow even without cron job how that possible?

      Please give proper answer for this when version upgraded , how it will work and also php upgradation has impact on this?

      luckman212L 1 Reply Last reply
      Reply Quote 0
      • luckman212L
        luckman212 LAYER 8 Rebel Alliance @abarna
        last edited by

        what are you trying to do with those cronjobs? just trying to blindly start those 3 tunnels every 5 minutes seems silly. Combine it into 1 script and check each connection first, only try start if the tunnel is down. Also ipsec is not the command anymore, pfSense uses strongswan, so try swanctl eg

        /usr/local/sbin/swanctl --initiate --timeout 5 --child con1
        

        You could check out another post I made a little while ago as a starting point…

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

          IPSec has built in features to auto-connect anyway. Which both explains why you're seeing it connect and should render those cronjobs pointless.

          But, yes, why are doing that?

          A 1 Reply Last reply
          Reply Quote 0
          • A
            abarna @stephenw10
            last edited by

            @stephenw10 In my case not working 2.8 version

            luckman212L 1 Reply Last reply
            Reply Quote 0
            • luckman212L
              luckman212 LAYER 8 Rebel Alliance @abarna
              last edited by luckman212

              @abarna it would be more helpful if you posted some logs and described exactly what was "not working". Are these tunnels not coming up at all? or coming up and then failing at some point? Post your System log, Gateway log and IPsec logs...

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

                What version was it working in?

                What did it do when it was workng?

                What is it doing (or not doing) in 2.8.0?

                A 1 Reply Last reply
                Reply Quote 0
                • A
                  abarna @stephenw10
                  last edited by abarna

                  @stephenw10 {5BF6B3E8-5DE1-4070-8106-0E6F336BC3C1}.jpeg in cron job it is added

                  2.8.0-RELEASE (amd64) -version

                  Ipsec command is depreciated when
                  Hope php upgrade has no impact on this?

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

                    But why have you added those?

                    And, like @luckman212 said above, ipsec is deprecated. Use swanctl instead if you really need to manipulate the tunnels manually.

                    1 Reply Last reply
                    Reply Quote 0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better đŸ’—

                    Register Login
                    • First post
                      Last post
                    Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
                    Privacy Policy · Cookie Policy