Why Ubuntu releases its IP during system reboot/shutdown

Asked by Sourav Maity on 2017-11-28

Hi,

I got a weird problem in our setup. Every time I reboot Ubuntu systems it is releasing its IP from the DHCP server. So the IP is getting free in DHCP. Therefore in some cases DHCP is offering the same IP to other system. And its then difficult to find the new IP assigned to the system as it is located at remote location. IP reservation may help, but we cannot go for reservation as we have huge number of system.

I checked with other distributions(RHEL/CentOS/Fedora/Windows), those systems does not release IP during system reboot/shutdown

And the IP release is happening when the interface is added in /etc/network/interfaces file with dhcp options.

Kindly suggest how can I prevent IP release during system shutdown/reboot in Ubuntu

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
2017-11-30
Last reply:
2017-11-30

This is normal and how DHCP works. There may be more systems than the pool can hold simultaneously but IPs are redistributed as they are returned to the pool.

If you need a static IP then set a static IP or set up a reservation based on the MAC address. This will ensure the interface gets the same IP on your network but take one from the pool of addresses if you move to a different network.

Sourav Maity (souravm) said : #2

I checked other Linux distributions like RHEL/CentOS/SuSE they are not releasing IP in system reboot. If it is normal way, then those dists should also release IP during system reboot.

Anyway, DHCP server maintains the IP lease record. If lease expires, it deletes the record if client does not renew IP before lease expires. Then what is the logic to release IP from client end during every reboot/shutdown?

So that the pool doesn't empty. If someone with a phone attends a site, connects to the WiFi and gets an IP via DHCP and leaves then the address will never return (in your model). This will eventually take all available IPs and DHCP will start to not give IPs out as it has none.
When a system shuts down or is rebooted, part of the process is to release the IP(s) it has back to the DHCP service. If it comes back up (in a reboot) then it will request an IP address as normal and the server will give it an IP from the pool. If there is a reservation based on MAC address then it will get the same IP as last time.

Can you help with this problem?

Provide an answer of your own, or ask Sourav Maity for more information if necessary.

To post a message you must log in.