2

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?

2
  • I know it's dracut but can't tell you exactly whats happening
    – Sum1sAdmin
    May 4, 2016 at 21:17
  • FWIW, for the static IPs on my RHEL7 systems, I use BOOTPROTO=none.
    – Thomas N
    May 4, 2016 at 22:39

2 Answers 2

4

The BOOTPROTO parameter only accepts the following values:

 BOOTPROTO=protocol    ## where protocol is one of the following:

    none — No boot-time protocol should be used.
    bootp — The BOOTP protocol should be used.
    dhcp — The DHCP protocol should be used. 

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 what static means. You might also try omitting the ifcfg module in dracut to see if that does what you expect, as well.

2
  • Ok, that sounds plausible. I tried this. I'll post back here in a week or so if it hasn't done it again and mark this as the answer!
    – Locane
    May 5, 2016 at 0:56
  • This didn't work either :/ I suspect that it's some kind of Cobbler or other software related thing at this point.
    – Locane
    May 10, 2016 at 19:37
2

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

1
  • I had ro remove the mac address line as well. After that, the system assigned the static IP. Apr 6, 2022 at 8:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .