[CentOS-virt] Upgrade of CentOS and libvirt: need help on configuring network - Solved

Thu Sep 26 07:02:37 UTC 2013
Schut, Koos J J (Koos) <kschut at avaya.com>

> I upgraded from CentOS 5.9 to CentOS 6.4.

>

> I try to reuse my virtual machines and am only partially successful: I

> can run them, I just cannot get the network OK and need some help with that.

>

>

> What I had in the past was pretty simple: both the host and the VM?s

> used eth0 and each had an IP in the same subnet and could communicate freely.

> With the new install it seems somewhat more complex and I think I need to configure a bridge and use that.

> Unfortunately, info I find through google is overwhelming and

> confusing. All examples either configure something else, or the outcome is not what? expected.

>

>

> So: how to go about setting things up to have say:

>

> My physical machine is on 192.168.0.90

>

> My Virtual machines are on 192.168.0.100 and 101.

>

> These are to be fixed addresses.

>

> The 2 VM?s have to communicate with each other and with the physical machine.

>

> The VM?s do not necessarily need to communicate with the rest of the world.

>

> The physical machine needs to communicate with the rest of the world.

>

>

> I use:

>

> - CentOS-6.4_64

>

> - Virtual Machine Manager 0.9.0

>

> - xen 4.2.3

>

> - libvirt 0.10.2.7-5

>

> - VM?s show Hypervisor = xen (fullvirt)

>

> - Emulator = qemu-dm

>

> - NIC points to Shared device name virbr0

>

> - on the host, virbr0 has IQ 192.168.122.1

>

>

> I have been fighting this for 2 weeks, now. I tried to follow several

> advises which resulted in either the VM?s not connecting to anything,

> or my host losing its connection to the rest of the world, or both. So either I still do something not-right, or I follow the wrong gidelines.

>

>

> Can someone give me a push in the right direction, please?

Thanks to all who responded to this: it is working now.
Solution was relatively easy and mainly a matter of understanding the "ifcfg-eth0 - like" files.

What I did:
1 - yum install bridge-utils
2 - change /etc/sysconfig/network-scripts/ifcfg-eth0 to:
DEVICE="eth0"
BOOTPROTO=none
ONBOOT="yes"
TYPE="Ethernet"
HWADDR=xx:xx:xx:xx:xx:xx
BRIDGE="br0"
USERCTL=no
IPV6INIT=no
NM_CONTROLLED="no"
3 - change change /etc/sysconfig/network-scripts/ifcfg-br0 to:
DEVICE="br0"
BOOTPROTO=none
ONBOOT="yes"
IPADDR=192.168.0.95
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
DNS1="192.168.0.1"
PEERDNS="yes"
TYPE="Bridge"
DELAY=0
STP=off
USERCTL=no
IPV6INIT=no
NM_CONTROLLED=no
4 - /etc/init.d/network restart
5 - choose Host device eth0 (Bridge 'br0') in the VM-manager GUI for the virtual-machine's NIC
6 - restart the virtual machines

That made it all work.
So what I had wrong initially were settings in the ifcfg-xxx files. There are different settings that may work and I just tried some of the not-working combinations.
Cheers,
Koos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos-virt/attachments/20130926/00e3755c/attachment-0002.html>