[CentOS] DHCP and no network for long time

Tue Aug 13 12:37:01 UTC 2019
Jonathan Billings <billings at negate.org>

On Tue, Aug 13, 2019 at 07:46:37AM -0400, Jerry Geis wrote:
>
> Odd thing happened... A centos 7 install set for DHCP. boot the box no
> network connected.
> I let it like this overnight. I come in this morning and plug in the
> network. Is it supposed to get a DHCP address at that time ?  It did not .
> service network restart did get an address.
> 
> if I unplug the network, reboot the box, want a minute or so - then plug
> the network in - it gets a DHCP address.
> 
> Is there a "limit" to the time that the OS will keep trying to get a DHCP
> address ?

The RFC for DHCP describes a randomized exponential backoff for
retransmission.  This means it'll wait longer and longer between
retries.

However, when you unplug the network cable, on boot the 'network'
service doesn't even try to bring up the interface.  If you're using
NetworkManager, it should detect the interface activating and bring up
the interface.  Perhaps you had turned off NetworkManager, but the
reboot brought it back?

-- 
Jonathan Billings <billings at negate.org>