OpenVPN & Windows Vista/7


Written by

I have started using OpenVPN on Windows 7 and its pretty good apart from the default client setup leaves the connection under the “Public” settings and so network shares and discovery etc do not work.

After reading a few guides, there were two ways mentioned; set all public networks as private and allow the services through which wouldn’t be a good idea as I regularly use public WiFi and secondly, a MS PowerShell script that sets the NDIS Device Type endpoint to a non-true network connection (i.e. for smart phones) and that sets it to private but you cannot is it in “Networking and Sharing Center”.

I found a solution; set a default gateway for the connection.

route 0.0.0.0 0.0.0.0 192.168.2.1 9999

change 192.168.2.1 to your VPN server’s connection IP and stick it into your client.ovpn file.

The 9999 is a forced metric which puts it as a secondary default route (i.e. internet router) and seeings as the VPN will go down once the internet as gone, this will not effect your surfing habits.