OPNsense Forum

English Forums => Virtual private networks => Topic started by: renow on October 15, 2022, 07:33:13 PM

Title: Doing same action of Disconnect button in VPN IPSEC Status via script
Post by: renow on October 15, 2022, 07:33:13 PM
Hi,

I think, it's the first time in my life that a web button is better than a script command !

I have an IPSEC tunnel which lost often some of his phase 2,

- if I Disconnect from Status page, then reconnect.
-> All Phase 2 restart

If I script (for automation)
ipsec down con2
and
ipsec up con2,

-> only phase2 previously up restart...

Someone knows what more is doing disconnect button ?
Thanks for your help.
Regards,
Renaud MEDICI.
Title: Re: Doing same action of Disconnect button in VPN IPSEC Status via script
Post by: franco on October 17, 2022, 08:20:28 AM
I don't understand the question 100% but the scripts are

# configctl ipsec connect <conX>
# configctl ipsec disconnect <conX>

The actual scripts are /usr/local/opnsense/scripts/ipsec/connect.py and /usr/local/opnsense/scripts/ipsec/disconnect.py if you want to inspect them further.

Hope that helps.


Cheers,
Franco
Title: Re: Doing same action of Disconnect button in VPN IPSEC Status via script
Post by: renow on October 17, 2022, 12:41:31 PM
Hi Franco,

Thanks for your answer.
It works fine with configctl scripts.

Cheers,
Renaud MEDICI.