Understand how bridge works

Valerio Pachera sirio81 at gmail.com
Mon Jun 27 13:59:45 UTC 2022


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/20220627/67a78385/attachment.htm>


More information about the virt-tools-list mailing list