Connecting has failed (how to make GUI to connect automatically)

Need help configuring your VPN? Just post here and you'll get that help.

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

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
wrath666
OpenVpn Newbie
Posts: 1
Joined: Sat Mar 25, 2023 10:46 pm

Connecting has failed (how to make GUI to connect automatically)

Post by wrath666 » Sat Mar 25, 2023 11:17 pm

Hi community,
I am using OpenVPN GUI V 2.6.1 on My Win 7 (64x).


The task is very simple - how can I make GUI to connect automatically to the necessary configuration and disconnect the initial ?

The detailed description of the issue is below:

1. I am connected to cfg successfully.
Image
Image



2. I want to switch to another cfg and click "connect":
Image




3. I get the following error afterward (see the screenshot):
"connecting to configuration has failed"
Image

Why should I first disconnect the initial connection and only after that connect to another? It is not convenient at all.




I tried OpenVPN connect, and it works perfectly, but for some reason I need to use OpenVPN GUI.


P.S: Just added the new TAP-Windows adapter V9 #2 - GUI shows that I have connected to both configurations, which is not a solution.

Image



I just want to connect to the desired configuration in just one click and disconnect automatically the 1st one, not working simultaneously - that's all (like realized in another vpn services :NopvVPN,mullvad, Windscribe etc).

Any ideas on how to fix it?


Thank you in advance.

never-stop-learning
OpenVPN User
Posts: 39
Joined: Sat Oct 02, 2021 3:57 pm

Re: Connecting has failed (how to make GUI to connect automatically)

Post by never-stop-learning » Sun Apr 02, 2023 7:55 am

Hey man, you have the option to create a script(ex. batch file), for example currently you are connected to your profile1.ovpn then you should execute the below script to connect to profile2.ovpn

Code: Select all

"C:\Program Files\OpenVPN\bin\openvpn-gui.exe" --command disconnect profile1.ovpn
timeout 5 > NUL
"C:\Program Files\OpenVPN\bin\openvpn-gui.exe" --command connect profile2.ovpn



And vice-versa when you would like to connect to profile2.ovpn with auto-disconnecting the profile1.ovpn, then run the script below.

Code: Select all

"C:\Program Files\OpenVPN\bin\openvpn-gui.exe" --command disconnect profile2.ovpn
timeout 5 > NUL
"C:\Program Files\OpenVPN\bin\openvpn-gui.exe" --command connect profile1.ovpn

Post Reply