Routing using OSPF + vlan + L3HW offload

All the routers on the image are CRS317-1G-16S+

To use vlan’s to connect the routers, it’s necessary do add the interfaces to the bridge, right?

So, how to connect these 3 routers using OSPF and vlan’s (with point-to-point /30 IPv4 addresses), once I add the interfaces to the bridge, one interface is set to alternate port and does not forward the traffic?

You tag the VLAN to the physical ports between the routers, using a unique VLAN per router pair, and don’t allow those VLANs to go out of the other ports.

Create VLAN interfaces, two per switch, with the same tags as the router-to-router VLANs.

Assign the addresses from the /30 or /31, one to each router’s VLAN interface that belongs to the VLAN that goes between them.

Don’t forget VLAN filtering on the bridge, and if you have RSTP enabled, you’re going to probably need to set at least one of the ports in the bridge as an “Edge” port so that the switches don’t see a loop, such as R1-R3.

1 Like

Thank’s for your reply, but to keep the L3HW offload working, VLAN’s need to be set over the bridge. Can not be tagged directly on the physical ports. That’s the “problem“.

You tag it to ports under “Bridge → VLAN”

1 Like

You tag it to ports under “Bridge → VLAN”

To do this, the port needs to be added to the bridge. But if I add the ports the some bridge in all the 3 devices in the example, I am going to create a loop. That’s the problem.

Inter-VLAN Routing

Since L3HW depends on L2HW, and L2HW is the one that does VLAN processing, Inter-VLAN hardware routing requires a hardware bridge underneath. Even if a particular VLAN has only one tagged port member, the latter must be a bridge member. Do not assign a VLAN interface directly on a switch port! Otherwise, L3HW offloading fails and the traffic will get processed by the CPU:

/interface/vlan add interface=ether2 name=vlan20 vlan-id=20

Assign the VLAN interface to the bridge instead. This way, VLAN configuration gets offloaded to the hardware, and, with L3HW enabled, the traffic is subject to inter-VLAN hardware routing.

@normis how to solve this? Using MSTP would it be possible? But, how? Or there is another simpler solution?

You didn’t read everything I said.

If one of the links between switches is marked as “Edge” on both switches, and you are careful in your VLAN assignments, they will not loop up.

I have done this a dozen times over.

1 Like

This would be quite a bit more convenient if you could mark ports L3 only when adding them to the bridge.

(well, ideally MikroTik could make the old-style VLAN interfaces use the L3 hardware but I imagine that requires a lot more work to implement)

1 Like

Thank you so much for your answer, I just marked the ports between R2 and R3 as edge ports and it’s working fine.