theonemule / simple-openvpn-server

A setup script and simple web UI for setting up an OpenVPN Server
MIT License
232 stars 115 forks source link

How to route only VPN/LAN subnet traffic over OpenVPN? #9

Closed ehamwey closed 4 years ago

ehamwey commented 4 years ago

By default on other systems, split tunnel is enabled - meaning, all internet traffic goes through the client Internet connection, but if traffic is destined for the OpenVPN server's subnet/OpenVPN subnet itself, it is routed over the vpn.

I have tried adding pull-filter ignore redirect-gateway and removing setenv opt block-outside-dns (in client configuration) but by doing so I remove access to the VPN LAN.

What is the proper way to configure this flavor of OpenVPN server to properly split the traffic?

theonemule commented 4 years ago

Try using something like this in your .ovpn file...

route-nopull route 192.168.0.1 255.255.255.0

The route should be for whatever remote network your are trying to connect to.

ehamwey commented 4 years ago

Thanks. In addition to that to get it working I had to comment out setenv opt block-outside-dns and add pull-filter ignore redirect-gateway.