I was setting up OpenVPN on my VPS today. I was following this tutorial and everything went smoothly until I’ve installed client on my Windows 7 desktop. I got connected, but my Internet traffic wasn’t forwarded through VPN and this was my main goal. So I’ve checked server config and applied few ideas found via Google, no luck. Modified iptables, still no forwarding. Then I’ve checked logs in my client, now I know that I should’ve started there. It turned out that because I was running client in standard user mode it wasn’t able to create proper routes in system as only admin can do it. The solution to this is to either run OpenVPN client as administrator, I don’t like it, or to add routes manually. I’ve chosen second option copying all route related lines from the log and adding them to bat file, then I’ve just run bat as administrator. Works like a charm!
My bat looks like that:
route.exe ADD external_IP_of_VPS MASK 255.255.255.255 192.168.1.1
route.exe ADD 0.0.0.0 MASK 220.127.116.11 10.8.0.5
route.exe ADD 18.104.22.168 MASK 22.214.171.124 10.8.0.5
route.exe ADD 10.8.0.1 MASK 255.255.255.255 10.8.0.5
route.exe ADD 10.8.0.0 MASK 255.255.255.0 10.8.0.5