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

[libvirt] configuring network interface



Hello

I've a lan of virtual machine configured with bridge. I've a private lan of 4 machine, but one of them have 2 lan-card with access to internet.

Evertything works almost fine, except that I've configured on each guest the static configuration of the bridge with the ip address, like this:

auto lo
iface lo inet loopback

auto eth6
iface eth6 inet static
address 192.168.1.41
network 192.168.1.0
netmask 255.255.255.0
gateway 192.168.1.10

But each time I, for example, define the guest, it start with a ascending number of interface: eth6,eth7, eth8, etc, Now is initializing with eth12. So, it doesn't get the manual configuration I've done on the /etc/network/interfaces.
How can avoid this way of work of the number of ethernet interface the guest start?

A way i'm trying to solve is configuring the interface trough the guest xml definition, but the operation "define" on virsh accepted without error the xml i've done, but the dumpxml doesn't show them, so, it doesn't work at all.
I've followed the instruction that said the manual "Application development guide - a guide to application development with libvirt" on page 71.

The whole definition of the VM is attached, but the related to interface is:
    <interface type='bridge'>
      <source bridge='br0'/>
      <target dev='vnet0'/>
    <protocol>
        <ip address="192.168.1.41" prefix="24"/>
        <route gateway="192.168.1.10"/>
    </protocol>
    <bridge stp="off" delay="0.01">
    <interface type="ethernet" name="eth12">
    <protocol>
        <ip address="192.168.1.41" prefix="24"/>
        <route gateway="192.168.1.10"/>
    </protocol>
    </interface>
    </bridge>
    </interface>


But after define, the dumpxml only show this part:
    <interface type='bridge'>
      <mac address='52:54:00:3c:92:9a'/>
      <source bridge='br0'/>
    </interface>


I would appreciate any help to solve the question. The problem I've is I lost the access to the guest every time the libvirt change the name of the interface eth1,2,3, etc.

Thank you very much.

Marcela



<domain type='qemu'>
  <name>rnompi1</name>
  <uuid>f9ca9342-1502-be0a-0573-9a68d0772d7e</uuid>
  <memory>1048576</memory>
  <currentMemory>1048576</currentMemory>
  <vcpu>2</vcpu>
  <os>
    <type arch='x86_64' machine='pc-0.12'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/home/radic/discoguest/rionegro/rnompi1.img'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
    </disk>
    <interface type='bridge'>
      <source bridge='br0'/>
      <target dev='vnet0'/>
	<protocol>
		<ip address="192.168.1.41" prefix="24"/>
		<route gateway="192.168.1.10"/>
	</protocol>
	<bridge stp="off" delay="0.01">
	<interface type="ethernet" name="eth12">
	<protocol>
		<ip address="192.168.1.41" prefix="24"/>
		<route gateway="192.168.1.10"/>
	</protocol>

	</interface>
	</bridge>
    </interface>
    <console type='pty'>
      <target port='0'/>
    </console>
    <console type='pty'>
      <target port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes'/>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
    </video>
  </devices>
</domain>


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