[Solved] Routing 192.168.0.x traffic through VPN

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Locked
LucL
OpenVpn Newbie
Posts: 2
Joined: Fri Jun 10, 2016 5:45 pm

[Solved] Routing 192.168.0.x traffic through VPN

Post by LucL » Fri Jun 10, 2016 5:49 pm

Hello,

I have the latest ovpn server (standard, not access server) running.

I can connect to it just fine, and route all traffic through it just fine. Everything works perfectly, with one exception. When I'm connected to the VPN from the office wifi which uses the 192.168.0.x subnet, and I try to access a machine on the VPN network that also uses the 192.168.0.x subnet, the VPN client ALWAYS tries to connect to the local network, instead of the network on the VPN side.

I've confirmed that if I switch to a non-wifi network (ex: 4G) I get a different IP/gateway on the phone and since it's not on the 192.168.0.x network I can connect fine to it on the VPN network, so it does work, but only when the networks are not the same.

So my question is... On the client side (config file) is it possible to add some configuration that will force all traffic, including the 192.168.0.x traffic through the VPN, instead of routing the 192.168.0.x traffic through the local router? I already added redirect-gateway local def1 but it doesn't seem to fix the problem.

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

Re: Routing 192.168.0.x traffic through VPN

Post by TinCanTech » Fri Jun 10, 2016 8:36 pm

You have a network conflict ..

You may be able to get around it by using:

Code: Select all

push "redirect-gateway def1 block-local"

LucL
OpenVpn Newbie
Posts: 2
Joined: Fri Jun 10, 2016 5:45 pm

Re: Routing 192.168.0.x traffic through VPN

Post by LucL » Fri Jun 10, 2016 8:43 pm

Did the trick! Would have never guessed! Thank YOU!!!

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

Re: Routing 192.168.0.x traffic through VPN

Post by TinCanTech » Fri Jun 10, 2016 8:50 pm

It is all in The Manual v23x ..

Locked