I have spent endless hours on OpenVPN config.
I was running my server on a Virtualized OpenVZ server, and after many many hours got it working.
I have however now moved my server over to a non Virtualized server but cant seem to get it to work.
My Goal is to tunnel ALL traffic through the VPN - internet browsing and name resolution so that I will be able to browse all blocked sites.
server.conf
Code: Select all
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1"
push "dhcp-option DNS 10.8.0.1"
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3
Code: Select all
$IPTABLES -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
$IPTABLES -A INPUT -p udp --dport 1194 -m limit --limit 1/s --limit-burst 10 -j ACCEPT
$IPTABLES -A OUTPUT -p udp --dport 1194 -j ACCEPT
$IPTABLES -A INPUT -i tun+ -j ACCEPT
$IPTABLES -A FORWARD -i tun+ -j ACCEPT
$IPTABLES -A OUTPUT -o tun+ -j ACCEPT
$IPTABLES -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
Code: Select all
options {
directory "/var/named";
pid-file "/var/run/named/named.pid";
allow-recursion {
localnets;
127.0.0.1;
10.8.0.0/24;
};
listen-on { 10.8.0.1;
127.0.0.1;
};
};
zone "." {
type hint;
file "/etc/db.cache";
};
zone "**My Domain**" {
type master;
file "data/**My Domain**.hosts";
allow-transfer {
127.0.0.1;
localnets;
**MY-IP**;
};
also-notify {
**MY-IP**;
};
};
zone "6**MY-IP**.in-addr.arpa" {
type master;
file "data/**MY-IP**.rev";
};
What am I doing wrong?
I am able to connect and browse through the connection - my name resolution of sites is not done by my DNS however.
Thanks in advance