Client: Update static route to Server when local default GW changes

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
klaus3000
OpenVpn Newbie
Posts: 1
Joined: Tue Apr 18, 2023 1:34 pm

Client: Update static route to Server when local default GW changes

Post by klaus3000 » Tue Apr 18, 2023 1:43 pm

Hello!
I use the Windows client on my Notebook (2.6.2), and the server is configured with:

Code: Select all

push "redirect-gateway def1 bypass-dhcp"
So, everthing works fine, until my Notebook changes the Wifi Network and receives a new default-gateway (by DHCP). From that moment on, the client can not reach the server anymore, as the static route to the openvpn server still has the old default-gateway as next-hop. So, this static route needs to be replaced by a static route with the new default-gateway as next-hop.

So, I always have to reconnect openvpn to get the static route updated.

I think the client would have to watch the local default-route, and if this gets updated with a new default-gateway, the openvpn client should replace the static route. I have not found any client that is capable of that, or other utilities that could do that.

Are you aware of any tricks/workarounds/config-option to update the local static route whenever the local default gateway changes? Thanks

Post Reply