[SOLVED] eth0 doesn't load configuration from ifcfg-eth0

Issues related to configuring your network
Post Reply
Meditsh
Posts: 6
Joined: 2017/04/03 13:38:36

[SOLVED] eth0 doesn't load configuration from ifcfg-eth0

Post by Meditsh » 2017/04/03 15:03:15

Hello everyone,

I am using a CentOS virtual machine which interface eth0 is correctly running.
The problem is that after rebooting the virtual machine its configuration will reset with information which I don't know the origin. I just know that this is not from ifcfg-eth0 since DNS addresses don't match. That is my problem, I don't want to lose DNS after each unexpected reboot.

What I tested :
  • After rebooting eth0 and resolv.conf get a wrong DNS address
    After rebooting, the command "sudo service network restart" load correct DNS address to eth0 and resolv.conf
    Inside ifcfg-eth0 : Editing BOOTPROTO from "none" to "static" --> After reboot it is reset to "none"
    Inside ifcfg-eth0 : Changing IPADDR --> after reboot it is reset to its first value
    Inside ifcfg-eth0 : Changing DNS address --> after reboot value is not reset. But eth0 doesn't get it. After "sudo service network restart" the value is set to eth0.
    Inside ifcfg-eth0 : Adding the line HWADRESS with MAC address get on virtual machine network adapter summary --> doesn't change anything
    Inside ifcfg-eth0 : Adding the line "PEERDNS=NO" --> doesn't change anything

Here is the /etc/sysconfig/network-scripts/ifcfg-eth0 content (X stand for my private information) :

Code: Select all

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
Type=Ethernet
HWADRESS= XX:XX:XX:XX:XX:XX
IPADDR=XXX.XXX.XXX.XXX
IPV6INIT=NO
NETMASK=255.255.255.0
GATEWAY=XXX.XXX.XXX.XXX
BROADCAST=XXX.XXX.XXX.XXX
DNS1=XXX.XXX.XXX.XXX
DNS2=XXX.XXX.XXX.XXX
PEERDNS=NO

Please help me to get permanent DNS configuration,

Thank you per advance.
Last edited by Meditsh on 2017/04/05 14:06:20, edited 1 time in total.

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: eth0 doesn't load configuration from ifcfg-eth0

Post by TrevorH » 2017/04/03 15:12:18

Is this really running CentOS 5? It went End of Life a few days ago and there will be no more updates for it. You should migrate to a supported release ASAP.
Inside ifcfg-eth0 : Editing BOOTPROTO from "none" to "static" --> After reboot it is reset to "none"
They are the same thing in any case. The network scripts only look for dhcp and bootp, anything else including 'none', 'static', 'fred', 'george' all mean the same thing - i.e not DHCP.

What's the output from chkconfig --list | grep -i netw ?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Meditsh
Posts: 6
Joined: 2017/04/03 13:38:36

Re: eth0 doesn't load configuration from ifcfg-eth0

Post by Meditsh » 2017/04/04 06:32:57

Thank you TrevorH for this information and quick response.

The command chkconfig --list | grep -i netw display this line :

Code: Select all

network	0:off		1:off		2:on		3:on		4:on		5:on		6:off
In my first message I forgot to mentioned that this CentOS machine is a PowerChute Network Shutdown Virtual Appliance (from APC company). As I am running out of idea I am going to look for any clue in APC's forum.

Since Yesterday I changed "HWADDRESS" to "HWADDR".
I noticed that eth0 get IPV6 adress even though "IPV6INIT" is set to "NO". I also noticed that "IPV6INIT=NO" become "IPV6INIT=no" after each reboot.

Meditsh
Posts: 6
Joined: 2017/04/03 13:38:36

[SOLVED] eth0 doesn't load configuration from ifcfg-eth0

Post by Meditsh » 2017/04/05 07:24:38

I created another Virtual Machine to replace it.
This one was initiated with correct network values and have exactly the same behaviour : when changing the DNS in ifcfg-eth0 and rebooting, the resolv.conf file get DNS from an unknown place, and doing a "service network restart" make it load ifcfg-eth0 again.
Thus I assumed either VMware (PowerChute Network Shutdown) makes it use a special configuration file for the initiating, or the problem is linked with the output of the "chkconfig" command TrevorH made me use.

Then I tried to configure network from VAMI (Virtual Appliance Management Infrastructure) scripts integrated in /opt/vmware but it is also reset after rebooting.

I am going to use my new Virtual Machine instead of the first one which can't remember correct DNS so then my problem seems to be solved (as I soon as I am not supposed to change my DNS everyday ^^). But the mystery still remains.

I am going to wait until this night and put the topic to in "SOLVED" state.

TrevorH thank you again for your help.

Post Reply