OpenVPN client in Windows - routing not working

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
SKamil
OpenVpn Newbie
Posts: 2
Joined: Thu Mar 26, 2020 4:08 pm

OpenVPN client in Windows - routing not working

Post by SKamil » Thu Mar 26, 2020 4:29 pm

Hi all.
I'm new to OpenVPN. Maybe you can help me.

I Installed and configured OpenVPN Server on Windows 2016.
Here is my server.ovpn:
Server config

port 443
proto tcp
dev tun
dev-node "VPN Server"
dh "C:\\Program Files\\OpenVPN\\ssl\\dh2048.pem"
ca "C:\\Program Files\\OpenVPN\\ssl\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\ssl\\OVPN-Server.crt"
key "C:\\Program Files\\OpenVPN\\ssl\\OVPN-Server.key"
server 172.16.13.0 255.255.255.0
max-clients 32
keepalive 10 120
client-to-client
comp-lzo
persist-key
persist-tun
cipher DES-CBC
status "C:\\Program Files\\OpenVPN\\log\\status.log"
log "C:\\Program Files\\OpenVPN\\log\\openvpn.log"
verb 4
mute 20


I issued all needed certs, OpenVPN service started and working.

I created needed files for Client (on Windows too).
Here is config.ovpn on client:
Client config

client
resolv-retry infinite
nobind
remote openvpn-external-ip 443
proto tcp
dev tun
comp-lzo
ca "C:\\Program Files\\OpenVPN\\config\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\config\\Client2.crt"
key "C:\\Program Files\\OpenVPN\\config\\Client2.key"
float
cipher DES-CBC
keepalive 10 120
persist-key
persist-tun
verb 3


Client also succesfully established connection to OpenVPN Server.
I can succesfully ping 172.16.13.1 - OpenVPN Server virtual address

Then I added route through cmd:
route add 10.10.19.0 mask 255.255.255.0 172.16.13.1

10.10.19.0 - network behind server
I see this route when do route print.
But when I trying to tracert 10.10.19.1 from client I see that he is trying to go through default gateway, not using added route.

What is the reason of such behavior? How can I make its working correct?

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: OpenVPN client in Windows - routing not working

Post by TinCanTech » Thu Mar 26, 2020 4:33 pm

SKamil wrote:
Thu Mar 26, 2020 4:29 pm
How can I make its working correct?
By reading the Howto.

SKamil
OpenVpn Newbie
Posts: 2
Joined: Thu Mar 26, 2020 4:08 pm

Re: OpenVPN client in Windows - routing not working

Post by SKamil » Fri Mar 27, 2020 6:04 am

TinCanTech wrote:
Thu Mar 26, 2020 4:33 pm
SKamil wrote:
Thu Mar 26, 2020 4:29 pm
How can I make its working correct?
By reading the Howto.
Oh, thanks for the answer. I like it. That's what I really needed.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: OpenVPN client in Windows - routing not working

Post by TinCanTech » Fri Mar 27, 2020 12:10 pm

If you don't want to read the Howto then use a script to do the work for you..

EG: https://github.com/Nyr/openvpn-install

Post Reply