Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use vpnc on Linux, and with our corporate VPN setup (it's a Cisco something or other router), it's not exactly rock-solid. I run most things inside screen, so it's not a huge deal, but isn't there some way of maintaining connections across VPN restarts?

It seems like if I had a separate router box running vpnc, I would get it for free just by setting that box as my gateway. How can I emulate the same behavior with a single box?

When the VPN restarts, I get a different IP address and MAC address on the tun0 or tap0 device.

I tried playing games by using tap0 for the tunnel and then bridging it to various things (dummy devices, loopbacks, etc.), but couldn't get anything working.

share|improve this question

You could run ppp over your VPNed connection to something on the other side that gives you a static IP. Run all of your stuff over that connection, and make it auto reconnect.

I wouldn't call it pretty, but it would work! :)

share|improve this answer
+1 - sweet hack – James Dec 24 '09 at 14:50
I feel like I got the idea from somewhere... no idea where. – Bill Weiss Dec 28 '09 at 21:07

If your IP address changes when the VPN restarts there's really not much you can do about it - the change of IP address is going to kill any active sessions.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.