I'm having some challenges with my OpenVPN server. I have it configured correctly to route all traffic through the VPN with a custom dnsmasq server (running on the same server as the VPN.)
I accomplished this by the following configs:
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 10.8.0.1"
When the client connects to the server, their /etc/resolve.conf does change to:
nameserver 10.8.0.1
The problem is, I don't want to route all traffic through the VPN, only certain ranges (10.8.0.0 255.255.255.0 and XXX.XXX.0.0 255.255.0.0)
I've added the following push rules to my server.conf but it still routes all traffic through the vpn.
push "route XX.XXX.0.0 255.255.0.0"
push "route 10.8.0.0 255.255.255.0"
if I comment out push "redirect-gateway def1 bypass-dhcp" then the routes works but my local DNS (from dnsmasq) won't resolve.
What am I missing?