Restart openvpn upon WAN ip address change

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

ojigi

Occasional Visitor
Hi,

Is there a recommended way to restart OpenVPN when wan ip changes (I've actually had the same public IP with my ISP for >7 years but you never know)?

The reason why I would like it is because I bind OpenVPN (ovpn-server) to the wan ip address using local ("local host.example.com").
I'd like the OpenVPN Server to work even after wan ip change and to my knowledge I can use OpenVPN's local option with an interface (i.e. "local eth0").

BR
 

ColinTaylor

Part of the Furniture
I don't understand what kind of scenario you are anticipating. If your WAN IP changes while the router is up then the WAN interface must have gone down/up. So the router will detect that and restart all the services associated with the WAN interface including the VPN.
 

ojigi

Occasional Visitor
I'm not sure that it must have gone up/down. What if the DHCP lease expires and the WAN interface gets new IP from the ISP?
Does the WAN interface really go up/down then. I know it's an edge case (I've had the same IP for 7+ years), but still.
 

ColinTaylor

Part of the Furniture
I'm not sure that it must have gone up/down. What if the DHCP lease expires and the WAN interface gets new IP from the ISP?
Does the WAN interface really go up/down then. I know it's an edge case (I've had the same IP for 7+ years), but still.
You're trying to fix a non-existent problem. The router will start trying to renew its lease half way through the lease duration. If it gets given a different IP than before it will take the appropriate actions.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top