I have been trying to set up a VPN for about a week now, and I am making steady progress. My end goal is to have a VPN that I can connect to and route all my traffic through so I can have a secure connection when I connect to shady access points with my laptop or phone. I am using Tunnelblick for Mac to connect to the VPN on my laptop. I managed to get the server running, but when I connect to it from Tunnelblick my internet completely stops working. Tunnelblick shows a steady connection but there is no data flow at all, webpages get stuck on "Resolving Host". On my server, I have made sure that on my server I executed the command
sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
to correctly route my traffic, as stated in <a href="
http://stackoverflow.com/questions/5073249/openvpn-unable-to-browse-internet-after-connect-to-openvpn">this forum post on Stack Overflow.</a>
When I enable
push "redirect-gateway local def1"
I cannot ping the 10.8.0.1 (the server) or 8.8.8.8. But when I remove the
push "redirect-gateway local def1"
option on the server config the server works fine, and I can ping 10.8.0.1 and 8.8.8.8. Changing it to
push "redirect-gateway def1"
does not solve the problem.
I have done a bit of research and I have a feeling there is a problem with accessing my DNS servers or iptables is configured incorrectly, but the few forum posts that pertain to this problem are sparse on answers or are full of jargon I don't understand. Does anyone know why I get no connection, or at least give me something else I can go on so I can do some fixes myself? My conf files are below. My server is a Raspberry Pi Model B running Raspbian.
Anything in brackets has been changed for security reasons.
**Client Config**
client
dev tun
proto udp
remote [MYHOSTNAME] 1194
remote-random
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
ca ca.crt
cert [myname].crt
key [myname].key
cipher BF-CBC
verb 6
mute 20
**Server Config**
port 1194
proto udp
dev tun
ca [path/to/file]
cert [path/to/file]
key [path/to/file]
dh [path/to/file]
cipher BF-CBC
server 10.8.0.0 255.255.255.0
push "route 192.168.10.0 255.255.255.0"
push "route 192.168.11.0 255.255.255.0"
ifconfig-pool-persist /etc/openvpn/ipp.txt
keepalive 10 120
status openvpn-status.log
verb 6
push "redirect-gateway local def1"
I probably got a little paranoid with the brackets. I should probably also state that I have posted this same question, verbatim, to Stack Overflow but have gotten no answers. I figured this is probably a much better place to get help. My experience with networking is rather sparse, and one of the reasons why I started this project was to teach myself more about networking.