Since routeros does not support openvpn udp client i have created a vpn gateway on another device on the network.
If i change my gateway from the router (192.168.168.1) to the vpn gateway (192.168.168.11) it works fine.
The issue is i do not want to redirect all traffic through the openvpn gateway only general traffic.
For example i have 2 other VPNs connected on the mikrotik. (1 L2TP server and a PPTP client). If i change the gateway away from the mikrotik i can no longer access these items. Furthermore my custom DNS entries do not work if i change the gateway.
What i would like to do is redirect traffic through the mikrotik to the openVPN gateway.
I have tried creating a prerouting mangle rule and marking the route. Then creating a route that points to the gateway using that routing mark.
eg
chain=prerouting action=mark-routing new-routing-mark=VPN Route passthrough=no protocol=tcp
src-address=192.168.168.101 dst-address=!192.168.168.0/24 dst-port=80 log=no log-prefix=“”
I have tried to mark the connection and then mark the routing in the output chain however i never hit the output chain
0 ;;;
chain=prerouting action=mark-connection new-connection-mark=VPN Gateway passthrough=no
protocol=tcp src-address=192.168.168.101 dst-address=!192.168.168.0/24 dst-port=80 log=no
log-prefix=“”
1 ;;;
chain=output action=mark-routing new-routing-mark=VPN Route passthrough=no
connection-mark=VPN Gateway log=no log-prefix=“”
I have also tried with and without a masquerade to the the openvpn but just cant get it to work.
Any suggestions how i might be able to get this to work?