How to track the current remote endpoint IP

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

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

How to track the current remote endpoint IP

Post by 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?

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: How to track the current remote endpoint IP

Post by TinCanTech » Wed Feb 15, 2017 2:39 am

You mean your client ?

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

Re: How to track the current remote endpoint IP

Post by 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: 7
Joined: Mon Feb 13, 2017 2:08 am

Re: How to track the current remote endpoint IP

Post by 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".

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: How to track the current remote endpoint IP

Post by TinCanTech » Wed Feb 15, 2017 11:59 am

Try one of the script hooks.

Post Reply