Run openvpn without GUI in the client mode

5,511

OpenVPN provide a Windows Service for exactly this requirement. Open your computer management services windows and enable the openvpnservice .. This will auto start all openvpn config files in ..\openvpn\config directory.

Share:
5,511

Related videos on Youtube

Alan Coromano
Author by

Alan Coromano

Updated on September 18, 2022

Comments

  • Alan Coromano
    Alan Coromano over 1 year

    I need to run my openvpn binary file in the client mode from the command line or something (maybe from a python script) supplying it with location of the client.ovpn file, then connect to a server and then later properly disconnect. Of course, I don't need its GUI to be shown.

    How can I do that?

    I need to do it on Windows at the moment if it matters.

  • Alan Coromano
    Alan Coromano over 8 years
    and how to disconnect?
  • Alan Coromano
    Alan Coromano over 8 years
    and I don't want to auto start all openvpn conf files, reread my question.
  • dotvotdot
    dotvotdot over 8 years
    To stop openvpn you can simply stop the openvpnservice and this will exit all open configs. Rewrite your question to explain the specific problem.
  • Alan Coromano
    Alan Coromano over 8 years
    the question is to run it, but not autorun it on windows boot.
  • Alan Coromano
    Alan Coromano over 8 years
    I don't need to stop all open config. I want to be able to run and stop openvpn with one specific config at any given time.
  • dotvotdot
    dotvotdot over 8 years
    You can create a batch file to start and stop the openvpnservice and have only one configuration file in the openvpn\config directory. If you require multiple configs rewrite your question to clearly explain what you need.
  • Alan Coromano
    Alan Coromano over 8 years
    I'm saying again: run and close openvpn multiple time with different config file which may or may not be the "config" directory.