on my router (19.07.7) I have an openvpn client installed and I can configure, start and stop it via the web-interface.
But I cannot figure out how to start it from the command line.
I would have expected something like "sudo /etc/init.d/openvpn start" (yes - I treat my router a bit like a linux-system and log in via a non-root user and have sudo installed) but that does not seem to do anything (it does not throw any error either).
So with everything in place, openvpn installed and working via lucy with a valid opvn-file in /etc/openvpn/ovpn1: How do I start the client from the command line?
First of all (as I explained above) I do (ususally) not log into my router as root. I have created a non-root user and have setup sudo for it. With this user I evidently need to use sudo.
I have now tried to log in as root and run the command without sudo and the behaviour (as expected) is identical. No error - but no started client either.
If I run (as root) "openvpn /etc/openvpn/ovpn1/myfile.ovpn" an openvpn process is started but it does not work properly - I lose all internet access until I kill it again.
It looks like you are using the GL-inet firmware, which is based on OpenWrt, but is different. Can you confirm if you have loaded an official version of OpenWrt or if you are using the stock firmware?
Please run the following commands (copy-paste the whole block) and paste the output here, using the "Preformatted text </> " button:
At least on the official OpenWrt builds, the LuCI OpenVPN app triggers /etc/init.d/openvpn start -- and when it does this, it will look for the OpenVPN configuration that is enabled in /etc/config/openvpn -- it's as simple as that.
As I mentioned in my previous post, you may be running a GL-inet version of OpenWrt which may operate differently. Please confirm the version you are running.
ok... good. So that looks like it is probably the official OpenWrt build. I would recommend upgrading to 19.07.10 (which is the latest, but the 19.07 series is now officially EOL), or better yet 21.02.3.
Let's take a look at your config files (as mentioned below -- please redact any sensitive info:
Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
cat /etc/config/network
cat /etc/config/openvpn
Then, try to start the VPN by issuing: /etc/init.d/openvpn start
and provide the log that results from that (again, redact any private details)
Hello! Have you found a solution? Because I've a TRENDnet router (TWG-431BR) which have a subset of openwrt installed with openvpn. And as you said when I connect from the cli I loose the internet connection. In the trendnet webapp I can only create a openvpn server.
Your device is not supported by the official OpenWrt Project (it doesn't show up in the table of hardware)
This is not official OpenWrt.
You should ask the provider of the firmware (Trendnet or a 3rd party) since this is not OpenWrt and a "subset" will not work the same way that the real openwrt firmware does.