Community discussions

MikroTik App
 
libove
newbie
Topic Author
Posts: 42
Joined: Tue Aug 14, 2012 5:18 pm

DHCP and VRRP

Mon Nov 12, 2012 5:37 pm

This was discussed 8 years ago. Wow :-)
http://forum.mikrotik.com/viewtopic.php?f=2&t=394

The content of that older thread I think remains fully valid.
My question just goes a little further than the earlier discussion did:
If I set up the same DHCP scope on two co-operating RB1200s in a VRRP configuration, then I imagine that some clients will get answered by one RB1200 and other clients will get answered by the other. Each RB1200 will think, for any IP address in the same DHCP IP pool that it DIDN'T server, that the address is simply "in use". We won't run out of addresses, because only one RB1200 will actually server each client at any one time.

Here's the more detailed question, then:
When a failure occurs, and ~half of the clients have an IP address from the failed RB1200, and then their DHCP lease renewal time arrives, they will be unable to reach the RB1200 that served them. They will then send a more general DHCP request, which only the other RB1200 (which thinks that their current IP address is in use NOT served by its own DHCP server) ... do we then start running out of IP addresses, because the remaining RB1200 knows that the IP address which the client prefers "is in use"? .. Or is DHCP and the MikroTik RouterOS 5.x implementation of DHCP smart enough to recognise the fact that the requesting client IS the node which already has that IP address in use, so the RB1200 will change that IP address' status in the RouterOS DHCP tables from "in use" to "assigned BY ME to this client"?

Thanks!
-Jay
 
tws101
Member Candidate
Member Candidate
Posts: 284
Joined: Thu Sep 08, 2011 11:25 pm

Re: DHCP and VRRP

Tue Nov 13, 2012 12:09 am

The router will issue the client an IP from its pool regardless of the client previous address. If it is possible that you could run out of addresses then make you pool bigger or have a spill over secondary pool. If the original come back online and some of its pool are in use issue by the second router aux pool it will detect the client and not issue that address. (UNLESS the client is offline then you will have a dup when the client come back online)

To avoid that problem scenario lower lease times or enlarge pools.
 
libove
newbie
Topic Author
Posts: 42
Joined: Tue Aug 14, 2012 5:18 pm

Re: DHCP and VRRP

Tue Nov 13, 2012 3:16 pm

Thank you tws101.

Some follow-up questions-

When a MikroTik DHCP server detects that an IP address is in use, how long will it remember that detection and not try to re-check the IP address? That is, how long will that MikroTik DHCP server keep that address out of possible use?

When a DHCP client "A" gets an IP address from the DHCP server on MikroTik#1, then MikroTik #1 fails and that client "A" is off at the time; MikroTik #2 assigns that same IP address to a new client "B", followed by client "A" coming back to the network and causing an IP address conflict, what is the defined behaviour in the standards? Just guessing, the most conservative behaviour, which I would hope is defined, is that both nodes detecting the conflict will re-request their IP leases. In this case, client "B" should get confirmation that it holds the lease; client "A" should get no reply (because its MikroTik #1 is still down) and then would make a new DHCP request.
Where it would get quite interesting is if MikroTik #1 has come back (and still remembers its old DHCP lease table), then client "A" returns to the network and causes the conflict, unless the two MikroTik routers' separate DHCP servers can recognise that some kind of conflict is going on and have some kind of priority order (the most recently awarded lease wins?), then I don't know how the conflict would be resolved.
Any ideas? Or is this just so rare, and manually resolvable, that it's not really worth thinking about?

And finally, is there a "best practice" for the size of the DHCP pool and aux pool (or even whether it is better to use a larger single pool or to have an aux pool), as well as the lease time, in the case of two MikroTik routers, each with a DHCP server, in a VRRP failover configuration?

Thanks!
-Jay
 
tws101
Member Candidate
Member Candidate
Posts: 284
Joined: Thu Sep 08, 2011 11:25 pm

Re: DHCP and VRRP

Wed Nov 14, 2012 7:17 pm

It will remember the detection for the remainder of the lease.

If Mikrotik A goes down and Mikrotik B needs to hand out an IP to a client it broadcasts to detect if the IP is in use. The response carries with it the lease time and it add that lease with the lease time to the table. So if the client already using the IP is online at the time of the request you will be fine for the duration of that lease.

Now as for the second scenario it is rare and as such is manually resolvable. I would just increase the size of your subnet and hand out more address.
Network 10.0.0.0/22 IP pool Mikrotik A 10.0.1.0/24 (Please note the /24 refers to pool size not to network range as range would be a /22) Mikrotik B 10.0.2.0/24 Mikrotik C 10.0.3.0/24 Reserved for static leases 10.0.0.0/24 (These static leases would need to be put in all 3 of the routers) Using this method you can immediately tell what router assigned the IP.
 
libove
newbie
Topic Author
Posts: 42
Joined: Tue Aug 14, 2012 5:18 pm

Re: DHCP and VRRP

Thu Nov 15, 2012 2:56 pm

Thanks very much!

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot], peecis99, xvo and 99 guests