What's new

Notification of successful VPN connection?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

BGood

Regular Contributor
I seldom need to connect back to my Asus router via OpenVPN, but I'd prefer to leave it enabled just in case. When I do that, there seems to be a lot of attempts to connect. I don't suppose anything can be done about attempts. But I would like to be sent a notification email of any successful VPN connection. Is there a script or something I could install to do that?
 
I seldom need to connect back to my Asus router via OpenVPN, but I'd prefer to leave it enabled just in case. When I do that, there seems to be a lot of attempts to connect. I don't suppose anything can be done about attempts. But I would like to be sent a notification email of any successful VPN connection. Is there a script or something I could install to do that?
Why not just use an alternate port? Something beyond the quick port scan limits. I just chose a port at random and looked for problems as I used it. Seems to have stopped all attempts in my case.
 
I would like to be sent a notification email of any successful VPN connection.

Is there a script or something I could install to do that?

You can use the OpenVPN Server '-client-connect' directive see OpenVPN v2.4 Reference Manual
e.g. In the OpenVPN Server Customisation panel enter
Code:
client-connect    /jffs/scripts/VPNClientConnect.sh
I posted a script VPNClientConnect.sh so all you need to do is insert your own custom e-mail Send_email() function at the top of the script, and uncomment the line at the bottom of the script
Code:
#Send_email $TEMPFILE
 
Thanks for both replies! I'll look into Martineau's script soon. As for changing the port, I have a few relatives (not in my area) that once in a while connect using my VPN and I'm not sure I can change the default port easily without possibly breaking them.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top