Disable OpenVPN clients on reboot
-
Why do i want this?
I can only have 6 connections to my VPN provider at any one time but I want to setup 10 OpenVPN clients to use on my network and only start the ones I want to use at that time. ie 2 blocks of five ('All in the UK'/'All over the world') which have different purposes. However when I reboot pfSense they all restart.
What do i know
- when i reboot pfsense all OpenVPN clients startup successfully
- all my OpenVPN clients are configured as interfaces and then gateways and these gateways are assign into 2 'Gateway Groups'
- I can manually stop and start OpenVPN clients via Status-->OpenVPN
- These services are not enabled in 'Service_Watchdog'
- I am aware of Shellcmd but I am not sure this is the best way about things to let the service start and then stop it. Also I dont know the commands.
What I would like
A settings page in pfSense where I can disable the OpenVPN clients on startup.
Any help would be appreciated.
-
@shoulders I understand your need and I have a similar setup. However with 2.70 I'm unable to get two clients to come up properly at boot. Your saying that your able to successfully launch 6 clients? I suspect a dpinger/openvpn timing issue somehow but I am no expert. I'm sure that your aware that each openvpn client and gateway can be disabled/enabled individually but this is essentially would require configuring a few different settings. I can visualize a configuration screen that lists available pre-configured openvpn clients with a checkbox after each one that allows them to be turned on/off. It would be a great feature but unfortunately only a few people with similar setups as ours would appreciate it. It's a good idea .Maybe a package? I wish I had the time and skills to do this. It's almost easier to restore a pre-configured backup to make these changes at reboot
-
My Solution
- Install Shellcmd package
- Package Manager --> Available Packages --> Install
- The shellcmd utility is used to manage commands on system startup.
- Add a boot command to disable the OpenVPN services
- Find your 'OpenVPN ID' and whether it is a client or server from VPN --> OpenVPN --> (Servers|Clients) --> edit
- Services --> Shellcmd --> Add
- Command
pfSsh.php playback svc stop openvpn server 1 or pfSsh.php playback svc stop openvpn client 3
- ShellcmdType: shellcmd
- Description: Disable my OpenVPN on boot
- Repeat for each OpenVPN service you want to disable
- Install Shellcmd package
-