I'm new to openwrt
I managed to get vpn client up and running using the wiki https://openwrt.org/docs/guide-user/services/vpn/openvpn/client-luci
but I tried to start the vpn without enabling it but it won't start. I have to enable it first start then i can stop and start it again. however, I don't want it to start automatically on boot as explained in the wiki "enable" is for it to start automatically with boot. how can I just start it without checking "enable" ?
edit: im using openwrt V19 RC1 because RC2 had an issue with wifi it didn't have the issue with RC1
does it start without ticking enable?
If your desire is to turn it off and on manually, you'll likely have to setup by adding/removing the relevant routes instead.
what do you mean?
manual set up instead of config file?
I mean, you describe this problem:
- Router boots
- OpenVpn Starts
But instead you desire:
- Router boots
- OpenVPN does not start
To do so, toggle the routes instead of trying to toggle the VPN. The VPN will stay on, but until you toggle the routes, it will not be used.
thank you for your response
would you be kind and tell me where I can toggle the routes?
I'm new to openwrt and it has been a fun learning curve to me
can't anyone help?
You can write script and run it with parameters to perform special tasks like yours.
Same issue here. Does it mean that the intended behavior of OpenVPN is for an instance to start upon boot. One cannot boot AND THEN start OpenVPN by clicking on "start" and without using "enabled"? Thanks!
The OpenWrt OpenVPN package provides an init script which reads the config file and launches zero or more instances of OpenVPN depending on how many are configured and enabled in the file. The script is a Linux service like any of the others on the Startup page. The Enabled / Disabled setting there determines whether the script will start at boot. Even while starting at boot may be Disabled, it can still be started manually with the Start button. If a service is Enabled, but you stop it manually with the Stop button, it will not start by itself again until a reboot or press of the Start button.
Enabling individual instances to launch when the script runs (typically at boot, or when the service is restarted) are the check marks on the OpenVPN configuration page. The typical use case of these is when you subscribe to one of the major commercial VPN services that offers servers in several countries, and you want to have more than one of them configured, but it only makes sense to connect to one at a time. If Enabled is not checked on the OpenVPN page, that instance will not start under any circumstance.
Thanks for the reply! The workaround I have found is to enable all of them and then stop them by adding a command to /etc/rc.local
2 YEARS LATER
That's pretty f'N tricky
Don’t know why you bother.
With 3 instances selected, on boot the init script runs and finding 3 instances set, starts all 3 instances. Your
rc.local doesn’t run until
Init finishes at which point it shuts down all 3.
As mk24 explains: set them all off. On boot the enabled init script runs, finds no instances to invoke, and exits. Done.
When you want a vpn instance, just click on your choice, save/apply, the hotplug fires up the init script that finds your selection enabled and starts the instance.
I am not sure I understand what you suggest.
As you say, my current configuration starts the three instances on boot and stops them right after. By doing so, I can later issue
openvpn start istanceName via ssh and start the VPN instance I want.
Unfortunately, if no instance is set as "enabled", issuing that command does not do anything.