Connect and Disconnect server from external aplication

This forum is for admins who are looking to build or expand their OpenVPN setup.
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See https://forums.openvpn.net/viewtopic.php?f=30&t=21589 for an example.
rul3s
OpenVpn Newbie
Posts: 2
Joined: Wed May 17, 2017 9:38 am

Connect and Disconnect server from external aplication

Postby rul3s » Wed May 17, 2017 9:55 am

I'm writting an windows aplication that uses OpenVPN as a server.
At first I was doing all the actions manually via openvpn-gui, start, connect, disconnect and kill.
Nowadays I'm doing this by CMD doing a openvpn-gui --connect config.ovpn to automatice this action, but, I'm having problems when disconnecting and connecting againg.

My wish would be to connect and disconnect without seeing it, in background, and I don't understand how to do it. I've readed about the management interface that if you enable it you can send commands trought it via localhost in windows, but I don't find examples how to do it.
I'm developing my windows app in QT so I can run CMD commands and send TCP messages.

Can anyone give me some examples to do those actions?

1- Start openvpn daemon with management port enabled.
2- Send connect message trought management.
3- Send disconnect trought management.
4- Stop openvpn daemon.

I've tried the following, but with no results.
openvpn --dev tap0 --management localhost 7505
this seem to start daemon with management interface, so then, in another window:
openvpn --management-client localhost 7505 -> doenst work
telnet localhost 7505 -> neither

So how to do this?

Thanks for your help.

rul3s
OpenVpn Newbie
Posts: 2
Joined: Wed May 17, 2017 9:38 am

Re: Connect and Disconnect server from external aplication

Postby rul3s » Wed Jun 14, 2017 7:15 am

Nothing? Can't anybody give me a little advice or something?


Return to “Server Administration”

Who is online

Users browsing this forum: No registered users and 4 guests