search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Posted in Linux Server, Virtual Machine Manager | 6 Comments | 11,570 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:

1
2
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!