Cent-OS running on a Hyper-V server not getting IP address

Posted on 2012-08-20
Last Modified: 2012-08-20

I'm trying to setup a Nagios server and have downloaded a pre-configured Hyper-V vhd from them that runs Cent-OS Linux.  I've got it all configured and can run it, but it's only showing the localhost network connection.  I can't get it to show an ethernet connection or get an IP address.  

I've currently got it set up with a legacy virtual network adapter, and have tried static and dynamic mac addresses.  

In linux i've got /etc/sysconfig/network-scripts/ifcfg-eth0 setup as follows

HWADDR=same mac address as set in the legacy network adapter in hyper-v settings for the vm
NAME="System eth0"

I'm a total linux noob here so be descriptive on any commands I need to run, please :)

I don't know if more information is needed or not, feel free to ask.

Thanks for help!!
Question by:Longshot9
    LVL 18

    Accepted Solution

    from the centos command line, run the following command


    then you should be able to go into the networks section and fix the ip addresses. I have similar issues all the time when moving VMs from one server to another where the NIC and MAC id change.

    Setting it up from the setup tool usually fixes it.

    Author Comment

    thanks for the response.  I ran through that before and had set it to dhcp, so I re-did it for a static address.  ifconfig is now showing an eth0 adapter, though I don't know if it was from this or some other things I tried earlier.  Problem though now, is it's not showing the static ipv4 address, just a ipv6 address... no clue where it got that from.

    Author Comment

    I rebooted it and now it's showing the ipv4 address and I can get into the web interface for nagios.  thanks!
    LVL 18

    Expert Comment

    by:Sanga Collins
    Fantastic! It's a weird issue that I only experience with centos. Ubuntu and suse behave a little better but I still have to pay attention to make sure it doesn't catch me off guard.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    VMware vSphere 5 VMWare have been specialising in server virtualisation since 2001. It has the largest market share especially in the enterprise market and therefore has a strong reputation for delivering virtualisation solutions. As it was the f…
    Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
    How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
    In this video tutorial I show you the main steps to install and configure  a VMware ESXi6.0 server. The video has my comments as text on the screen and you can pause anytime when needed. Hope this will be helpful. Verify that your hardware and BIO…

    779 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

    12 Experts available now in Live!

    Get 1:1 Help Now