default route via OpenVPN

Hi list,

i have an OpenVPN connection and would like ll traffic to go via it.
I have selected the “Add Default Route” option in the client configuration, and I can see that the default route is added to the routing table, however it is inactive.
So the question is how do I automatically activate it when the VPN is activated? The 192.168.78.1 GW is the one obtained on the LAN via DHCP, the 192.168.69.254 GW is the internal OpenVPN server IP.

Thats how the routing table looks during the active VPN session.

[admin@MikroTik] /ip route> print
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit 
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 ADS  0.0.0.0/0                          192.168.78.1             1
 1  DS  0.0.0.0/0                          192.168.69.254           1

The problem you are having is more than one default route. With a few exceptions that prob don’t apply here, you can’t have more than one active. The solution depends on whether you use the router for more than just this VPN or of it’s dedicated to only the VPN.

If yes, then you may want to create a VRF (routing-mark) to put the VPN into and then the default will be active in that routing table

If you’re only using this router for the VPN, you can create a static route to the VPN endpoint and then disable the default route that isn’t for OpenVPN

Thanks for the answer. I can not disable the default route as it is obtained vi DHCP, so it is dynamic, thus I can only delete it.
This combination works, but in case I want to redirect the traffic back vi ether1 and not via OpenVPN I have to as such restart the network, so all the routes areback to their virgin state.

Do you hav some config examples where this was done with VRF?

There is a good thread on it here.

http://forum.mikrotik.com/t/openvpn-vrf/121096/1

Thanks!