This is driving me nuts. I have a CentOS 7 system. It is acting as DHCP for the network it is attached to, is running Cobbler and PXE, but it is not the gateway. It is the primary file server for my network.
I have an on-board network adapter configured to be static that is also the adapter that DHCP is being handed out on:
# Generated by dracut initrd
NAME="enp5s0f0"
DEVICE="enp5s0f0"
ONBOOT=yes
NM_CONTROLLED=no
#NETBOOT=yes
UUID="82b4ef5d-6c06-43f1-a0fe-7b5fcdd1fc4f"
#IPV6INIT=yes
BOOTPROTO=static
IPADDR=10.101.24.21
NETMASK=255.255.252.0
TYPE=Ethernet
GATEWAY=10.101.24.1
This adapter, about once a week, decides it wants to override the statically configured IP, and get a DHCP address. Not after booting up. Just sitting there. Operating normally. At this point, I have to physically walk to the terminal or log in with IPMI to type:
systemctl restart network
And that brings it right back to the static address. Does anyone have any idea what's going on?
The
BOOTPROTO
parameter only accepts the following values:According to the RHEL Network documentation. Dracut is probably running past the network init script using it's ifcfg module and defaulting it to
dhcp
since it doesn't know whatstatic
means. You might also try omitting theifcfg
module in dracut to see if that does what you expect, as well.My problem was that my centos had been migrated twice as a virtual host. After that my server started deciding that it would use a dhcp-address instead of the statically assigned one.
Finally I removed the "UUID" row entirely and that seems to have fixed it for me. So maybe in your case your network card has gotten a new UUID and that is the issue?
These are just guesses from my end though. Best Regards Charlie