Community discussions

MikroTik App
 
domon
just joined
Topic Author
Posts: 20
Joined: Sat Dec 03, 2016 4:20 pm

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

Fri Jan 25, 2019 6:46 pm

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.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22353
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

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

Fri Jan 25, 2019 8:48 pm

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
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1782
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

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

Mon Jan 28, 2019 12:42 pm

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