Networking Forums

Networking Forums > Computer Networking > Linux Networking > OpenVPN routes lost on DHCP lease renewal

Reply
Thread Tools Display Modes

OpenVPN routes lost on DHCP lease renewal

 
 
Jan Thomä
Guest
Posts: n/a

 
      06-04-2009, 11:13 AM
Hi,

i have been working with OpenVPN for quite some time and have had
little issues. I am now working in an environment where most of the
OpenVPN routes are lost when the DHCP lease is renewed. This leads to a
"network deadlock", as the OpenVPN server (10.8.0.1) is still set up as
the default gateway, but all other routes have been removed, so the
server is practically unreachable. I have to restart the VPN connection
at that point. Since the lease is renewed every 10 minutes or so, VPN
is quite unusable in this environment. Is there a way I can prevent the
routes from being deleted when the lease is renewed, or do you know of
a script which tracks if the routes are there and restores them once
they disappear? Any help would be greatly appreciated.

Kind regards,
Jan

 
Reply With Quote
 
 
 
 
Arno Schuring
Guest
Posts: n/a

 
      06-14-2009, 06:06 PM
Jan Thomä wrote:
> Hi,
>
> i have been working with OpenVPN for quite some time and have had little
> issues. I am now working in an environment where most of the OpenVPN
> routes are lost when the DHCP lease is renewed.


Assuming a default Linux distribution, you're probably running the ISC
dhclient. In this case, take a look at /sbin/dhclient-script and
associated hooks (in Debian they are below /etc/dhcp3/). But there's
also udhcpcd (embedded), dhcpcd (bsd) and network-manager has its own
dhcp client, I believe. So: more info needed!

If the openvpn routes are permanent (and you are running the ISC
client), you might want to look into writing an exit hook for it so that
they are reconfigured automatically, this can even be done based on a
configuration parameter sent down from the server.

That said, routes should only be deleted if the hosts IP address has
changed. If they are deleted in case of a lease renewal as well, you
might want to file a bug with your distribution.

> Is there a way I can prevent the routes from being deleted when the
> lease is renewed, or do you know of a script
> which tracks if the routes are there and restores them once they
> disappear? Any help would be greatly appreciated.


This is an ugly kludge, but you might want to try to write a pair of
entry/exit hooks that save the routes on entry, and restore them on
exit. This solution is probably so ugly that no one would admit to
having written a script for it...


Good luck,
Arno
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PPTP VPN lost when DHCP lease renewed Rob Windows Networking 3 05-26-2010 03:39 PM
DHCP Server Lease setting lost after restart Danny Windows Networking 2 08-28-2006 08:07 PM
I need to configure DHCP server to force client to obtain a new ip address upon lease renewal malazc@gmail.com Linux Networking 1 07-20-2006 10:21 PM
DHCP IP lease renewal ok, but a new PC can not obtain an IP ("An error occurred while renewing interface Local Area Connection : unable to cotact your DHCP server. Request has timed out.") Soren Mikkelsen Windows Networking 2 06-02-2005 04:43 PM
DHCP Lease Renewal apiro Wireless Internet 0 12-10-2004 06:07 PM



1 2 3 4 5 6 7 8 9 10 11