VPN Only no other routes wanted

This forum is for general conversation and user-user networking.
Post Reply
ping182nz
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

Hi,

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. 0.0.0.0 mask 0.0.0.0 gateway ip.of.router

Then add a static route to the open vpn server ip address i.e. ip.of.vpn.server mask 255.255.255.255 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)
Thanks

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

Re: VPN Only no other routes wanted

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

add

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