OpenVPN Server Notification on Connect

  • Hi,
    I'm trying to configure an email on connect to the pfsense openvpn server. I searched and came across a post suggesting to modify the file: /usr/local/sbin/ in the "client-connect" sections. I put some echos in there for output in a file, but I see nothing once a connection is established. Seems like the script is not running, but could this be only for the OpenVPN client connections and not server connections?

    Edit: I may have my answer here I guess:

  • You can use up/down scripts:
    Add to custom server options:

    script-security 3 system;
    client-connect /usr/local/sbin/;
    client-disconnect /usr/local/sbin/;



    mailx example:

    echo "Client $common_name connected to $HOSTNAME" | mailx -r "" -s "Client $common_name connected to $HOSTNAME from $trusted_ip" -S smtp="" -S smtp-auth=login -S smtp-auth-user="" -S smtp-auth-password="password" > /dev/null

    OpenVPN vars that you can use:

  • This post is deleted!

Log in to reply