Hi,
I would like to configure Mikrotik router (ROS v7.7) so services could be accessed from multiple VRFs. Currently you must only set exacly one VRF to each service in /ip/services menu, which is unfortunate for me. I did a little bit of searching and found post that are connected to this problem:
- http://forum.mikrotik.com/t/ip-services-management-vrf-excellent-news/154135/13
- http://forum.mikrotik.com/t/feature-request-vrf-bindings/156976/6
- http://forum.mikrotik.com/t/feature-request-ability-to-choose-multiple-vrfs-in-ip-services/158842/7
- http://forum.mikrotik.com/t/v7-inter-vrf-route-leak-doesnt-work-for-local-ips/154626/4
- http://forum.mikrotik.com/t/management-inside-a-routing-table/114006/4
Before we go any further, I would like to describe my problem… I have 2 VRFs on each of two routers, we will focus on one of the routers (virt-vinarium), because on both routers I have same problem. First VRF if main second VRF is vrf-s5net. I would like to enable access to services like Winbox, SSH, API to devices from both VRFs, problem is that we can only assign service to one of them. Each of routers have two OSPF instances one for each VRFs. Both routers exchange routing info via link (which has VLANs) between them.

First unsuccesfull attempt to solve the issue for ssh: (see files below for configuration)
- Preroute mangle rule: mark connection
- Preroute mangle rule: change routing mark (put into different VRF) for marked conenction
- Do dst-nat to change destination IP to one of IP on interface that is in destination VRF
Results for testing ssh from virt-kocjan to virt-vinarum on 44.150.248.33:
- router returns ICMP type 3 code 1: Host not reachable
- based on logs even with correctly translated destination IP by dst-nat, router decision is WRONG (packets end up in forwarding chain instead of input chain)
- Looks like router for VRF main doesn’t look at local interfaced before looking into routing table, so it tries to route packet out at correct interface
virt-vinarium2.rsc (6.49 KB)
virt-kocjan2.rsc (4.63 KB)
Based on post specified above I also tried to abandon VRF main for custom VRF vrf-main, so I:
- Created VRF vrf-main
- Moved all interfaces that are not in vrf-s5net there
- Moved services into vrf-main
Results:
- Router correctly puts packets into input chain
- Router correctly forms and forwards response packet
- Router responds with TCP RST if from packet incorrected VRF


File for changed config:
virt-vinarium3.rsc (6.77 KB)
Possible solutions for this problem are:
- for services ability to choose one ore all VRFs
- for services ability to choose multiple VRFs
Has anyone found a working solution for this problem ?