Static IP or a long lease time?

Simple question, is there any difference, both give you an IP, static make it forever and a long lease time for example for 10 years if necessary.
But is there technically any difference?

Technically … host with DHCP lease will ask DHCP server for a lease every time it boots up. Or it’ll ask for lease renewal every /2 if it manages uptime that far. In between, DHCP server won’t know if client is alive or not. And if IP address is somehow occupied when host asks for the lease, it will end up using a different IP address (due to IP address collision detection). And this scenario is not that improbable … if there’s some host running container platform (e.g. docker) and has its networking configured unluckily (e.g. default setup for docker is such an example), then it may happen for a container to assume IP address which overlaps your “pseudo static” IP address assignment (been there, dealt with it).

Host with static IP assignment will never ask for lease. It’ll use statically set up IP address. In case there’s an IP address collision, it’ll report the collision but will keep using the assigned one. If the collision is due to some other host trying to use DHCP leased address (which collides with statically set IP address), then the DHCP client will “loose”. If both “trespasser” and “legitimate host” insist on using the same address, then all sorts of funny (and not so funny) things keep happening until one resolves the collision (imagine “trespasser” using IP address of default gateway).

It is possible to have some subnet where only hosts with constant IP addresses are supposed to connect (e.g. server LAN) … in this case one doesn’t even need to set up a DHCP server, simply setting up hosts with static IP addresses works fine. This kind of setup also helps with security (through obscurity) … if some “non-aware” host somehow connects to this LAN, it won’t receive DHCP lease and will revert to using APIPA address … meaning it can’t access servers. Not at the first sight, it may sniff traffic, there will always be some broadcasts, and it can guess the IP settings so it’ll eventually be able to connect to that LAN “properly”.

My strategy is: if having some host at static IP address is really important (e.g. it’s a server which requires some config, like NAT), then I set IP address static. If IP address doesn’t matter that much (but it’s nice to have), then I set static DHCP lease … and I don’t bother with long lease times.