Page 1 of 1

Multiple VLANs, router all traffic from one VLAN to an alternate gateway

Posted: Fri Jan 25, 2019 6:46 pm
by domon
Hello,

I have a CRS-125 with RouterOS 6.41.4, with multiple VLANs configured, and 1 WAN connection. I would like all traffic from VLAN10 to route to a single host in VLAN20. The target host in VLAN20 has an outbound VPN connection which I'd like all of VLAN10 to use.

Using /ip route or /ip firewall nat I can't seem to find the right option to force traffic from VLAN10 to use (or even the subnet in that VLAN) to one specific host in VLAN20. The target host in VLAN20 has an outbound VPN connection which I want all of VLAN10 to use.

I've followed a few guides but nothing that explains this specific scenario. Any pointers would be helpful.

Re: Multiple VLANs, router all traffic from one VLAN to an alternate gateway

Posted: Fri Jan 25, 2019 8:48 pm
by anav
Good question, not sure if that is possible as its not clear how the VPN is setup.
Technically there should be no issue with Layer3 firewall filter rules to allow VLANXX traffic to a host on a different VLAN.

First thing I would do though is upgrade to the latest firmware and post your config after.
/export hide=sensitive file=mylatestconfig

Re: Multiple VLANs, router all traffic from one VLAN to an alternate gateway

Posted: Mon Jan 28, 2019 12:42 pm
by sebastia
Hey

You can do it with policy based routing (for ipv4 only)
1. add new route to target server on vlan20 with a route-mark
2. define a route rule for src from vlan10 to "lookup" the route in the "route-mark" table
or
route-mark all packets for vlan10
3. make sure forward allows this forwarding

Note: the above is isolate vlan10 to gateway on vlan20. If you want to connect to other internal networks, you'll need to define additional routing rules to use default table for specific ranges