Currently, I have an Ubuntu server and desktop attached to my home network.

However, I'm trying to get my server to have two network interfaces. One "internal", and one "external" that routes traffic through a VPN service. I'd like to be able to connect to the server locally on the internal network, but would want to have VPN traffic to/from the server coming in externally.

I've never set up a VPN connection before, so I'm unsure if the configuration calls for making a distinction between local/external traffic. I installed OpenVPN and started poking around with the configuration but haven't gotten very far.

Is there a certain way I should set up my client config in order to retain local non-vpn access to the server from my desktop?


The ideal set-up for your design would be:

The server connected to its own router with its own IP addressing scheme (E.g. 192.168.2.x/24), the clients connected to their own router using a different IP addressing scheme (E.g. 192.168.3.x/24) and then both routers connected to a tertiary router which connects to the Internet (E.g. 192.168.1.x/24).

Depending on the capabilities of your current router, you might get away with only two routers or maybe even one router and a switch depending on what hardware you have/wish to purchase and what are you trying to accomplish...

If you just drop the second network card from your server, most consumer-grade routers allow you to put the server in a DMZ (Demilitarized Zone) without any of the above hassle... (just for completeness and if anyone else is trying to do the same thing, but without your budget)

| improve this answer | |
  • Could you elaborate on how the DMZ allows me to replicate the 2 NICS/2 Router scenario? My budget is limited right now so it sounds like it might be the best option. – n0pe Jan 3 '15 at 14:53
  • That depends entirely on your router, however most commercial routers allow you to define 1 IP address (sometimes an entire range) in a DMZ: that IP address is then fully exposed to the Internet with all its internal ports (in the simple routers) or some ports (in more advanced routers). Without you posting your exact router brand/model/firmware version, that's all I can tell you... – Fabby Jan 3 '15 at 15:02
  • 1
    I've got an Asus RT-N16 running the latest build of OpenWRT. A quick search turned up this tutorial which seems like it might work: wiki.openwrt.org/doc/howto/dmz. My only concern is finding a way to set up a VPN on only the DMZ and not the rest of the network. I have a feeling I won't be able to do this only in software and will need another NIC on my server. – n0pe Jan 3 '15 at 19:53
  • You have the NIC already, so you could set up one NIC in a DMZ and the other NIC just in the network... I would start without: if it works without, look up 'linux bonding' and have a go at that then! ;-) – Fabby Jan 3 '15 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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