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


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!!
Who is Participating?
Sanga CollinsConnect With a Mentor Systems AdminCommented:
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.
Longshot9Author Commented:
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.
Longshot9Author Commented:
I rebooted it and now it's showing the ipv4 address and I can get into the web interface for nagios.  thanks!
Sanga CollinsSystems AdminCommented:
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.
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.

All Courses

From novice to tech pro — start learning today.