Hi, I set up a simple point to point (not client/server) OpenVPN tunnel to visit web site that banned in China (Google, Youtube, Facebook, etc). My local machine is Ubuntu 12.04. Remote server is Amazon EC2, Ubuntu 14.04.
The problem is Youtube and Facebook has been DNS spoofing, and I always get wrong IP address from China DNS. Google has not been DNS spoofing, and I can visit it by VPN. An obvious solution is DNS resolution from remote DNS (in my case from Amazon). I set "redirect-gateway def1" in client config file, but IP address seems still been resolved by China DNS. Any suggestion? Thanks!
client.ovpn file
ifconfig 10.66.0.2 10.66.0.1
dev tun
secret secret.key 1
remote xx.xxx.xxx.xxx
port 2194
redirect-gateway def1
comp-lzo
keepalive 10 60
ping-timer-rem
persist-tun
persist-key
server.ovpn file
ifconfig 10.66.0.1 10.66.0.2
dev tun
secret secret.key 0
port 2194
push "redirect-gateway def1"
comp-lzo
keepalive 10 60
ping-timer-rem
persist-tun
persist-key
run_server.sh file
#!/bin/bash
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -s 10.66.0.0/24 -o eth0 -j MASQUERADE
sudo openvpn --config server.ovpn