Hi,
I have successfully setup openvpn on my vserver.
I can connect to it with my clients, but I get no internet connection.
The vserver has one external ip.
My server.conf:
dev tun
proto udp
port 1194
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
mode server
tls-server
dh /etc/openvpn/easy-rsa2/dh1024.pem
ca /etc/openvpn/easy-rsa2/keys/ca.crt
cert /etc/openvpn/easy-rsa2/keys/server.crt
key /etc/openvpn/easy-rsa2/keys/server.key
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8 4.2.2.1"
keepalive 10 120
persist-key
persist-tun
comp-lzo
status openvpn-status.log
verb 3
client config:
client
dev tun
proto udp
remote 84.x.x.x 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /etc/openvpn/ca.crt
cert /etc/openvpn/client2.crt
key /etc/openvpn/client2.key
ns-cert-type server
cipher BF-CBC
comp-lzo
verb 3
I use this iptables rule:
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to 84.x.x.x
This is the route output on the server:
xjojo@vserver:~$ route -n
Kernel-IP-Routentabelle
Ziel Router Genmask Flags Metric Ref Use Iface
10.8.0.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 venet0
and on the client:
Ziel Router Genmask Flags Metric Ref Use Iface
0.0.0.0 10.8.0.1 128.0.0.0 UG 0 0 0 tun0
0.0.0.0 130.83.x.x 0.0.0.0 UG 0 0 0 wlan0
10.8.0.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
84.x.x.x 130.83.x.x 255.255.255.255 UGH 0 0 0 wlan0
128.0.0.0 10.8.0.1 128.0.0.0 UG 0 0 0 tun0
130.83.112.0 0.0.0.0 255.255.248.0 U 2 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlan0
Any idea, why I cannot access the internet from the clients through the vpn?
Thanks in advance!