Script to restart openvpn lan-to-lan

Home Page Forums Network Management VPN Script to restart openvpn lan-to-lan

This topic contains 2 replies, has 2 voices, and was last updated by  Massimo Renzi 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #64421

    Massimo Renzi
    Participant

    Hi to everybody,
    I’ll try to describe my problem:

    OPENVPN LAN-TO-LAN
    SITE A – CLIENT
    SITE B – SERVER

    Due to power failures in site B, every night the zeroshell box shutdown, and when it restarts the VPN remains down.
    To restart it, I’ve to connect to zeroshell webgui site A, vpn lan-to-lan, and click on “save” to restart.

    Is it possible to daily restart the vpn by a scheduled script on zeroshell site A?

    Thank you

    #65200

    Guillermo Reyes
    Participant

    Massimo,

    You can try the following:
    1. On ZS WebGUI go to Setup – Scripts/CRON
    2. In the Scripting Editor click on the Add Job button on the lower right corner of the window.
    3. It will prompt for a name for your script. Type a name like (VPNRestart) and click Ok.
    This will create a new empty script.
    4. On the script text dialog add the following line at the bottom:

    /root/kerbynet.cgi/scripts/vpn_ctl VPN00 up

    Please note that in the example we are going to start VPN00. Change it to reflect the VPN you need
    to start.

    5. At the bottom of the window you can set the schedule time for the script to execute.
    6. Click on the Status checkbox to enable.
    7. Click Save button to activate.

    Regards,
    Guillermo

    #65206

    Massimo Renzi
    Participant

    Hi Guillermo,

    I will try to follow your instructions, thank you very much.

    Regards

    Massimo

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.