I have two running KVM guests on an Ubuntu (Lucid) host. One of them uses the simplest NAT method, and DHCP inside. The other uses the bridge method and static IP inside. Both work fine. Can I mix the networking methods? I'd like to create some set of scripts which used the local 192.168.122.x address, no matter if the guest has or not has an additional bridged LAN interface. Having eth0 and eth1 interfaces inside would be fine. Thanks for your interest.

  • Yes, you can create a guest with both a bridged and a NAT interface. What is your question? – Michael Hampton Oct 2 '12 at 1:41
  • After dumping the xml domain files (virsh), I composed a third one, with both type of the interface tag section. I 'undefined' the original guests, but could not 'virsh define" the third one. (Error: Failed to define domain. Unknown failure). An example libvirt domain xml (and the interfaces file of the guest) of a working mixed networking guest would really help me. – stoqlt Oct 2 '12 at 11:03
  • I created the running original guests with ubuntu-vm-builder. – stoqlt Oct 2 '12 at 11:10

A simple configuration for a host which has both the virbr0 and br0 interfaces:
The domain xml file on the host:

<interface type='network'>  
  <mac address='52:54:00:22:fb:b4'/>
  <source network='default'/>
  <model type='virtio'/>
<interface type='bridge'>
  <mac address='52:54:00:22:fb:b5'/>
  <source bridge='br0'/>
  <model type='virtio'/>

The interfaces file on the guest:

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
  address ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.