I have a typical semi advanced home network scenario:

A cable modem - eth
A wireless router (netgear n600) eth and wlan
A home server (Running ubuntu 12.04 LTS, connected over wlan)
A bunch of wireless clients (wlan)

Lying around I have anoher cheaper wlan router, and two different USB wlan NIC's that are known to work with Linux.

ACTA struck. I want to route ALL of my WAN traffic through a remote server through a VPN.

For sake of completition, lets say there is a remote server running debian sqeeze where a VPN server is to be installed. The network is then to behave so that if the VPN is not operative, it is separated from the outside world. I am familiar with general system/network practices, but lack the specific detailed knowledge to accomplish this.

Please suggest the right approach, packages and configurations you'd use to reach said solution. I've also envisioned the following network configuration, please improve it if you see fit:


gw: reached via WLAN

Wlan router 1:
gw: reached via ETH

Homeserver:  <<< VPN is initiated here, and the other endpoint is somewhere on the internet.
gw: reached via WLAN

gw: reached via WLAN


Wlan router 2:
gw: set via dhcp
uplink connector: cable modem

Cable Modem:
Remote DHCP.
Has on-board DHCP server for ethernet device that connects to it,
and only works this way.

All this WLAN fussery is because my home server is located in a part of the house where a cable link isnt possible unfortunately.

2 Answers 2


Remove the gateway entry from wlan0. You only want the local address network on that interface and the VPN server to have routes. When you bring up your VPN interface, set the default gateway on that.

  • Could you give an example of what you mean with the last sentence?
    – duck degen
    Apr 2, 2012 at 23:09
  • When you bring your VPN link online, it should provide you with a new interface to manage. route add default gw vpn.internal.server.ip dev vpn0 Apr 2, 2012 at 23:15

What version of the N600 do you have? based on the OpenWRT Wiki a couple of versions of this route appear to be supported. the v3 is a Broadcom based setup so the kids at DD-WRT (and by extension Tomato/USB) might even have support for it, a bit of googling shows hits, but it will be completely dependent on what version you have exactly.

You might find it less of a hassle to pick up a router that supports DD-WRT (or its derivatives) native and flash a firmware that has VPN Client Support. I'd recommend the ASUS RT-N16 personally and this should accomplish what you set out to do.

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.