[libvirt-users] Basic Network Connections

Slater, Joseph joe.slater at windriver.com
Fri Apr 26 18:41:26 UTC 2013


Hi,

If I have these fragments in a domain definition, the guest will start with "eth0"
assigned by dhcp to an address on my lan.  Things seem to work according to the documentation
I can find.

  <network>
    <name>direct-macvtap</name>
    <forward mode='bridge'>
      <interface dev='eth0' />
    </forward>
  </network>
  <devices>
    <interface type='direct'>
      <mac address='00:15:17:A6:BC:C9' />
      <source dev='eth0' mode='bridge' />
      <model type='virtio' />
    </interface>
 </devices>

I don't understand the <network> part here.  It doesn't seem to be documented.  I inherited these pieces
so I do not know why they are as they are.

If, instead, I have the following, the guest comes up with no network interface at all
(except lo).  On the host, interfaces vnet0 and virbr0 exist and virbr0 is 192.168.122.1.

  <devices>
   <interface type='network'>
      <source network='default'/>
    </interface>
  </devices>

Adding in

      <model type='virtio' />

makes it start with "eth0", but no address has been assigned.  I can manually do that and then
I can communicate with the host but it's kind of a pain to add the address and routing manually.
Oddly enough, though, ping from host to guest works normally, but ping guest to host seems to succeed once
then hang (with no timeout).

It is not at all obvious to me how virtio magically creates eth0.

Am I doing something wrong, here?  And, if anyone could advise how to use openvswitch
I'd appreciate it.  I've seen adding

<virtualport type='openvswitch/>

might be enough, presumably with an appropriate name for the source network.

Joe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20130426/db3ea063/attachment.htm>


More information about the libvirt-users mailing list