Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have installed an OpenVPN server + client, the server is windows xp and the client is slackware 12 linux. I set up the first tunnel, test it, ping the machines from each side and saw it's working.

Now I am trying to route the internet traffic (+Web browsing) through the VPN tunnel, so I did just like in the OpenVPN howto, but it doesn't seem to work.

I tried push redirect-gateway/redirect-gateway def1 etc. etc. but it doesn't route the traffic through the server.

Here is the server's config:

remote xxx
dev tun
tun-mtu 1500
ifconfig 10.3.0.1 10.3.0.2
secret key.txt
ping 10
comp-lzo
verb 4
mute 10
push "redirect-gateway def1"

In the howto there is: " The server will need to be configured to deal with this traffic somehow, such as by NATing it to the internet, or routing it through the server site's HTTP proxy." - Is this the problem ? Or it is sommething with the routings (i don't know nothing about adding routes and their usage). Please help me somehow.

Thank you.

share|improve this question

3 Answers 3

I am afraid you will need to do some reading on IP routing. A good starting point could be here. Now to your specific problem: you need to replace the "def1" with the address of your IP tunnel, so that all traffic is by default routed into the tunnel.

However, please note that this will route really ALL traffic through the tunnel. If you want to only route traffic for specific target networks through the tunnel you will need lines similar to this:

push "route 192.168.10.0 255.255.255.0"

In this example, 192.168.10.0 stands for the network address of the subnet, and 255.255.255.0 stands for the subnet mask. If you don't know what these terms mean, then you should start reading.

share|improve this answer
    
Thank you for your asnwer! However, what do you mean with address of the IP tunnel ? The server's ip or 10.3.0.1 (ifconfig) ? –  piro Aug 26 '09 at 16:34
    
In your example, it would have to be 10.3.0.2, as this is the remote tunnel endpoint, through which all traffic needs to go. –  wolfgangsz Aug 26 '09 at 16:53

Turn on ipenablerouter in the registry to enable Windows XP to route between interfaces

http://support.microsoft.com/kb/315236

share|improve this answer
    
And what will do NAT? –  Gleb Sep 25 '09 at 18:06

Yes, you need to set up NAT or proxy. Internet Connection Sharing could be used but note that it will require configuring a specific address (192.168.0.1) on your TAP virtual adapter.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.