VirtualMetric Hyper-V Monitoring, Hyper-V Reporting


Cozumpark Bilisim Portali
eth name changes after Hyper-V Linux IS v3.1 installation on CentOS 6
Posted in Linux Server, Virtual Machine Manager | 6 Comments | 11,537 views | 07/08/2011 21:54

If you install Hyper-V Linux IS v3.1 on CentOS 6 and assign a new synthetic network card, network device name may change from eth0 to eth1. That’s not a good thing if you work with “Set-LinuxVM” because by default it works with eth0 (yes, you can consider this as a bug :))

Also I’m one of the guys who loves symmetry so I want to use eth0 instead of eth1, because my server has only one network adapter. So let’s look at the CentOS server.

If you go to Setup and network devices, you’ll see eth0 as a device.

I see eth0 in device menu but my server has no internet connection. Why? Let’s see current devices.

ifconfig -a

That’s the problem. Your pre-configured network device is eth0 but current device is changed as eth1.

It’s also same problem when you don’t set Linux VM’s MAC as static in Hyper-V Clusters. When your Linux VM jumps over another Hyper-V node, it may get a new MAC id from MAC pool of the new Hyper-V node. If MAC changes, your device name also changes and your network connection dies.

Actually you can change eth0 config as an eth1 to fix your network connection. Just you need to do:

cd /etc/sysconfig/network-scripts/
mv ifcfg-eth0 ifcfg-eth1

Also you need to edit ifcfg-eth1 file to change device name. But we want to use eth0 name instead of eth1.

So let’s go to CentOS 6 net rules:

nano /etc/udev/rules.d/70-persistent-net.rules

You will see two network devices in 70-persistent-net.rules.

Just leave the first one and remove ATTR{address}==”xx:xx:xx:xx:xx:xx″ from device.

Also at the end of the line, you will see the device name. That should be “eth0”.

Save the changes and reboot your VM. Let’s check device name again.

ifconfig -a

Now you can use eth0 in your CentOS 6 VM. Nice job!

Comments (6) » [tuto] Installation Centos 6 sous Hyper-V

September 19th, 2011

[…] […]


November 9th, 2011

I have done all of this, but when i ping to another computer the “Destination Host Unreachable” message is shown. My “70-persistent-net.rules” file is the same that yours, and my “ifcfg-eth0” is the original one, with a different MAC.


November 9th, 2011

Hi Abizmo,

It seems your gateway address is not set properly. Could you check them again? Could you ping computers in the same network?


Rafael Medeiros

November 17th, 2011

Thanks man, works like a charm….perfect

zakir hossain

April 1st, 2014

thanks, it works.


October 24th, 2020

When someone writes an paragraph he/she retains the plan of a user in his/her brain that
how a user can know it. Thus that’s why this article is outstdanding.

Leave a Reply