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/openvpn.attributes.sh 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: https://forum.pfsense.org/index.php?topic=95947.0
-
You can use up/down scripts:
Add to custom server options:script-security 3 system; client-connect /usr/local/sbin/up.sh; client-disconnect /usr/local/sbin/down.sh;up.sh:
#!/bin/sh /full/path/to/your/console/email/appdown.sh:
#!/bin/sh /full/path/to/your/console/email/appmailx example:
echo "Client $common_name connected to $HOSTNAME" | mailx -r "your@mail.com" -s "Client $common_name connected to $HOSTNAME from $trusted_ip" -S smtp="your.smtp.com:25" -S smtp-auth=login -S smtp-auth-user="usr@smtp.com" -S smtp-auth-password="password" touser@mail.com > /dev/nullOpenVPN vars that you can use:
$common_name
$HOSTNAME
$ifconfig_local
$ifconfig_pool_remote_ip
$untrusted_ip
$trusted_ip
$dev -
This post is deleted!
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 LoginPrivacy Policy · Cookie Policy