VPN Only no other routes wanted

This forum is for general conversation and user-user networking.
Post Reply
OpenVpn Newbie
Posts: 1
Joined: Tue May 29, 2012 7:49 pm

VPN Only no other routes wanted

Post by ping182nz » Tue May 29, 2012 7:55 pm


I wanted to setup my PC or virtual machine so that my open vpn was the only route in and out. So if the vpn was down there is no connection.

I thought I could delete the default route i.e. mask gateway ip.of.router

Then add a static route to the open vpn server ip address i.e. ip.of.vpn.server mask gateway ip.of.router

It works, but not very well, as i can connect to the vpn but websites dont load.

I assume this is because openvpn creates new routes under a new ip range for the vpn connection...

How can i make it that the VPN in the only way in or out? (i want to use the same server ip everytime)

User avatar
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam

Re: VPN Only no other routes wanted

Post by janjust » Wed May 30, 2012 8:31 am


Code: Select all

push "redirect-gateway def1"
to the server config, restart the server and reconnect the client; all traffic should now go via the VPN server.

Post Reply