Manual:Internet access from VRF

From MikroTik Wiki
Jump to: navigation, search


Packages required: routing-test, mpls-test, RouterOS version 3.23+

There are multiple ways how Internet access could be provided to VRF clients. They are outlined in RFC 4364 section 11, for example.

Here we show the way how to configure access using global routing table.



Default routes

Add default routes to VRF routing tables on PE:

 /ip route add routing-mark=cust-one gateway=
 /ip route add routing-mark=cust-two gateway=

Note that we must explicitly specify that the gateway should be resolved in the @main routing table, otherwise the routes will not become active.

Routes to client's networks

Routes to client's networks should be added in the main routing table, while their nexthops should be reachable via client's VRF interfaces, and as such belong to the VRF tables.

On the other hand, there is no way how to explicitly specify that gateway must be resolved in any other table, except the main table. So instead we specify the interface (which is in a VRF) and nexthop gateway address (which must be directly reachable on that interface). For point-to-point interfaces even the gateway address is not required.

Add these routes to PE's route table and redistribute them via OSPF:

 /ip route add dst-address= gateway=
 /ip route add dst-address= gateway=

And this is how should look in print:

 [admin@PE2] > /ip route print detail where !routing-mark
  5 A S  dst-address= gateway= on cust-one reachable ether2 
     distance=1 scope=30 target-scope=10
  6 A S  dst-address= gateway= on cust-two reachable ether3 
      distance=1 scope=30 target-scope=10