[libvirt-users] Basic Network Connections

Slater, Joseph joe.slater at windriver.com
Wed May 1 18:36:49 UTC 2013


Hi Javier,

I got guest networking going in 3 modes -- "direct", "default network", and
"openvswitch bridge".  Most of the issues turned out to be in getting dhcp
addresses assigned.  Things like having to add ip=dhcp to cmdline sometimes
and specifying <model type='virtio'/> interfering with dhcp sometimes.

Joe


> -----Original Message-----
> From: javilegido at gmail.com [mailto:javilegido at gmail.com] On Behalf Of Javi Legido
> Sent: Saturday, April 27, 2013 11:52 AM
> To: Slater, Joseph
> Cc: libvirt-users at redhat.com
> Subject: Re: [libvirt-users] Basic Network Connections
> 
> Hi.
> 
> I guess the best way to proceed here is to explain a little bit how do you want your
> networking setup. You csn have a subnet for VM's and Hypervisor, you can have NAT, you can
> have bridge. Do you want to leave IP addresses and routes to Operating System or do you
> prefer to leave it to KVM?
> 
> Regards.
> 
> Javier
> 
> El 27/04/2013 18:05, "Slater, Joseph" <joe.slater at windriver.com> escribió:
> 
> 
> 	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
> 
> 
> 
> 
> 	_______________________________________________
> 	libvirt-users mailing list
> 	libvirt-users at redhat.com
> 	https://www.redhat.com/mailman/listinfo/libvirt-users
> 





More information about the libvirt-users mailing list