Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple VPN's in a go #498

Closed
hellcry37 opened this issue May 19, 2022 · 6 comments · May be fixed by #502
Closed

Multiple VPN's in a go #498

hellcry37 opened this issue May 19, 2022 · 6 comments · May be fixed by #502

Comments

@hellcry37
Copy link

Hello,

I am using openvpn from some time now. I work on windows 10 and use openvpn-gui with --connect option

What I want to do is connect 2 vpn's at start so I edited the shortcut when I lunch it it connects both vpn's, but only is openvpn-gui is not already started.

for example:

I use "C:\Program Files\OpenVPN\bin\openvpn-gui.exe" --command connect vpn1 --command connect vpn2 both vpn connect correctly only if openvpn-gui is not started in windows sys try.

If openvpn-gui is started in windows sys try then one vpn get's connected and one does not (is totally ignored)

same for this:
"C:\Program Files\OpenVPN\bin\openvpn-gui.exe" --connect vpn1.ovpn --connect vpn2.ovpn

Windows 10
OpenVPN 2.5.5 x64

@hellcry37
Copy link
Author

forum discussion: https://forums.openvpn.net/viewtopic.php?p=106668

@selvanair
Copy link
Collaborator

When the GUI is running, the second instance is sending commands to it, and only one command per invocation is supported. Its meant to be used from scripts. For interactive uses one is expected to start the GUi using the shortcut only when the GUI is not running. Use the GUI menu when its running.

Here is a possible workaround (untested): write a small batch script as:

cd "C:\Program Files\OpenVPN\bin"
start /B openvpn-gui.exe --connect vpn1
timeout /t 2 /nobreak
start /B openvpn-gui.exe --connect vpn2
start /B openvpn-gui.exe --connect vpn3

Make a short-cut to this batch file, configure it to start minimized and add an icon.

The timeout is required for cases when it is used with the GUI not running. It takes some time for the GUI to come up and ready to accept commands from a second instance. You may have to tweak the 2 second value above.

Also, this may not work reliably if you have warnings during start up (like duplicate configs) which will delay the startup and thus lose the second command.

@hellcry37
Copy link
Author

thanks for your replay and help, still I'll leave this here maybe it will get fixed sometime

selvanair added a commit to selvanair/openvpn-gui that referenced this issue May 27, 2022
Currently we support only one --command action arg
type of option. Extend it to allow multiple such commands
in one invocation.

Trac OpenVPN#498

Signed-off-by: Selva Nair <[email protected]>
@hellcry37
Copy link
Author

I see you guys working on this, thank you very much. This is awesome!

@selvanair
Copy link
Collaborator

If you would like to test it, please try the executable built by github actions (https://github.com/OpenVPN/openvpn-gui/actions/runs/2394216812 -- scroll to the bottom of that page).

@hellcry37
Copy link
Author

tested and seem to work ok when gui is already lunched both vpn's connect, awesome work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants