Understand how bridge works

Sebastian Mitterle smitterl at redhat.com
Fri Jul 8 06:57:44 UTC 2022


Hi Valerio,

not sure you already figured it out. To me 'source bridge="virbr0"' looks
to me like the guest is run w/ default libvirt network for NAT -
https://wiki.libvirt.org/page/Networking#NAT_forwarding_.28aka_.22virtual_networks.22.29
Libvirt uses dnsmasq for DHCP. 122.1 is the default gateway, you can find
more info under that link and examples of alternative network definitions
at https://libvirt.org/formatnetwork.html

On Mon, Jun 27, 2022 at 4:00 PM Valerio Pachera <sirio81 at gmail.com> wrote:

> Hi, I'm running virt-manager 2.2.1 on a ubuntu 20.04 (kde neon).
> In stalled a ubuntu 22.04 as guest.
> The vm nic is configured using bridge
>
> <interface type="bridge">
>   <mac address="52:54:00:6f:27:8e"/>
>   <source bridge="virbr0"/>
>   <target dev="vnet0"/>
>   <model type="rtl8139"/>
>   <alias name="net0"/>
>   <address type="pci" domain="0x0000" bus="0x02" slot="0x01"
> function="0x0"/>
> </interface>
>
> I cloned the vm (with a differe mac address).
>
> <interface type="bridge">
>   <mac address="52:54:00:25:c7:4a"/>
>   <source bridge="virbr0"/>
>   <model type="rtl8139"/>
>   <address type="pci" domain="0x0000" bus="0x02" slot="0x01"
> function="0x0"/>
> </interface>
>
> When I run the first vm I notice it gets and IP from DHCP and this is my
> first surprise.
> It gets the ip 192.168.122.159.
> 1) What is acting as DHCP server?
>
> brctl show
> bridge name     bridge id               STP enabled     interfaces
> virbr0          8000.52540037d765       yes             virbr0-nic
>                                                        vnet0
>
> If i run the second guest, it receive the very same ip!
> As result, I get an ip conflict.
>
> arping -d 192.168.122.159
> ARPING 192.168.122.159
> 42 bytes from 52:54:00:25:c7:4a (192.168.122.159): index=0 time=397.843
> usec
> 42 bytes from 52:54:00:6f:27:8e (192.168.122.159): index=1 time=671.916
> usec
>
> 2) I notice the rbidge has the ip 192.168.122.1. Is possible to configure
> it? I also notice I can't edit bridge settings from the kde netwrk manager.
>
> 3) I expected to have by network card as member of the bridge
>
> 2: eno2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state
> DOWN mode DEFAULT group default qlen 1000
>    link/ether 98:e7:43:9a:fe:09 brd ff:ff:ff:ff:ff:ff
>    altname enp0s31f6
>
> but it's not.
> How shall I add it?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20220708/e8448161/attachment.htm>


More information about the virt-tools-list mailing list