Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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've set up an OpenVPN server on a VPS (ubuntu 11.04) and configured clients (mix of ubuntu 11.10 and 12.04) to use it. After starting the VPN connection on the client, all internet traffic gets routed trough the VPS.

I would like to route only some of the traffic trough this setup. I have a list of domain names (which I could translate into IP addresses) and I want only those addresses to go trough the VPN, while all other should go out the normal way. I would very much prefer to maintaint all configs on the server and not have to deal with updating every single client.

I'd appreciate some help as to how to make this happen.

share|improve this question
up vote 3 down vote accepted

Do not route all traffic to the VPN (so their default gw still pointing to their normal connection), and then push routes to the clients like this:

push "route"
push "route x.x.x.x"

the first case being a /16 network and the second a /32 network (effectively the IP only). It's annoying to make it for a lot of IPs but it's exactly what you want.

share|improve this answer
that did the job, thanks. – sostacked Jul 20 '12 at 14:26

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.