I'm currently trying to setup an openvpn server by following the howto tutorial.
For the moment, I'm able to connect to the openvpn server from the client.
But I've still not succeeded in forwarding client's traffic through the VPN.
Here is my server.conf file:
Code: Select all
#server
proto tcp
dev tun
port 443
#keys
ca ca.crt
cert ovh-vpn.crt
key ovh-vpn.key
dh dh1024.pem
tls-auth ta.key 0
#network
server 10.9.8.0 255.255.255.0
push "redirect-gateway def1"
;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"
keepalive 10 60
#security
comp-lzo
persist-key
persist-tun
chroot /etc/openvpn/jail
#log
status openvpn-status.log
;log-append openvpn.log
verb 3
mute 20
Code: Select all
#client
client
dev tun
proto tcp
remote server_ip
resolv-retry infinite
nobind
#proxy
http-proxy-retry
http-proxy proxy port
#keys
ca ca.crt
cert client.crt
key client.key
tls-auth ta.key 1
#security
comp-lzo
persist-key
persist-tun
ns-cert-type server
#output
verb 3
mute 20
Code: Select all
iptables -t nat -A POSTROUTING -s 10.9.8.0/24 -o venet0:0 -j MASQUERADE
Code: Select all
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.9.8.2 * 255.255.255.255 UH 0 0 0 tun0
178.32.35.0 * 255.255.255.0 U 0 0 0 venet0
10.9.8.0 10.9.8.2 255.255.255.0 UG 0 0 0 tun0
default * 0.0.0.0 U 0 0 0 venet0
Code: Select all
route del default
route add default gw 10.9.8.5
Code: Select all
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.9.8.5 0.0.0.0 UG 0 0 0 tun0
10.9.8.1 10.9.8.5 255.255.255.255 UGH 20 0 0 tun0
10.9.8.5 * 255.255.255.255 UH 0 0 0 tun0
128.0.0.0 10.9.8.5 128.0.0.0 UG 20 0 0 tun0
PS:
By the way, do someone know a command to check that I'm well able to connect to the internet through the VPN ?