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.

Okay, so I'm trying to setup a OpenVPN server and I've done it once before so I'm kind of a newbie. However I've gotten so far that I can on my client machine that I can connect but I can't browse internet/ping/do anything internet related just access my server.

Server Config: http://pastebin.com/Eju4Pifj

Client pc error log: http://pastebin.com/pPkxKGgZ (edited it out for my own safety)

Client config:

    client
float
dev tun
tun-mtu 1500
mssfix
proto tcp
remote My.local&.Wan.IP 1194
tls-remote server
ca ca.crt
cert BlaBlabLa.crt
key BlaBlabLa.key
auth SHA1
nobind
comp-lzo
persist-key
persist-tun
verb 0
route My.local&.Wan.IP 255.255.255.255 net_gateway
route 0.0.0.0 0.0.0.0
verb 5

My servers local & remote ip in the config/log files = My.local&.Wan.IP

And ***.***.***.*** = (I think) my routers ip

share|improve this question

2 Answers 2

You have to enable ip forwarding. To enable ip forwarding set net.ipv4.ip_forward as 1

echo 1 > /proc/sys/net/ipv4/ip_forward

To make this config permanent add this line to /etc/sysctl.conf

net.ipv4.ip_forward = 1

And lastly add MASQUERADE rule to iptables.

iptables -I POSTROUTING -t nat -s 10.0.0.0/24 -j MASQUERADE

Then your clients can connect internet using your vpn tunnel.

share|improve this answer
    
Nope, that didn't help –  Eric Aug 6 '12 at 16:44
    
For windows vista and windows 7, you have to add these two lines to your client config and you have to run openvpn client with admin permissions. route-method exe route-delay 2 –  dirigeant Aug 9 '12 at 20:31

Got it working using this http://www.putdispenserhere.com/openvpn-debianubuntu-setup-script-for-openvz/

share|improve this answer
2  
Consider at least summarizing the fix in your answer. If that link goes offline, this question won't be very helpful to someone else with the same problem. Also, you are encouraged to mark your own answer as selected! –  Aaron Copley Aug 6 '12 at 18:52

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.