Community discussions

MikroTik App
 
fotis3d
just joined
Topic Author
Posts: 1
Joined: Wed Sep 14, 2022 11:46 am

DHCP Server constantly assigns-deassigns

Wed Sep 14, 2022 11:52 am

Hi all. Suddenly my HAP ac3 DHCP server seems to constantly assign-deassign wifi devices.

Any suggestions ? Didn't have that kind of problem before but the last days is constant.

I use a HAP ac3 (Main Router v6.49.6) and a HAP ac2 (as AP in bridge mode with LAN connection to the first, v6.49.6).

Wifi Devices about 60-65.

Any help would be really appreciated.

Thanks

Image
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2984
Joined: Mon Apr 08, 2019 1:16 am

Re: DHCP Server constantly assigns-deassigns

Sat Dec 02, 2023 1:04 am

Hi,

have the same with at least one wifi connected device. Devices are BYOD, so I have no client device information or access to its settings.

The setup is with 2 hAP ax3 with ROS 7.12 , with each having a DHCP server per VLAN serving the same subnets, but with non-overlapping address pools. (split scope)
Clients should stick with one DHCP server for renewal, once served by one of the DHCP servers. The other DHCP server should not NACK the address if not in his pool.
Fact is that that client constantly flips between the 2 DHCP servers.
Klembord-2.jpg
Setting one of the 2 ax3 DHCP server sides with [Authoritative "after 10 seconds delay"] and removing its list with Leases , this completely stopped the flipping.
Well actually now all leases are now on the other ax3 set of DHCP servers.

Internet readings .... exclusion ranges in MT ???
 IPAM 2020.2
CAUSE
The IP conflict is caused by both DHCP servers managing the same IP and issuing lease information to them. In a correctly configured split scope, two DHCP servers setup scopes within the same subnet. Once that scope is setup however, each DHCP server must set an exclusion range that is the opposite of the other DHCP server within that range.
You do not have the required permissions to view the files attached to this post.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11439
Joined: Thu Mar 03, 2016 10:23 pm

Re: DHCP Server constantly assigns-deassigns

Sat Dec 02, 2023 5:12 pm

Clients should stick with one DHCP server for renewal, once served by one of the DHCP servers. The other DHCP server should not NACK the address if not in his pool.

I agree with first half if quoted text. Clients know which DHCP server handed out the lease so they could tey to renew the lease using unicast communication. But I guess that's not a requirement.

But I don't agree with the second part of quoted text. If a DHCP server thinks it's authoritative for certain IP subnet, and client is asking for address outside it, server has right to nack the request and offer a lease from own address pool. The problem is that it seems you have 3 DHCP servers on same L2 broadcast domain but they are not not configured to co-exist. And this part is hard to fix.
As you alrwady descrived, it is possible to run two (or three) MT DHCP servers in active/backup setup by setting authoritative property on active (primary) server to "yes" and to "after-2sec-delay" or "after-10sec-delay" on backup server(s). This way backup servers won't interfere if primary server answers to lease requests. But that's not split scope case.
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2984
Joined: Mon Apr 08, 2019 1:16 am

Re: DHCP Server constantly assigns-deassigns

Sat Dec 02, 2023 10:15 pm

Aha MKX, I was hoping you would react.

In my case I have only 2 DHCP servers on a subnet (VLAN) , and one of the devices was flapping between the 2 DHCP servers. The DHCP servers are full split scope, but if they respond alternatingly the client gets a lot of NAK , and disconnects from the wifi. (Don't know what comes first. The flapping was seen in the wifi assigns-deassigns. Debugging showed the DHCP NAK.)

Since my little modification, one device got a lease again from the "after-10sec-delay" DHCP server pool. There is no load on that network, only 5 clients now, and the servers are connected at the same network spot.

Lots of posts on this "DHCP deassign-assign" in the forum.

I wanted to have redundancy with VRRP (routing, SRCNAT, RADIUS (usermanager), DHCP, ....), but I'm still very far from what I had with Forigate cluster, or Windows AD replication.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11439
Joined: Thu Mar 03, 2016 10:23 pm

Re: DHCP Server constantly assigns-deassigns

Sun Dec 03, 2023 4:21 pm

I guess that in a typical active/active scenario it would be best to configure both/all DHCP servers with same address pool. So when a client tries to renew an IP address, it'll be fine with any of servers. Even if previous lease was handled by another DHCP server, the current one will most likely ACK the address as likely there won't be any clash with another device on network. And DHCP servers tend to ACK addresses if those are fine according to config even if server doesn't know about DHCP client yet.

This works fine as long as there are no DHCP relays and (mandatory) IP address availability checks, performed by DHCP server (and client), aren't blocked/skewed by some L2 obstacles.
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2984
Joined: Mon Apr 08, 2019 1:16 am

Re: DHCP Server constantly assigns-deassigns

Sun Dec 03, 2023 5:20 pm

Thx a lot @mkx.

Was thinking to do the same, based on VRRP interface. But indeed, why depend on VRRP?
Actually never saw a problem with a DHCP server that did not store the leases on disk. Clients came back with the same IP address in the leases, after reboot of the DHCP server.

Have seen scripts to replicate FW rules and DHCP leases for MT master/backup scenario's.
But I only need the 'static' leases to be on both DHCP servers. The rest is free to get some address.
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2984
Joined: Mon Apr 08, 2019 1:16 am

Re: DHCP Server constantly assigns-deassigns

Thu Dec 07, 2023 1:53 pm

Unfortunatly .... didn't work as expected. Both DHCP servers assign conflicting IP addresses from the identical pool (same IP address to different devices) . One of the DHCP servers is authoritative the other even never. Didn't help. Wifi devices are often off-line. When both are on-line conflict can be detected.

And by the way the IP address deassign/assign flipper is back.
Klembord-2.jpg
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: dwnldr, holvoetn, infabo, mkx and 21 guests