Openvpn with uci

1 It seems that openvpn-nossl installs the init.d script, but it won't work with uci?
2 luci-app-openvpn installed /etc/config/openvpn, but there is no cli nor doc for me?
So it's impossible to start a uci openvpn instance from cli?
And btw, how does luci-app-openvpn get started up? cause there's no init.d script for me...

The LuCI app is for managing the config through LuCI, the OpenWrt GUI.

UCI is used, among other things, to transform OpenWrt-style config files to the form that OpenVPN expects.

You should be able to start the daemon by /etc/init.d/openvpn start That script will provide hints as to the configuration parameters needed, as would https://openwrt.org/docs/guide-user/services/vpn/openvpn/basic and the related pages.

Edit: I don't agree with everything on that guide, but it does provide insight into the config parameters.

After spending a day or two studying procd scripts,
I finally notice that in /etc/init.d/openvpn, it will read /etc/config/openvpn and create syslog and status at /var/run/openvpn.$name.status.
So,

  1. manually edit /etc/config/openvpn then service openvpn restart, I recommend adding option enabled 1 and option config /etc/openvpn/$name.conf.
    Option enabled is needed otherwise no instance of openvpn will be started and you'll find nothing in syslog.
    By using option config, we can use the good familiar openvpn config file, which is kinda crossplatform.

  2. to check output, use logread or logread -f to follow. To check status, use cat /var/run/openvpn.$name.status

  3. don't use luci-app-openvpn, cuz it will overwrite the config file.The config file provides useful comments and examples. Reinstall openvpn-xxxxx package to get the config file back if needed.

Unfortunately, none of the above were mentioned in user guide lol

2 Likes

Minimal OpenVPN setup can work using only binary, init-script and /etc/openvpn/*.conf.
Both luci-app-openvpn and UCI configuration are optional and required only for instance management.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.