Community discussions

MikroTik App
 
hfsotous
just joined
Topic Author
Posts: 3
Joined: Sat Jun 20, 2020 3:34 am

Bound and waiting time

Sun Jan 15, 2023 10:03 pm

Hello everyone!
I have been using mikrotik at home for a while now. But recently I implemented homeassistant in my home and I have some automations that depend on when I connect to Wi-Fi when I arrive or leave.
The problem is that when I connect to Wi-Fi it automatically detects me and it goes from waiting to bound immediately (just fine). But when disconnecting it takes a considerable amount of time to go from bound to waiting. The question is, there is a way to change that time? So that it detects me leaving immediately or almost immediately as it does when connecting?
Thanks in advance!


Translated with google
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11433
Joined: Thu Mar 03, 2016 10:23 pm

Re: Bound and waiting time

Sun Jan 15, 2023 10:55 pm

The way DHCP works is that client does the connection requests towards server, never the other way around.. Now when a client joins a network, it needs IP settings and immediately looks for DHCP server and binds to a lease. DHCP server sets lease lifetime and client has to renew lease sooner (it does it after half of lifetime). That's when server hears from client. When client leaves, it likely leaves in the way it can't "unbind" ... wireless clients most often roam out of coverage and by the time client realises it's out of coverage of previous wireless network, it can't unbind any more because it can't contact DHCP server. If client attaches to AP with same SSID (either after some searching or if roaming between APs), it assumes it's still in same IP subnet and doesn't re-bind the lease.

So to your requirement: obviously network can't be notified immediately after client disappears. What can be done is to shorten DHCP lease lifetime ... it's set by DHCP server's property lease-time ... docs state that default value is 10 minutes. If you have multiple DHCP servers (because you have multiple LAN subnets), then lease times can be different. Beware that some clients don't like excessively short lease times and misbehave in some random ways.
 
hfsotous
just joined
Topic Author
Posts: 3
Joined: Sat Jun 20, 2020 3:34 am

Re: Bound and waiting time

Sun Jan 15, 2023 11:23 pm

Thanks mkx!
I will try a little less time lease and let you know

Who is online

Users browsing this forum: No registered users and 17 guests