DD-WRT OpenVPN Restart Script

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page Previous  1, 2
Author Message
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1447
Location: Appalachian mountains, USA

PostPosted: Wed Aug 07, 2019 18:06    Post subject: Reply with quote
Update to the below at https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1172761, where I went further and posted a script for the Linksys WRT... crowd to connect the vpn restart to the SES button. Minimal modification should make it play on other routers as well.

==============

Hate to say it, but my experiments just now, in release 40009, suggest that the heart of the matter, the actual restart of the openvpn client, has either gotten much simpler of late or that you are just overcomplicating things a bit.

Turns out the route-down.sh and route-up.sh business is already set up to happen automagically. Do ps | grep openvpn in a wide (to see the whole command) ssh window to have a look at the original openvpn setup command. So to restart the vpn from the command line, in the ssh window to the router, just do killall -HUP openvpn or, in your linux box that is already set up to do ssh to the router with certificates (and ideally with ssh-agent and ssh-add having already been used appropriately), just do

ssh root@routerIP killall -HUP openvpn

or in bash set up an alias in .bashrc or whatever to save you the typing when you need to restart. Visiting https://www.privateinternetaccess.com/pages/whats-my-ip/ or your favorite alternative to show you your public IP before and after will quickly confirm the restart. Or look in the GUI under Status>VPN and read the log. You'll see the restart clearly identified there.

_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
Sponsor
Goto page Previous  1, 2 Display posts from previous:    Page 2 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum