When having an OpenVPN instance working fine I'm having troubles with networks conflict in some specific circumstances. The setup is as this:
tun-mode clients' network in OpenVPN: 172.16.159/24 network behind the OpenVPN server: 10.0.1/24 (route-pushed to clients)
Now, having a client's local network with default gateway laying in the 10.0.1/24 client gets out of Internet as soon as routes are pushed to client's connection and applied on it because of, say 10.0.1.3 as default gateway, is routed to more-specific 10.0.1/24 pushed from server which in turn is routed through tun0 p-t-p device which in turn relies on OpenVPN connection that needs a functional default gateway to be kept alive. Is there a way in OpenVPN to preserve default gateway to the network device it is found on before pushed routes are applied so more-specific /32 route gives a correct routing to default gateway instead of tunneled route? I try to avoid having bash and cmd scripts for resolving this and just stay with a config full of dexterity.
Changing networks on either side is not appliable. Say, a person needs to do some work on internal resources while in business travel. No one can predict and guarantee that person's local network (for example hotel's network) does interfere with no tunneled networks.
10.0.1.17/16 -> 10.0.1.1 -> 188.8.131.52 -> 10.0.1.0/24 client client's openvpn tunneled private notebook router server network
I want a simple config trick (if any exists) that pushes something like
route add 10.0.1.1 mask 255.255.255.255 10.0.1.17
if we speak of Windows syntax before server pushed routes are applied. 10.0.1.1 unreachable on the tunneled network is clear and understandable.