On 02/04/2016 01:07 PM, Niccolò Belli wrote:
Ok, I understand it.
I manually create a tap device and I added it to my bridge, can you please at least tell me how am I supposed to use it with virt-manager? With plain qemu I simply use -net nic,model=virtio -net tap,ifname=tap0,script=no,downscript=no,vhost=on but I didn't find how to use tap0 with the virt-manager graphical interface.

Ah, I think you've misunderstood the use of the virt-manager command to create a bridge. That command uses netcf (where available) to create a bridge device that is attached to a physical ethernet on the host. You only do that once.

If you already have a bridge setup on your host, for each guest you just add an interface in the normal manner (NB: you do not create any tap devices; libvirt does that for you and connects them to the proper place), and tell it to connect to the bridge device that was already created. If your bridge doesn't show up in the list provided by virt-manager (which would likely happen if your libvirt was built with netcf support on a distro that has a non-functioning netcf), then just select "Specify shared device name" at the bottom of the list of network sources, then type in the bridge's name yourself. (you could eliminate this problem by rebuilding libvirt to use the "udev" backend to the interface driver rather than the "netcf" backend, but if I were in your position I wouldn't bother with that - too much potential to break something else).

Alternately, once you have the host bridge created on your host (for example's sake let's say it is named "br0") you can create a libvirt network that references this existing bridge like this:

1) create a temporary text file (name it anything you like, e.g. xyzzy.xml) with the following contents:

   <network>
     <name>bridge-net</name>
     <bridge name='br0'/>
     <forward mode='bridge'/>
   </network>

2) as root, run the following commands:

   # virsh net-define xyzzy.xml
   # virsh net-autostart bridge-net
   # virsh net-start bridge-net

Now when you select the "network source" for a guest's interface in virt-manager, one of the selections will be:

   Virtual network "bridge-br0"

That's the one you should use.

At this point your problems are really in the realm of libvirt rather than netcf, so it might be more useful if you sent further questions to "libvirt-us...@redhat.com" rather than the netcf list. Alternately, if you use IRC, connect to irc.oftc.net and ask in #virt, which is frequented by nearly all the libvirt developers, as well as quite a few kvm/qemu people.

You may also want to read the libvirt wiki page on networking:

  http://wiki.libvirt.org/page/Networking





_______________________________________________
netcf-devel mailing list
netcf-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/netcf-devel@lists.fedorahosted.org

Reply via email to