How to track the current remote endpoint IP

How to customize and extend your OpenVPN installation.
archimede.pitagorico
OpenVpn Newbie
Posts: 6
Joined: Mon Feb 13, 2017 2:08 am

How to track the current remote endpoint IP

Postby archimede.pitagorico » Wed Feb 15, 2017 2:32 am

I have a VPN client configured so that it connects randomly to a pool of possible UDP VPN servers, and, if connection drops, automatically reconnect perhaps to a different server.

I would like to track which is the selected IP of the end point.

I can think of two ways of doing that:
1) Monitor the log and grep for messages starting with "UDP link"
2) setting up a management interface and activate "state on"

Is there a more elegant way to do that, like telling openvpn to call a certain script every time the remote end point changes?

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 2252
Joined: Fri Jun 03, 2016 1:17 pm

Re: How to track the current remote endpoint IP

Postby TinCanTech » Wed Feb 15, 2017 2:39 am

You mean your client ?

archimede.pitagorico
OpenVpn Newbie
Posts: 6
Joined: Mon Feb 13, 2017 2:08 am

Re: How to track the current remote endpoint IP

Postby archimede.pitagorico » Wed Feb 15, 2017 3:45 am

Yes, I would like to know what is the IP of the endpoint my client is currently connecting to, and be notified if the endpoint IP changes.

archimede.pitagorico
OpenVpn Newbie
Posts: 6
Joined: Mon Feb 13, 2017 2:08 am

Re: How to track the current remote endpoint IP

Postby archimede.pitagorico » Wed Feb 15, 2017 6:16 am

Perhaps I misunderstood the question: it is not my own VPN client implementation, with "I have a VPN client" I mean "I have an instance of openvpn running on my linux machine".

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 2252
Joined: Fri Jun 03, 2016 1:17 pm

Re: How to track the current remote endpoint IP

Postby TinCanTech » Wed Feb 15, 2017 11:59 am

Try one of the script hooks.


Return to “Scripting and Customizations”

Who is online

Users browsing this forum: No registered users and 2 guests