View Full Version : [ubuntu] VPN auto dial upon request

January 18th, 2011, 01:23 AM
I have a server running as a gateway for several computers ..
Is it possible to make the server automatically connect to a remote server via VPN when the server gets requests for the IP range that belongs to the remote server ?

scenario ..
- asks the gateway ( for webserver
- the gateway ( initiates VPN dial to the remote server ..
- the gateway ( routes the traffic for 192.168.253.* through the vpn interface
- the gateway ( disconnects the VPN connection after 10 min idle time

Is this possible ?

January 18th, 2011, 05:38 PM
It might be possible if you "wrap" the VPN server daemon with xinetd (http://www.xinetd.org/), though I'm not sure whether it will stay up this way.

A quick browsing of Google brings me to this posting (http://www.nslu2-linux.org/wiki/HowTo/SetUpOpenVPNServer) which provides code to use xinetd in this fashion.