Page 1 of 1

VPN Only no other routes wanted

Posted: Tue May 29, 2012 7:55 pm
by ping182nz
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

Re: VPN Only no other routes wanted

Posted: Wed May 30, 2012 8:31 am
by janjust
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.