How to start/stop OpenVPN client from command line


#1

Hi,

I have import the client.ovpn file, and work perfectly will I activate the connection by clicking the connect button.

But I wonder how I can start and stop the connection from command line, I tried to run the full command that is shown in “ps” command it does not work.

Anybody knows the trick?


#2

it is simple

openvpn /etc/openvpn/xxxxxx.ovpn

This starts the vpn but not necessary fix firewall rules. You still need to change firewall in order to route correctly.


#3

I did notice using
/etc/init.d/startvpn restart

doesnt work anymore – seems to get hung up


#4

It should work. Did you modify your ovpn manually? there should be a line

daemon

#5

Found the bug in startvpn. Does not like spaces in the ovpn file names. Added a fix to the tracker:
https://bugs.gl-inet.com/view.php?id=98


#6

I think this should be fixed already. Maybe you are using an old version?

Pls specify your model and version.


#7

I am on 3.013 on 300M. I just verified by unpacking the tar image from http://download.gl-inet.com.s3.amazonaws.com/firmware/ar300m/nand/testing/gl-ar300m-3.013-0128.tar the bug is present there.


#8

Got it. Thanks. We will check.

This should be fixed already.