What's new

Restart openvpn upon WAN ip address change

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

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
 
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.
 
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.
 
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

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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