Re: Upgrade of CentOS and libvirt: need help on configuring network

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Your requirements are pretty simple. I assume you do not use DHCP and all IP addresses are static. This should work:

You need to create a bridge interface `br0` on your host:

yum install bridge-utils

vi /etc/sysconfig/network-scripts/ifcfg-br0


DEVICE="br0"
NM_CONTROLLED="yes"
_ONBOOT_=yes
TYPE=Bridge
BOOTPROTO=none
IPADDR=192.168.0.90
PREFIX=24
GATEWAY=192.168.0.1
DNS1=8.8.8.8
DNS2=8.8.4.4
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System br0"

Modify the gateway if your Internet gateway is NOT at 192.168.0.1

Modify /etc/sysconfig/network-scripts/ifcfg-eth0 as follows (comment out BOOTPROTO, IPADDR, PREFIX, GATEWAY, DNS1, and DNS2 and add BRIDGE=br0):

vi /etc/sysconfig/network-scripts/ifcfg-eth0


DEVICE="eth0"
#BOOTPROTO=none
NM_CONTROLLED="yes"
_ONBOOT_=yes
TYPE="Ethernet"
UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
HWADDR=xx:xx:xx:xx:xx:xx
#IPADDR=192.168.0.90
#PREFIX=24
#GATEWAY=192.168.0.1
#DNS1=8.8.8.8
#DNS2=8.8.4.4
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
BRIDGE=br0

At this point you can restart networking:

/etc/init.d/network restart

Your host machine should be able to communicate to the outside world (Internet) via your gateway.
This is pretty much it because If your VM's worked before and you did not update the OS inside your VMs then you should not need to modify your VMs networking settings.

Zoltan

On 9/23/2013 3:58 PM, Schut, Koos J J (Koos) wrote:

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?

Koos

 



_______________________________________________
CentOS-virt mailing list
CentOS-virt@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos-virt

_______________________________________________
CentOS-virt mailing list
CentOS-virt@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos-virt

[Index of Archives]     [CentOS Users]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [X.org]     [Xfree86]     [Linux USB]

  Powered by Linux