Good question. I'm a bit of a libvirt dummy - is there a one-step way?
I created mine in two steps, with nmcli and virsh.
# create the bridge "pubbr0" and plug in interface "enp2s0f0"
nmcli con add ifname pubbr0 type bridge con-name pubbr0
nmcli con add type bridge-slave ifname enp2s0f0 master pubbr0
# write XML file "net-public0.xml" for libvirt's network
<network>
<name>public0</name>
<forward mode="bridge"/>
<bridge name="pubbr0" />
</network>
# create libvirt's network
virsh net-define net-public0.xml
virsh net-start public0
On Mon, Aug 15, 2022 at 3:25 PM Bryan Smith <me(a)bjsmith.me> wrote:
Not to tangent (top post), but ...
This is where I leverage NetworkManager in general (and have a set of standard nmcli
commands and Ansible tooling for common scenarios) ... _avoiding_ libvirtd altogether.
I'm even debating about taking away the default 192.168.122/24 NAT subnet as standard
in new builds with QEMU/KVM installed, just because of past issues with pre/post routing,
or even IP address range conflicts (long story). It's easy to overlook those as
well.
YMMV, including with oVirt.
On Mon, Aug 15, 2022 at 10:17 AM Ian Pilcher <arequipeno(a)gmail.com> wrote:
>
> I feel like I'm taking crazy pills! I'm reading the libvirt network XML
> format documentation[1], and I can't figure out how to create a simple
> bridged network - no NAT, no routing, no OVS, no macvtap, etc. I.e.,
> just a Linux bridge with a single physical interface attached.
>
> None of the 3 scenarios listed for <forward mode='bridge'> describe
the
> simple setup that I'm trying to create, so it looks like I'll need to
> create the bridge separately. (It's not hard to do, it just seems like
> such a weird gap the in the functionality.)
>
> [1]
https://libvirt.org/formatnetwork.html
--
Bryan J Smith -
http://www.linkedin.com/in/bjsmith
E-mail: b.j.smith at
ieee.org or me at bjsmith.me