Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
Single openVPN client restart with cron
« previous
next »
Print
Pages: [
1
]
Author
Topic: Single openVPN client restart with cron (Read 3832 times)
MartinsZB
Newbie
Posts: 6
Karma: 0
Single openVPN client restart with cron
«
on:
July 25, 2019, 01:39:42 pm »
Hi!
I did read a lot of information, but can not figure out the following. I have two openVPN clients running. I would like to restart one of them using cron.
I find that I can restart whole openVPN service, but can not figure out, how to restart single client? It can be nicely done manually from GUI, but is it possible to schedule the restart?
Thanks,
Martins
Logged
birdpark
Newbie
Posts: 10
Karma: 1
Re: Single openVPN client restart with cron
«
Reply #1 on:
July 25, 2019, 04:47:48 pm »
As far as I know OpenVPN runs on virtual interfaces. You could make an up/down script that restarts that interface.
Logged
MartinsZB
Newbie
Posts: 6
Karma: 0
Re: Single openVPN client restart with cron
«
Reply #2 on:
July 26, 2019, 08:36:23 am »
Thanks! I tried the following.
My openVPN client is ovpnc3. If I do the "ifconfig ovpnc3 down" - under the interfaces it shows it as inactive. Although the client connection to VPN server seems still active. "ifconfig ovpnc3 up" brings the interface back up, but still with the same VPN connection.
What I want is to reconnect the openVPN client as I have multiple VPN servers defined with "select random server" activated.
Logged
birdpark
Newbie
Posts: 10
Karma: 1
Re: Single openVPN client restart with cron
«
Reply #3 on:
July 26, 2019, 06:05:03 pm »
What about using something like screen. Are you familiar with the screen command? I dont have other ideas
If it works, give me some karma or applause
«
Last Edit: July 26, 2019, 06:08:06 pm by birdpark
»
Logged
johnw230873
Newbie
Posts: 10
Karma: 1
Re: Single openVPN client restart with cron
«
Reply #4 on:
July 31, 2019, 08:57:16 pm »
Don't know if it helps but I found when the OPENVPN interface went down they just start using the standard gateway. I got around this by creating a new vlan only for the VPN clients and not OUTBOUND natting this vlan (all the rest of the setup was normal). Could this be what you are seeing when you down the interface, them flicking to another gateway to get out?
Logged
johnw230873
Newbie
Posts: 10
Karma: 1
Re: Single openVPN client restart with cron
«
Reply #5 on:
August 01, 2019, 07:56:07 pm »
opps - wrong topic
«
Last Edit: August 01, 2019, 08:46:11 pm by johnw230873
»
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
Single openVPN client restart with cron