Start program after connection

How to customize and extend your OpenVPN installation.

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

Post Reply
peq
OpenVpn Newbie
Posts: 2
Joined: Wed Jan 09, 2019 1:11 pm

Start program after connection

Post by peq » Wed Jan 09, 2019 1:36 pm

Hi Forum.
Not sure if I search this right - see please guide me in the right direction.
VPN Server: Debian9 OpenVPN
Clients: OpenVPN-Gui 11.7.0.0

I have some OpenVPN servers different places, but since there are many IP's in these setups - I would like the clients to open a webpage after successfull conection where all locally installed PLC etc are listed. This website I have running

So actually its sounds quite easy - But when I'm Connecting from Windows10 - with openVPN-Gui - I want a local browser on the Windows -to open a certain website.
How should I do this ?
in CMD - you can type

Code: Select all

start firefox http://DNS-IP
SHould it be a script placed on the Serverside - that'll push the command to the clients - or could I somehow add to the client-configuration that I want to run this script after successfull connection

Thanks in advance

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

Re: Start program after connection

Post by TinCanTech » Wed Jan 09, 2019 1:43 pm

https://community.openvpn.net/openvpn/w ... nPage#lbAS

--up is most likely what you want.

However, I don't know if it will do what you want because, by design, openvpn will not pass data over the VPN until all scripts have completed their execution.

peq
OpenVpn Newbie
Posts: 2
Joined: Wed Jan 09, 2019 1:11 pm

Re: Start program after connection

Post by peq » Wed Jan 09, 2019 2:06 pm

As I understand - then it properly not will not work becarse no connection yet.
As I see this - i could only be with --route-up ( which is actually the last part of the connection)
But there's no way to make sure firefox is starting after the VPN is successfully connected - on the Windows Client using OpenVpn-Gui

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

Re: Start program after connection

Post by TinCanTech » Wed Jan 09, 2019 2:25 pm

The GUI has a pre-connect script ..

Post Reply