CentOS 6.2: only loopback adapter appears in ifconfig

Posted on 2013-06-11
Last Modified: 2013-06-12
Hi Experts,

I'm managing a dozen or so CentOS 6.2 VMs on Hyper-V (2008 R2) for our start-up. I'm not a Linux expert (I'm a Windows expert) but this is my bag nonetheless.

1. These VMs were on one host and networking was fine.

2. When the VMs were moved to another host, we ran into the MAC address / 70-persistent-net.rules problem. This was corrected by configuring each VM to use static MAC addresses in Hyper-V then edited 70-persistent-net.rules with the new, static MAC addresses.

3. The VMs were moved again, yet networking was dropped again despite 70-persistent-net.rules having the correct MAC address.

ifconfig looks like this:

ifconfig looks like this
I can get things working until I reboot if I:

disable lo

then bring up eth0
Question by:nathanwc
  • 3
  • 2
  • 2
  • +2
LVL 77

Expert Comment

ID: 39241072
ifconfig -a
lspci to see which network device you have. You may have an incompatible network interface for which centos does not have a kernel module/driver for it
modprobe -l

use system-config-network-tui

do you have /etc/sysconfig/network-scripts/ifcfg-eth0?
Are you using NetworkManager to manage your connections?

Accepted Solution

d_nedelchev earned 500 total points
ID: 39241108
It looks like you are missing a sysconfig file (/etc/sysconfig/network).

Try re-creating it:

sudo echo NETWORKING=yes > /etc/sysconfig/network
sudo echo >> /etc/sysconfig/network

All case sensitive!

Then reboot and see if it works.
LVL 19

Expert Comment

ID: 39241172
The file not found message is for ifcfg-eth and it should have a number, you can remove the entry from the persistent rules and reboot or edit the rules file and the ifcfg-eth0 file to make sure they reference the correct interface.
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.


Expert Comment

ID: 39241281
I beg to differ. As you can see from the screenshots the prompt is saying:

[root@localhost ~]#

and not

[root@hostname ~]#

Which means that the machine has no hostname assigned. The hostname is contained in /etc/sysconfig/network.
And since the file is missing and the machine has no hostname the network obviously cannot be brought up.

I'll just note that I've tried this on a VM before I posted the suggestion.

LVL 77

Expert Comment

ID: 39241315
one can have the system named as localhost.localdomain or localhost and still bring up an external IP.
one (hostname) is not a requirement for the other (network access).
i.e. DHCP configured clients administered by NetworkManager do not have a hostname but do get an external IP when the network interface in the system is detected and loaded.

Expert Comment

ID: 39241635
I stand corrected! Yet I think that the problem is that missing file. By default it has just two lines


Open in new window

Since you are absolutely right about the hostname, then I thought the problem must lie in the other option, or it's absence (NETWORKING=yes). Which by the way should be pretty obvious, right?

But yet, I've just made some tests on my VM again, and this time I've tried all possible scenarios:

With both lines.
With either of the two lines.
Even with an empty file.

and the system kept bringing up the interface every time, until I deleted the file. With the file absent, only the loopback adapter was up.

Once I "touch"-ed the file and rebooted, the system brought up the interface again.

So I must insist on my earlier suggestion for recreating the /etc/sysconfig/network.
LVL 29

Expert Comment

by:Michael W
ID: 39241735
Check to make sure that the file ifcfg-eth0 also has the following line:


That will make sure that the ethernet device actually is given an IP address and starts on boot up.

Example ifcfg-eth0 configuration:

LVL 19

Expert Comment

ID: 39242991
Actually I read it slightly wrong (serves me right for trying to look at the picture on my phone) I have to agree with d_nedelchev in #39241635.

It's the

Open in new window

That counts, without it the networking scripts wont run. Funny the file is missing though, normally you would just need to remove the entry from the persistent rules file and it works.

Author Closing Comment

ID: 39243260
Top notch - nailed it! Thank you!

And thank you to everyone else for your contributions. I'm sorry to have not checked in sooner.

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Sending a Secure fax is easy with eFax Corporate ( First, just open a new email message. In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now