I have successfully installed and configured OpenVPN on Debian using the listed configuration below. I am running the client on a Windows Vista x64 machine. If I do not use redirect-gateway, I can ping the server at 10.8.0.1, however internet traffic is not routed through the VPN. However when I use redirect-gateway, I no longer can ping the server (nor any web address), and all internet access ceases to operate. I had, by chance managed to get it to work once, but since I was manually playing with the "route add..." command, the settings were lost when I rebooted and since then, I have not been able to replicate the solution.
The purpose of this setup is so I can connect to the VPN and use the internet via the VPN.
If it is of any help, I have tried to monitor the tunnel device (tun0 in linux, and TAP-Win32 Adapter V9 on windows) using tcpdump on linux and windump on windows. When I try to ping the server, I do see the packets on the windows side, but they do not appear on the my server side (with redirect-gateway). Without redirect-gateway, pinging the server results in the packet showing up on both the client side and windows side.
Any help is greately appreciated. TIA.
Code: Select all
## Server configuration
tls-server
mode server
port 1194
proto udp
dev tun
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key # This file should be kept secret
dh /etc/openvpn/keys/dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
client-to-client
keepalive 10 120
tls-auth /etc/openvpn/keys/ta.key 0 # This file is secret
cipher DES-EDE3-CBC # Triple-DES
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn-status.log
verb 3
crl-verify /etc/openvpn/keys/crl.pem
client-config-dir /etc/openvpn/clients-configs
Code: Select all
## Client configuration
pull
client
dev tun
dev-node OpenVPN
proto udp
remote myserver.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ./pandora.vpn-keys/ca.crt
cert ./pandora.vpn-keys/wckong.crt
key ./pandora.vpn-keys/wckong.key
ns-cert-type server
tls-auth ./pandora.vpn-keys/ta.key 1
comp-lzo
cipher DES-EDE3-CBC # Triple-DES
verb 3
# redirect-gateway def1
Code: Select all
## IPTables startup script
iptables -F
iptables -A INPUT -i tun+ -j ACCEPT
iptables -A FORWARD -i tun+ -j ACCEPT
iptables -A INPUT -i tap+ -j ACCEPT
iptables -A FORWARD -i tap+ -j ACCEPT
iptables -t nat -F
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o venet0 -j SNAT --to-source 94.23.154.95