Every day I connect to my LAN about 50 devices just so I can connect to them, configure and disconnect. I do that using TP-LINK TL-ER6020. Even with DHCP lease time set to minimum, most of the time I have to search for currently connected device’s IP.
Can I set up MikroTik (RB951Ui-2HnD) so every port has static IP with no lease time? I want to be able to connect to all devices under let’s say 10.10.20.100 every time i plug something to specific eth port without waiting, even if it’s 10 devices in 5 minutes.
Network I have in mind will be without WAN (just for config purposes). Is it doable?
It is not possible to do it without lease time because lease time is part of DHCP protocol. But you can get to the point where device plugged to particular port will have predictable IP address.
With some cludge:
remove all ether ports from bridge
configure IP addresses directly on ether interfaces, use long network masks (e.g. /30 or /29)
configure separate DHCP pool containing single IP address for each of those subnets
add DHCP servers one to each ether port. Configure some insanely short lease time (such as few minutes, some DHCP clients don’t like very short lease times)
configure appropriate routing on your workstation to use RB as gateway towards those devices.
optionally configure src-nat on device etehr ports if devices don’t like connections from “alien” networks
You’ll probably still have to wait for DHCP leases to expire before plugging next device to same port (DHCP server probably won’t send out lease with IP address whose lease did not expire yet). If you can’t do it, you can make per-port subnets slightly larger (e.g. /29) which will allow for a few client IP addresses (/29 subnet allows 5 client addresses plus router’s own) and you will have to try only a few (consecutive) addresses to find the one being used by currently connected device.
Searching for IP is something I was hoping to avoid completely. I hope MikroTik will be smarter than TP-LINK with lease time. I have time set for 2 minutes and most of the time I am unable to retrive IP address even after 15 minutes form disconnecting device. Later today I will test Your ideas and come back with results. Thanks again!
It’s not entirely up to DHCP server (Mikrotik or TP-Link), it’s up to DHCP client as well. RFC2131 defines granularity of 1 second for lease time and minimum lease time restriction was removed. DHCP clients might adhere to older RFC1541, which defined minimum lease time of 1 hour (granularity was 1 second as well). Standards allow clients to reject lease if they don’t support some setting, such as lease times shorter than 1 hour. Since this is an already old standard revision, most DHCP clients support shorter lease times, but might still limit lease times to some (sane) minimum value … thus either rejecting leases received from servers, or ignoring short lease time making even bigger problems (server might expire lease while client is still hanging on to it … which might cause problems when clients decide to renew lease).
I’m looking forward to see your findings and progress.
So, I ended up with config suggested by @mkx. Works fine and short lease time is realy short and ports always are free after few minutes, so I’m happy.
Thank You all