I am having this issue with many of my CentOS servers where after a reboot the network interface fails to come up automatically. This is a big problem for me since I need to drive to the datacenter every time when this happens as a result from a remote reboot. Then on the console eth0 is down and I have to ifup this manually. Is there a specific config file I can check to prevent this from happening in the future?
-
One thing to look at is to make sure the designation of NIC device is consistent across reboots. There's like about 3 places you need to look at for this. I don't remember offhand what they are - I've got them written down at my other job, so later I'll take a look and post here. The reason I say this is because I've had this happen before a number of times, and it turned out that the OS was relabeling "eth1" as "eth0" and vice-versa during reboot. ... Annoying! But there's a way to force it to be consistent.– Michael MartinezApr 18, 2014 at 17:59
3 Answers
Ensure that the file /etc/sysconfig/network-scripts/ifcfg-eth0
has the line
ONBOOT="yes"
See 9.2. Interface Configuration Files for details.
Make sure ONBOOT="yes"
is set in /etc/sysconfig/network-scripts/ifcfg-eth0
also check that
NetworkManager
or network
(whichever you use) is started on boot.
chkconfig NetworkManager on
or chkconfig network on
Configuration file must have right privileges also:
sudo chmod 0755 /etc/sysconfig/network-scripts/ifcfg-*
At /etc/sysconfig/network
can have those lines:
NETWORKING=yes
HOSTNAME=myhostname.mydomain
NETWORKING_IPV6=yes
-
I needed chmod 0755 if* it was absolutely critical I was getting ifdown /ifup,ifpost 'permission denied' this solution here was the only one I was able to Google. I'd inadvertently backed-up and restored the config files without a cp -p (preserve)– zzapperNov 28, 2016 at 19:56