public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH ifupdown2] patch: fix bond mac address at boot.
@ 2023-09-01  9:12 Alexandre Derumier
  2023-09-13 18:10 ` DERUMIER, Alexandre
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alexandre Derumier @ 2023-09-01  9:12 UTC (permalink / raw)
  To: pve-devel

since systemd v241, like for bridge, the bond mac is setup
randomly at boot, instead inherit from first slave.

Then, on next ifreload, ifupdown2 was already fixing it,
but with an down/up of the bond (with potentials impact on the network).

This patch have been sent upstream:
https://github.com/CumulusNetworks/ifupdown2/pull/270

This patch is applying fine too for ifupdown2 for proxmox7

---
 debian/patches/series                         |  1 +
 .../patches/upstream/0001-fix-bond-mac.patch  | 28 +++++++++++++++++++
 2 files changed, 29 insertions(+)
 create mode 100644 debian/patches/upstream/0001-fix-bond-mac.patch

diff --git a/debian/patches/series b/debian/patches/series
index 1ff8dd4..cff704f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ pve/0009-gvgeb-fix-python-interpreter-shebang.patch
 upstream/0001-add-ipv6-slaac-support-inet6-auto-accept_ra.patch
 upstream/0001-addons-ethtool-add-rx-vlan-filter.patch
 upstream/0001-scheduler-import-traceback.patch
+upstream/0001-fix-bond-mac.patch
\ No newline at end of file
diff --git a/debian/patches/upstream/0001-fix-bond-mac.patch b/debian/patches/upstream/0001-fix-bond-mac.patch
new file mode 100644
index 0000000..79688ac
--- /dev/null
+++ b/debian/patches/upstream/0001-fix-bond-mac.patch
@@ -0,0 +1,28 @@
+From 062c3a6707b22cf7494bbf0ccb8ea6559dc334df Mon Sep 17 00:00:00 2001
+From: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
+Date: Fri, 1 Sep 2023 09:43:05 +0200
+Subject: [PATCH] bond: fix mac-address on create with first slave mac
+
+since systemd v241, bond (like bridge), are create with a random mac
+instead their first slave.
+
+We already fixing it for bond on reload, but not at create
+
+Than mean that on first reload, we'll always ifdown/ifup interface and change mac.
+---
+ ifupdown2/addons/bond.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ifupdown2/addons/bond.py b/ifupdown2/addons/bond.py
+index 74d2cab5..5e77e1b0 100644
+--- a/ifupdown2/addons/bond.py
++++ b/ifupdown2/addons/bond.py
+@@ -884,7 +884,7 @@ def _up(self, ifaceobj, ifaceobj_getfunc=None):
+                 ifaceobj_getfunc,
+             )
+ 
+-            if not self.bond_mac_mgmt or not link_exists or ifaceobj.get_attr_value_first("hwaddress"):
++            if not self.bond_mac_mgmt or ifaceobj.get_attr_value_first("hwaddress"):
+                 return
+ 
+             # check if the bond mac address is correctly inherited from it's
-- 
2.39.2




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [pve-devel] [PATCH ifupdown2] patch: fix bond mac address at boot.
  2023-09-01  9:12 [pve-devel] [PATCH ifupdown2] patch: fix bond mac address at boot Alexandre Derumier
@ 2023-09-13 18:10 ` DERUMIER, Alexandre
  2023-09-15 14:21 ` [pve-devel] applied: " Thomas Lamprecht
  2023-10-19  8:53 ` [pve-devel] " Thomas Lamprecht
  2 siblings, 0 replies; 7+ messages in thread
From: DERUMIER, Alexandre @ 2023-09-13 18:10 UTC (permalink / raw)
  To: pve-devel

Hi,

is it possible to apply this patch ? (Just to avoid to forget it)

Thanks !

Alexandre

Le vendredi 01 septembre 2023 à 11:12 +0200, Alexandre Derumier a
écrit :
> since systemd v241, like for bridge, the bond mac is setup
> randomly at boot, instead inherit from first slave.
> 
> Then, on next ifreload, ifupdown2 was already fixing it,
> but with an down/up of the bond (with potentials impact on the
> network).
> 
> This patch have been sent upstream:
> https://antiphishing.cetsi.fr/proxy/v3?i=SXVFem5DOGVpUU1rNjdmQuxbAYzjRE578NJDXO0bRW0&r=bWt1djZ5QzcyUms5R1NzatwXz4Bu0iVoewR0TMqOYj2TEaWUEW6ErR0jSEGeptkpQiTgSpOogUpk-nmOcZSjcw&f=Q3ZQNmU2SnpsRFlRbUF3dmj8RjqNbw-iHBi50S-iFw7wq1QYxMyfpOzIpg23W0yvT_m-5a44zDEurFGuVbLSbw&u=https%3A//github.com/CumulusNetworks/ifupdown2/pull/270&k=syJL
> 
> This patch is applying fine too for ifupdown2 for proxmox7
> 
> ---
>  debian/patches/series                         |  1 +
>  .../patches/upstream/0001-fix-bond-mac.patch  | 28
> +++++++++++++++++++
>  2 files changed, 29 insertions(+)
>  create mode 100644 debian/patches/upstream/0001-fix-bond-mac.patch
> 
> diff --git a/debian/patches/series b/debian/patches/series
> index 1ff8dd4..cff704f 100644
> --- a/debian/patches/series
> +++ b/debian/patches/series
> @@ -10,3 +10,4 @@ pve/0009-gvgeb-fix-python-interpreter-shebang.patch
>  upstream/0001-add-ipv6-slaac-support-inet6-auto-accept_ra.patch
>  upstream/0001-addons-ethtool-add-rx-vlan-filter.patch
>  upstream/0001-scheduler-import-traceback.patch
> +upstream/0001-fix-bond-mac.patch
> \ No newline at end of file
> diff --git a/debian/patches/upstream/0001-fix-bond-mac.patch
> b/debian/patches/upstream/0001-fix-bond-mac.patch
> new file mode 100644
> index 0000000..79688ac
> --- /dev/null
> +++ b/debian/patches/upstream/0001-fix-bond-mac.patch
> @@ -0,0 +1,28 @@
> +From 062c3a6707b22cf7494bbf0ccb8ea6559dc334df Mon Sep 17 00:00:00
> 2001
> +From: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
> +Date: Fri, 1 Sep 2023 09:43:05 +0200
> +Subject: [PATCH] bond: fix mac-address on create with first slave
> mac
> +
> +since systemd v241, bond (like bridge), are create with a random mac
> +instead their first slave.
> +
> +We already fixing it for bond on reload, but not at create
> +
> +Than mean that on first reload, we'll always ifdown/ifup interface
> and change mac.
> +---
> + ifupdown2/addons/bond.py | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/ifupdown2/addons/bond.py b/ifupdown2/addons/bond.py
> +index 74d2cab5..5e77e1b0 100644
> +--- a/ifupdown2/addons/bond.py
> ++++ b/ifupdown2/addons/bond.py
> +@@ -884,7 +884,7 @@ def _up(self, ifaceobj, ifaceobj_getfunc=None):
> +                 ifaceobj_getfunc,
> +             )
> + 
> +-            if not self.bond_mac_mgmt or not link_exists or
> ifaceobj.get_attr_value_first("hwaddress"):
> ++            if not self.bond_mac_mgmt or
> ifaceobj.get_attr_value_first("hwaddress"):
> +                 return
> + 
> +             # check if the bond mac address is correctly inherited
> from it's


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [pve-devel] applied: [PATCH ifupdown2] patch: fix bond mac address at boot.
  2023-09-01  9:12 [pve-devel] [PATCH ifupdown2] patch: fix bond mac address at boot Alexandre Derumier
  2023-09-13 18:10 ` DERUMIER, Alexandre
@ 2023-09-15 14:21 ` Thomas Lamprecht
  2023-10-19  8:53 ` [pve-devel] " Thomas Lamprecht
  2 siblings, 0 replies; 7+ messages in thread
From: Thomas Lamprecht @ 2023-09-15 14:21 UTC (permalink / raw)
  To: Proxmox VE development discussion, Alexandre Derumier

Am 01/09/2023 um 11:12 schrieb Alexandre Derumier:
> since systemd v241, like for bridge, the bond mac is setup
> randomly at boot, instead inherit from first slave.
> 
> Then, on next ifreload, ifupdown2 was already fixing it,
> but with an down/up of the bond (with potentials impact on the network).
> 
> This patch have been sent upstream:
> https://github.com/CumulusNetworks/ifupdown2/pull/270
> 
> This patch is applying fine too for ifupdown2 for proxmox7
> 
> ---
>  debian/patches/series                         |  1 +
>  .../patches/upstream/0001-fix-bond-mac.patch  | 28 +++++++++++++++++++
>  2 files changed, 29 insertions(+)
>  create mode 100644 debian/patches/upstream/0001-fix-bond-mac.patch
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [pve-devel] [PATCH ifupdown2] patch: fix bond mac address at boot.
  2023-09-01  9:12 [pve-devel] [PATCH ifupdown2] patch: fix bond mac address at boot Alexandre Derumier
  2023-09-13 18:10 ` DERUMIER, Alexandre
  2023-09-15 14:21 ` [pve-devel] applied: " Thomas Lamprecht
@ 2023-10-19  8:53 ` Thomas Lamprecht
  2023-10-19  9:39   ` DERUMIER, Alexandre
  2023-11-15  6:12   ` DERUMIER, Alexandre
  2 siblings, 2 replies; 7+ messages in thread
From: Thomas Lamprecht @ 2023-10-19  8:53 UTC (permalink / raw)
  To: Proxmox VE development discussion, Alexandre Derumier

Am 01/09/2023 um 11:12 schrieb Alexandre Derumier:
> since systemd v241, like for bridge, the bond mac is setup
> randomly at boot, instead inherit from first slave.
> 
> Then, on next ifreload, ifupdown2 was already fixing it,
> but with an down/up of the bond (with potentials impact on the network).
> 


Hmm, we now got a few reports in the forum that get quite a few
"Received packet on bond0 with own address as source" warnings
after upgrading to ifupdown2 to the version that just ships this
patch here:


https://forum.proxmox.com/threads/kernel-vmbr0-received-packet-on-bond0-with-own-address-as-source-address.133152/#post-597121
https://forum.proxmox.com/threads/vmbr0-received-packet-on-bond0-with-own-address-as-source-address.135044/#post-597283

Seem like the switches send the ECTP loopback packages sometimes
back over the other link due both having the same MAC address,
Wolfgang thinks that shouldn't matter though..

They mention that a downgrade helps so even if this is a switch
(configuration) issue on their side it might not be ideal to regress
here – do you have any idea what's going on?




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [pve-devel] [PATCH ifupdown2] patch: fix bond mac address at boot.
  2023-10-19  8:53 ` [pve-devel] " Thomas Lamprecht
@ 2023-10-19  9:39   ` DERUMIER, Alexandre
  2023-11-15  6:12   ` DERUMIER, Alexandre
  1 sibling, 0 replies; 7+ messages in thread
From: DERUMIER, Alexandre @ 2023-10-19  9:39 UTC (permalink / raw)
  To: pve-devel, t.lamprecht, aderumier

-------- Message initial --------
De: Thomas Lamprecht <t.lamprecht@proxmox.com>
À: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Alexandre Derumier <aderumier@odiso.com>
Objet: Re: [pve-devel] [PATCH ifupdown2] patch: fix bond mac address at
boot.
Date: 19/10/2023 10:53:22

Am 01/09/2023 um 11:12 schrieb Alexandre Derumier:
> since systemd v241, like for bridge, the bond mac is setup
> randomly at boot, instead inherit from first slave.
> 
> Then, on next ifreload, ifupdown2 was already fixing it,
> but with an down/up of the bond (with potentials impact on the
> network).
> 


>>Hmm, we now got a few reports in the forum that get quite a few
>>"Received packet on bond0 with own address as source" warnings
>>after upgrading to ifupdown2 to the version that just ships this
>>patch here:



mmmm, that's strange.
Does it occur only once ? (when ifupdown2 is upgraded && reload it
done?)

Do you known which bond mode is used here ?



BTW, I had send another patch fixing it at systemd level directly (and
fixing another bug)
https://lists.proxmox.com/pipermail/pve-devel/2023-September/059129.html




>>Seem like the switches send the ECTP loopback packages sometimes
>>back over the other link due both having the same MAC address,
>>Wolfgang thinks that shouldn't matter though..

That's strange, because with or without this patch,  both links have
the same mac anyway.  (same random mac generated   vs same mac
inherited from first real interface).

For me, it's look like more a config problem at the physical switch
where no port group/port channel/... 


I don't see any error like this on my network with lacp bond.

(and the current patch is really fixing bugs on reload, where physical
switch can block ports in protection if the mac is switching)













^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [pve-devel] [PATCH ifupdown2] patch: fix bond mac address at boot.
  2023-10-19  8:53 ` [pve-devel] " Thomas Lamprecht
  2023-10-19  9:39   ` DERUMIER, Alexandre
@ 2023-11-15  6:12   ` DERUMIER, Alexandre
  2023-11-15 10:37     ` Thomas Lamprecht
  1 sibling, 1 reply; 7+ messages in thread
From: DERUMIER, Alexandre @ 2023-11-15  6:12 UTC (permalink / raw)
  To: pve-devel, t.lamprecht, aderumier

Hi,

Something definitively wrong with this patch
https://forum.proxmox.com/threads/same-mac-on-all-lacp-bonds-bridges-after-upgrade-proxmox-8.136359/

This forum user is getting mac of his fiber transceiver at
boot...(that's superstange as they shouldn't have a mac address)


I think that it's because it's still doing crap with mac address and
some race can occur.


This patch
https://lists.proxmox.com/pipermail/pve-devel/2023-September/059129.html

should fix it, disabling systemd mac random renaming. (like on
rhel8,fedora et other distro)


and revert the last ifupdown2 patch.


-------- Message initial --------
De: Thomas Lamprecht <t.lamprecht@proxmox.com>
À: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Alexandre Derumier <aderumier@odiso.com>
Objet: Re: [pve-devel] [PATCH ifupdown2] patch: fix bond mac address at
boot.
Date: 19/10/2023 10:53:22

Am 01/09/2023 um 11:12 schrieb Alexandre Derumier:
> since systemd v241, like for bridge, the bond mac is setup
> randomly at boot, instead inherit from first slave.
> 
> Then, on next ifreload, ifupdown2 was already fixing it,
> but with an down/up of the bond (with potentials impact on the
> network).
> 


Hmm, we now got a few reports in the forum that get quite a few
"Received packet on bond0 with own address as source" warnings
after upgrading to ifupdown2 to the version that just ships this
patch here:


https://antiphishing.cetsi.fr/proxy/v3?i=cWdzUmRSM0ZiRHpoUDkxTSw3-
90dQgKDkqmWWemZ6js&r=WXNQOUY5VXRSNUlTdlVTThIwPzZaoDCvq1Kc_09FxyZzKHGZEQ
ETBzOHeMNLlvdN&f=R0pWUVNEaUFuMTBCTlptbqfFzF4TB2H57gw42PegMEHMfdECltiGwe
4Ql2leQkqk&u=https%3A//forum.proxmox.com/threads/kernel-vmbr0-received-
packet-on-bond0-with-own-address-as-source-address.133152/%23post-
597121&k=8YLU
https://antiphishing.cetsi.fr/proxy/v3?i=cWdzUmRSM0ZiRHpoUDkxTSw3-
90dQgKDkqmWWemZ6js&r=WXNQOUY5VXRSNUlTdlVTThIwPzZaoDCvq1Kc_09FxyZzKHGZEQ
ETBzOHeMNLlvdN&f=R0pWUVNEaUFuMTBCTlptbqfFzF4TB2H57gw42PegMEHMfdECltiGwe
4Ql2leQkqk&u=https%3A//forum.proxmox.com/threads/vmbr0-received-packet-
on-bond0-with-own-address-as-source-address.135044/%23post-
597283&k=8YLU

Seem like the switches send the ECTP loopback packages sometimes
back over the other link due both having the same MAC address,
Wolfgang thinks that shouldn't matter though..

They mention that a downgrade helps so even if this is a switch
(configuration) issue on their side it might not be ideal to regress
here – do you have any idea what's going on?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [pve-devel] [PATCH ifupdown2] patch: fix bond mac address at boot.
  2023-11-15  6:12   ` DERUMIER, Alexandre
@ 2023-11-15 10:37     ` Thomas Lamprecht
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Lamprecht @ 2023-11-15 10:37 UTC (permalink / raw)
  To: Proxmox VE development discussion, DERUMIER, Alexandre, aderumier

Hi,

Am 15/11/2023 um 07:12 schrieb DERUMIER, Alexandre:
> and revert the last ifupdown2 patch.

OK, I've done so, thanks!





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-11-15 10:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-01  9:12 [pve-devel] [PATCH ifupdown2] patch: fix bond mac address at boot Alexandre Derumier
2023-09-13 18:10 ` DERUMIER, Alexandre
2023-09-15 14:21 ` [pve-devel] applied: " Thomas Lamprecht
2023-10-19  8:53 ` [pve-devel] " Thomas Lamprecht
2023-10-19  9:39   ` DERUMIER, Alexandre
2023-11-15  6:12   ` DERUMIER, Alexandre
2023-11-15 10:37     ` Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal