Linux – Configuring OpenVPN server (linux) and client(windows)

linuxopenvpnwindows

I'm having a problem configuring OpenVPN server on Debian 5 32-bit and a client on Windows 7 64-bit.

I can connect from my windows client to the server successfully, but when I go to website that shows my IP address, I get my local IP address, and not my server's. What should I do to hide my local IP address?

Here is my server's config file:

port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
server 172.17.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo
user nobody
group users
persist-key
persist-tun
status openvpn-status.log
verb 3

and here's config of windows client (downloaded from here http://openvpn.net/index.php/open-source/downloads.html):

client
dev tun
proto udp
remote server.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert ferdo_key.crt
key ferdo_key.key
comp-lzo
verb 3

Best Answer

You need to do this:

http://openvpn.net/index.php/open-source/documentation/howto.html#redirect

The specific server directive is:

push "redirect-gateway def1"

Basically, the server needs to push routing configuration to the client. This routing configuration will change the default route of the client, so that non-local traffic will go through the VPN tunnel rather than the LAN.

Note that you need to have OpenVPN client run with administrative privileges for this to work. Otherwise, the client program will not be able to change the Windows machine's routing table.