Page 1 of 1

VLANs & DHCP - help needed

Posted: Sun Mar 01, 2015 11:43 pm
by BartoszP
I have followed VLAN example from http://wiki.mikrotik.com/wiki/Manual:Interface/VLAN
No problem but ...
I decided to add R5 router to serve as DHCP servers and gateway for both VLANs which are separated but use same 10.10.10.0/24 subnets.
Same subnets but they should be independend and do not mix adresses and hosts from different VLANs.
Image12004.gif
I have added two VLANs, assigned IPs in R5 VLAN3 = 10.10.10.6 and VLAN2= 10.10.10.7 ...no problem if they are static.
Next step was to define two pools
POOLVLAN2 = 10.10.10.100 - 10.10.10.120
POOLVLAN3 = 10.10.10.200 - 10.10.10.220
next define two DHCP servers with just defined pools...no problem...
and next I have started defining networks
for VLAN2: 10.10.10.0/24, GW 10.10.10.10.6, DNS 8.8.8.8...no problem...
and for VLAN3 same subnet butwith GW 10.10.10.7, DNS 4.4.4.4.....
and .... ta da ... no way to save it and to inform VLAN2 DHCP server to use one network and VLAN3 DHCP server to use second network.

Any ideas how to manage it ?

Posted: Mon Mar 02, 2015 3:38 am
by edgars
You shouldn't be able to define two networks on same machine with same subnet. Easy workaround here I would do is to halve subnet to two /25s. Or put switch in place of hub and check "private vlan/port isolation" as alternative setup maybe? I think that mikrotik example there is more theoretical than practical.

Re: VLANs & DHCP - help needed

Posted: Mon Mar 02, 2015 9:25 am
by BartoszP
It is not "easy solution" to divide 10.10.10.0/24 into two subnets.
As VLANS are independent L2 domains there is no reason not to assign them same address ranges.
I know that I could set DHCP server on R1, R2, R3 or R4 but WHAT IF I want to have centralized management ?
Simple solution...read it as feature request...is the ability to assign interface which DHCP serves.

Re: VLANs & DHCP - help needed

Posted: Mon Mar 02, 2015 7:24 pm
by rmmccann
It is not "easy solution" to divide 10.10.10.0/24 into two subnets.
As VLANS are independent L2 domains there is no reason not to assign them same address ranges.
I know that I could set DHCP server on R1, R2, R3 or R4 but WHAT IF I want to have centralized management ?
Simple solution...read it as feature request...is the ability to assign interface which DHCP serves.
I decided to play around with this and see your problem with being unable to define multiple "networks" under DHCP server using the same subnet. The only way for this to work would be if MT allowed you to specify the interface for the network.

I don't see another workaround other than either a different router/additional device or set up a metarouter for one of your DHCP configs.

Re: VLANs & DHCP - help needed

Posted: Sun Mar 08, 2015 10:44 am
by tania
VLAN and DHCP Configuration video https://www.youtube.com/watch?v=6S3itRYRwLs

Re: VLANs & DHCP - help needed

Posted: Sun Mar 08, 2015 4:01 pm
by Znuff
As VLANS are independent L2 domains there is no reason not to assign them same address ranges.
Yeah, there are.

It's a stupid thing to do. Just use different classes.

I don't understand why you would use 100-120 for vlan2 and 200-220 for vlan3 when they aren't even on the same subnet or vlan.

Re: VLANs & DHCP - help needed

Posted: Sun Mar 08, 2015 8:48 pm
by BartoszP
It's a stupid thing to do.
Why it is stupid ?
Just use different classes.
Why I should use different classes ? What if I have to use same classes/subnets...e.g. clients want to use exact same IP pool. VLANS are independent LANs so I could use same addresses.
I don't understand why you would use 100-120 for vlan2 and 200-220 for vlan3 when they aren't even on the same subnet or vlan.
Why they should "even" be in the same subnet or vlan ? That is why they are intentionally in different vlan domains.

I have just added one router to official Mikrotik's example to allot it as central DHCP/DNS/GW. Could I or it is forbidden idea ?

Re: VLANs & DHCP - help needed

Posted: Sun Mar 08, 2015 10:47 pm
by ZeroByte
As long as the two networks use the same default gateway / DNS server addresses, then you could probably get away with just one network statement. I would also expect that you could even make the pools overlap, since technically, they're just lists of resources, right?
pool1 = 10.10.10.2-254, pool2 = 10.10.10.2-254.
You could even put 10.10.10.1/24 on both vlan subinterfaces (something Mikrotik lets you do, but other OS such as Cisco will not, unless you use VRF.)

Don't forget though, that if you install 2 DHCP processes / 2 pools / etc on one Routerboard, it's still actually two independent DHCP services to maintain, right? Why not just launch a MetaRouter for each DHCP, and make a single bridge for management access to the VRs?