# IPsec and Connection Scheduler

**URL:** <https://community.ipfire.org/t/ipsec-and-connection-scheduler/9558>\
**Category:** IPsec\
**Created:** [4 April 2023 10:39 UTC](https://community.ipfire.org/t/ipsec-and-connection-scheduler/9558 "2023-04-04T10:39:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lexuspolaris](https://community.ipfire.org/user_avatar/community.ipfire.org/lexuspolaris/32/15351_2.png) [@lexuspolaris](https://community.ipfire.org/u/lexuspolaris)\
**Post date:** [4 April 2023 10:39 UTC](https://community.ipfire.org/t/ipsec-and-connection-scheduler/9558/1 "2023-04-04T10:39:22Z")

</div>

Hey there,

I try to configure an automatic start and stop time for the IPsec-host but the option in the connection-scheduler does not seem to have the effect, that I hoped for. 🙂

IPsec is fully configured and works perfect.

 ![Bildschirmfoto vom 2023-04-04 12-23-37](https://community.ipfire.org/uploads/default/original/2X/4/47ec7b7d19ee33971d7a59aec171fa6120cb05d7.png)

Now my goal is to “automate” the clicking of the “activate”-field at the top of the menu and hitting the “save”-button at a specific time (and deactivate it again later).

I tried it with the connection scheduler because it offers the option to “(re)start IPsec” but that does not seem to have any effect or at least not the same effect as “activating” IPsec.

 ![Bildschirmfoto vom 2023-04-04 12-25-24](https://community.ipfire.org/uploads/default/original/2X/e/ecfa3343dea1bb993f9eddb2150399b3c41bc49a.png)

I cross-checked with starting the “IPsec-service” from the terminal (/etc/init.d/Ipsec start) but that does not do the trick either.

Anyway, when I follow the log-messages, it seems like “activating” IPsec in the menu does a lot more, like loading certificats, etc. so what is the option in the connection-scheduler for?

And what commands are needed to automate “clicking activate” in the IPsec-menu?

Thanks in advance and greetings

Alex

---

<div class="post-metadata">

**Author:** ![arne\_f](https://community.ipfire.org/user_avatar/community.ipfire.org/arne_f/32/12760_2.png) [@arne\_f](https://community.ipfire.org/u/arne_f)\
**Post date:** [4 April 2023 11:00 UTC](https://community.ipfire.org/t/ipsec-and-connection-scheduler/9558/2 "2023-04-04T11:00:57Z")

</div>

> [@lexuspolaris](#):
>
> And what commands are needed to automate “clicking activate” in the IPsec-menu?

ipsecctrl S  
is the command that issued by the webgui if the checkbox is enabled and also by the connection sheduler ipsec start.

---

<div class="post-metadata">

**Author:** ![lexuspolaris](https://community.ipfire.org/user_avatar/community.ipfire.org/lexuspolaris/32/15351_2.png) [@lexuspolaris](https://community.ipfire.org/u/lexuspolaris)\
**Post date:** [4 April 2023 13:21 UTC](https://community.ipfire.org/t/ipsec-and-connection-scheduler/9558/3 "2023-04-04T13:21:05Z")

</div>

Hey Arne,

first of all, thank you very much for your quick reply! 🙂

I did some more “testing” and made some observations. 🤓

There is no check-mark appearing or disappearing when you refresh the IPsec-menu-site after you started or stopped IPsec either from the terminal (/etc/init.d/ipsec start) or via the connection scheduler. So I thought, this led to my confusion and solved the riddle, but unfortunately, there is more. 😕

When I start IPsec via the menu and stop it via scheduler or terminal and later start it again via scheduler or terminal, everything works great (Connection, No Connection, Connection).

BUT

When IPsec is not activated via the menu in the first place and I start it via connection scheduler or terminal, it just does not work.

I compared the log-messages (tail -f /var/log/messages) and the initiating-sequence is exactly the same. The difference is, that when I “cold-start” IPsec via terminal or scheduler, the firewall drops the incoming requests from the IPsec-client.

Maybe someone can reproduce this behavior or I misconfigured something. 🤪

Greetings

Alex

---

<div class="post-metadata">

**Author:** ![lexuspolaris](https://community.ipfire.org/user_avatar/community.ipfire.org/lexuspolaris/32/15351_2.png) [@lexuspolaris](https://community.ipfire.org/u/lexuspolaris)\
**Post date:** [4 April 2023 17:28 UTC](https://community.ipfire.org/t/ipsec-and-connection-scheduler/9558/4 "2023-04-04T17:28:26Z")

</div>

Short annotation:

When IPsec is “cold-started” via scheduler or terminal there is also no indication that it is running on the page main-page (System-\>Home).

Greetings and a nice evening. 🙂

Alex

---

<div class="post-metadata">

**Author:** ![franco](https://community.ipfire.org/user_avatar/community.ipfire.org/franco/32/10931_2.png) [@franco](https://community.ipfire.org/u/franco)\
**Post date:** [22 November 2023 11:48 UTC](https://community.ipfire.org/t/ipsec-and-connection-scheduler/9558/5 "2023-11-22T11:48:10Z")

</div>

Hi,

I am searching documentation about ipsecctrl commands.  
May I ask you if you have any refence?

Thanks in advance

Franco

---

<div class="post-metadata">

**Author:** ![bonnietwin](https://community.ipfire.org/user_avatar/community.ipfire.org/bonnietwin/32/12350_2.png) [@bonnietwin](https://community.ipfire.org/u/bonnietwin)\
**Post date:** [22 November 2023 14:30 UTC](https://community.ipfire.org/t/ipsec-and-connection-scheduler/9558/6 "2023-11-22T14:30:29Z")

</div>

> [@franco](#):
>
> I am searching documentation about ipsecctrl commands.  
> May I ask you if you have any refence?

Here is the source code for the ipsecctrl command. It has the info in it about the expected options.  
[https://git.ipfire.org/?p=ipfire-2.x.git;a=blob;f=src/misc-progs/ipsecctrl.c;h=ed42f36dbd620bbcc78ebb2ec85e12c632fea64d;hb=refs/heads/core181](https://git.ipfire.org/?p=ipfire-2.x.git;a=blob;f=src/misc-progs/ipsecctrl.c;h=ed42f36dbd620bbcc78ebb2ec85e12c632fea64d;hb=refs/heads/core181)

If you try and run ipsecctrl without any options it will show you the allowed options which would be the other approach to use.

---

<div class="post-metadata">

**Author:** ![franco](https://community.ipfire.org/user_avatar/community.ipfire.org/franco/32/10931_2.png) [@franco](https://community.ipfire.org/u/franco)\
**Post date:** [23 November 2023 11:46 UTC](https://community.ipfire.org/t/ipsec-and-connection-scheduler/9558/7 "2023-11-23T11:46:36Z")

</div>

THANKS!!!

Franco
