Community discussions

MikroTik App
 
wifiryan
just joined
Topic Author
Posts: 24
Joined: Sat Sep 17, 2011 7:31 pm

2 VLANS with their own Default Gateway ???

Sat Feb 22, 2014 8:59 am

A set of UniFi AP's tags SSID #1 VLAN1 and SSID #2 VLAN2

All Unifi's connect to Ether4 of Mikrotik router

If a client is in VLAN1 I want them to be assigned 192.168.30.x and use ISP #1 connected to ether1

If a client is in VLAN2 I want them to be assigned 192.168.25.x and use ISP #2 connected to ether2

How do I do this?
 
CelticComms
Forum Guru
Forum Guru
Posts: 1765
Joined: Wed May 02, 2012 5:48 am

Re: 2 VLANS with their own Default Gateway ???

Sat Feb 22, 2014 2:34 pm

1. Create the relevant VLAN interfaces on Ether 4.
2, Create the relevant DHCP server, Network, IP Pool and IP Address entries for the two VLAN interfaces.
3. The easiest way to achieve the ISP selection is to create 2 VRF entries and place VLAN1 & Ether1 in one VRF and VLAN2 & Ether2 in the other.
 
efaden
Forum Guru
Forum Guru
Posts: 1708
Joined: Sat Mar 30, 2013 1:55 am
Location: New York, USA

Re: 2 VLANS with their own Default Gateway ???

Sat Feb 22, 2014 3:14 pm

1. Create the relevant VLAN interfaces on Ether 4.
2, Create the relevant DHCP server, Network, IP Pool and IP Address entries for the two VLAN interfaces.
3. The easiest way to achieve the ISP selection is to create 2 VRF entries and place VLAN1 & Ether1 in one VRF and VLAN2 & Ether2 in the other.

Also if you don't want them to see each other use firewall to isolate them.
 
wifiryan
just joined
Topic Author
Posts: 24
Joined: Sat Sep 17, 2011 7:31 pm

Re: 2 VLANS with their own Default Gateway ???

Sat Feb 22, 2014 11:52 pm

1. Create the relevant VLAN interfaces on Ether 4.
2, Create the relevant DHCP server, Network, IP Pool and IP Address entries for the two VLAN interfaces.
3. The easiest way to achieve the ISP selection is to create 2 VRF entries and place VLAN1 & Ether1 in one VRF and VLAN2 & Ether2 in the other.
Great, thanks so much! Works perfectly.
 
CelticComms
Forum Guru
Forum Guru
Posts: 1765
Joined: Wed May 02, 2012 5:48 am

Re: 2 VLANS with their own Default Gateway ???

Sun Feb 23, 2014 12:00 am

Good. If you look in the routing table you should see routing entries for the various interfaces each marked with the routing-mark corresponding to the VRFs that you created.
 
wifiryan
just joined
Topic Author
Posts: 24
Joined: Sat Sep 17, 2011 7:31 pm

Re: 2 VLANS with their own Default Gateway ???

Fri Mar 07, 2014 6:10 pm

Good. If you look in the routing table you should see routing entries for the various interfaces each marked with the routing-mark corresponding to the VRFs that you created.
So I noticed that this only works for me if both Gateway interfaces have DHCP obtained IP's.

If I assign 1 or both Gateways Static IP's from the ISP it no longer works, and it seems to disable one of the routes.

Any hints on getting it to work for Static IP's?
 
CelticComms
Forum Guru
Forum Guru
Posts: 1765
Joined: Wed May 02, 2012 5:48 am

Re: 2 VLANS with their own Default Gateway ???

Fri Mar 07, 2014 8:14 pm

If you add a static IP to an interface in a VRF then RouterOS should add the connected route into the correct routing table, but when you add the default route to the routing table you will have to manually select the routing-mark entry when entering the default route. Check your routing table with particular attention to the routing mark column.

Who is online

Users browsing this forum: No registered users and 31 guests