Improve company productivity with a Business Account.Sign Up


CentOS 6.2: only loopback adapter appears in ifconfig

Posted on 2013-06-11
Medium Priority
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 82

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 2000 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.
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.


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 82

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 Worsham
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
To export Lotus Notes to Outlook PST or Exchange and Domino Server files to Exchange Server or PST files with ease, go for Kernel for Lotus Notes to Outlook conversion tool. Through the video, you can watch the conversion process. A common user with…

606 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