Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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

1 Answer 1

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>
<interface type='bridge'>
  <mac address='52:54:00:22:fb:b5'/>
  <source bridge='br0'/>
  <model type='virtio'/>
</interface>
...

The interfaces file on the guest:

...
auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
  address ...
  ...
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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