Score:1

Shouldn't dhclient confirm its lease after a carrier loss?

bd flag

I'm investigating an issue with a Ubuntu server acting as the Internet gateway for a branch office stopped working after being switched to a new Internet connection.

The IP address on the external interface is acquired from the ISP router via DHCP. When the interface was disconnected from the old line and connected to the new one, there was no Internet connectivity. Checking the log, I found that the Ethernet link on the interface had come up but was still trying to use the IP address it had been using on the old line. There weren't any dhclient log entries after the Link is Up message.

The way I understand DHCP, if the link on an Ethernet interface is going down and up again, the machine should assume that it might have been moved to a different network segment, and consequently try to reacquire its IP address before using it again.

Am I wrong?

A.B avatar
cl flag
A.B
I can confirm that dhclient **standalone** didn't appear to care about carrier loss when testing (on Debian). Now if it's itself managed by NetworkManager, then carrier loss + carrier up => DHCP Request. So it depends on your setup and the version of the various running utilities (maybe even including dhclient)
in flag
Interesting question, but I suppose that if the DHCP lease is not expired it will continue to keep the IP address? Does a laptop immediately try to acquire a new IP address if you unplug it temporarily from the network? Since this is a server, why not write a simple script that verifies internet connectivity every X minutes and, if none is available, tries to renew the IP address?
Score:1
cn flag

you need to run sudo dhclient <ethernet interface id>

ex: sudo dhclient eth0

Also check this out!

Tilman Schmidt avatar
bd flag
Of course, but that doesn't answer the question. It's also difficult to implement because the administrative access to the machine in question is via VPN over the very internet connection that is affected by the problem. So I have a real interest in getting this to work without manual intervention as it should.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.