1

I hope you can help me.

I'm trying to setup a network bridge adapter with Netplan to use it with my KVM guest machine. I followed a couple of tutorial, including the one on Netplan.io and so far none of these worked.

As of right now, my configure looks like this :

network:
  ethernets:
    eno1:
      dhcp4: no
      dhcp6: no

version: 2 renderer: networkd bridges: br0: interfaces: [eno1] addresses: [10.x.x.x/23] routes: - to : default via: 10.x.x.1 nameservers: search: [ x.com ] addresses: [ x.x.x.x, x.x.x.x ] parameters: stp: true forward-delay: 4 dhcp4: no dhcp6: no

My static IP address works fine when I use eno1 . After configuring bridge for eno1 , the bridge is coming up but no communication happening in and out. Not able to ping the gateway or any IP after creating bridge br0.

Screen image

Serg
  • 824
  • 7
  • 14
  • Try reviewing this. The only obvious thing I see is the link-local: [ ] line. From your screen shot, br0 does not have the same MAC as eno1, but as far I know it should. – Doug Smythies Jul 01 '22 at 14:06
  • The example I usually use from https://netplan.io/examples#configuring-network-bridges used dhcp and works fine. I've started with that example and modified it step by step to be more like yours. The following works for me fine (I had no NS to configure) and might server as comparison material for you => https://paste.ubuntu.com/p/vfthX2ZRSQ/ – Christian Ehrhardt Jul 04 '22 at 07:14

2 Answers2

3

I've been through this exact same scenario the past 2 days and couldn't make any sense of it. I had identical configuration running on a Ubuntu 20.04 VM and couldn't make it work on 22.04.

It turns out for me the critical piece that was missing was setting the macaddress for the bridge to the MAC address of the interface I was bridging.

As soon as I did that it started working after I don't know how many failed attempts with different configurations.

network:
  ethernets:
    eno1:
      dhcp4: no
      dhcp6: no

version: 2 renderer: networkd bridges: br0: interfaces: [eno1] addresses: [10.x.x.x/23] routes: - to : default via: 10.x.x.1 nameservers: search: [ x.com ] addresses: [ x.x.x.x, x.x.x.x ] macaddress: 34:73:5a:a1:dc:4c parameters: stp: true forward-delay: 4 dhcp4: no dhcp6: no

I hope it helps you as well!

Sven
  • 31
3

sven You can also change the macaddresspolicy in /usr/lib/systemd/network/99-default.link

It has been changed in 22.04 to persistent changing this to none option will revert the previous behaviour so the bridge will clone the first interface attached mac.

Check: https://www.freedesktop.org/software/systemd/man/systemd.link.html#Examples

  • This is not how to direct a comment to a user. It should be @Mohammed Boukhalfa the symbol before the name. – David Sep 10 '22 at 15:42
  • somewhere I read that names on stackexchange are not unique so we should use the profile link .. not sure at the end even when you tagged I just received a normal comment notification nothing related to mentioning me – Mohammed Boukhalfa Sep 12 '22 at 05:43