Page MenuHomePhabricator

Bonded interfaces get updated with incorrect hw-id in config.
Needs testing, NormalPublicBUG

Description

When eth1 and eth2 are bonded, both hw-id entries are occasionally set to the same MAC in the config, causing eth2 to not function on the next reboot.

Where does VyOS look to get the MAC? At least with r8169, there appears to be no way to pull the original mac after the interface is bonded or the mac is changed.

Made this temp fix so the router boots correctly.
vyos-preconfig-bootup.script:
sed -i.bak '/00:e0:4c:68:0a/d' /config/config.boot

Details

Difficulty level
Hard (possibly days)
Version
1.2.0-rolling+201808021639
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible

Event Timeline

mb300sd created this task.Aug 7 2018, 2:48 PM
syncer triaged this task as Low priority.Sep 1 2018, 2:55 PM
pasik added a subscriber: pasik.Oct 1 2018, 9:51 AM
syncer assigned this task to hagbard.Feb 8 2019, 12:09 AM
syncer raised the priority of this task from Low to Normal.
hagbard changed the task status from Open to Confirmed.May 6 2019, 9:34 PM
hagbard changed the task status from Confirmed to On hold.Sep 4 2019, 10:26 PM

@mb300sd can you please test with the latest rolling image and see if the issue still exists?

@hagbard I no longer have the hardware the issue was found on, or anything else with identical interfaces to bond at the moment.

No worries, I checked it out, the issue still persists but is not easily fixable.

c-po added a subscriber: c-po.Sep 5 2019, 4:18 PM

As the bonding interface has been completely rewritten this should not be an issue as I do not touch underlaying interface MAC addresses

hagbard changed the task status from On hold to In progress.Sep 5 2019, 4:47 PM
hagbard set Is it a breaking change? to Perfectly compatible.

@c-po vyos config does touch it via a perl script. I have a patch ready today for it.

To reproduce:

set interfaces bonding bond0 address '10.100.100.1/24'
set interfaces bonding bond0 member interface 'eth2'
set interfaces bonding bond0 member interface 'eth0'
set interfaces bonding bond0 mode 'round-robin'

Save and reboot.

c-po added a comment.Sep 5 2019, 5:43 PM

Huh? Which perl script?

hagbard added a comment.EditedSep 5 2019, 6:13 PM
/opt/vyatta/sbin/vyatta-interfaces.pl

Has nothing to do with your rewrite, it is the legacy code which sets up the ethernet interfaces. Bond runs first, after that comes ethernet and changes the mac address of the bond member interface and that's the issue.

So there are 2 issues as I found out, I fixed one so far. `/opt/vyatta/sbin/vyatta-interfaces.pl``` has been fixed, if it's called with a bonding interface it doesn't care about hw-id as long as it's a bond member, otherwise the legacy code just continues as before.
That helps with config changes and a cold boot, reboot however brings in another issue. Before the system goes down it compares mac addresses and sorts them. bond is still active and 2 eth interface have the same mac which confuses `/lib/udev/vyatta_net_name```

/run/udev/log/vyatta-net-name.coldplug:

Thu Sep  5 19:34:42 2019: lookup eth2 08:00:27:05:c4:22
Thu Sep  5 19:34:43 2019: use hw-id 08:00:27:05:c4:22 in config mapped to 'eth2' <- that was eth0, a bond member interface which won't be found now anymore
Thu Sep  5 19:34:43 2019: lookup eth1 08:00:27:34:8d:72
Thu Sep  5 19:34:43 2019: use hw-id 08:00:27:34:8d:72 in config mapped to 'eth1'
Thu Sep  5 19:34:43 2019: lookup eth0 08:00:27:05:c4:22
Thu Sep  5 19:34:43 2019: use hw-id 08:00:27:05:c4:22 in config mapped to 'eth2'
Thu Sep  5 19:34:43 2019: lookup eth3 08:00:27:b9:3b:e2
Thu Sep  5 19:34:43 2019: use hw-id 08:00:27:b9:3b:e2 in config mapped to 'eth3'
hagbard changed Difficulty level from Unknown (require assessment) to Hard (possibly days).Sep 5 2019, 9:38 PM
hagbard changed the task status from In progress to On hold.Sep 6 2019, 6:44 PM

Confirmed, same issue in 1.2.2

to test the syntax is a bit different:

 set interfaces bonding bond0 address '10.100.100.1/24'
set interfaces bonding bond0 hash-policy 'layer2'
set interfaces bonding bond0 mode 'round-robin'
set interfaces ethernet eth0 bond-group 'bond0'
set interfaces ethernet eth2 bond-group 'bond0'

Then call reboot and eth0 will be cone.

Fri Sep  6 18:48:34 2019: lookup eth2 08:00:27:2d:3b:c9
Fri Sep  6 18:48:34 2019: use hw-id 08:00:27:2d:3b:c9 in config mapped to 'eth2' <-- that was eth0
Fri Sep  6 18:48:34 2019: lookup eth0 08:00:27:2d:3b:c9
Fri Sep  6 18:48:34 2019: use hw-id 08:00:27:2d:3b:c9 in config mapped to 'eth2'
Fri Sep  6 18:48:34 2019: lookup eth3 08:00:27:74:f7:14
hagbard changed the task status from On hold to In progress.Sep 6 2019, 7:03 PM
hagbard changed the task status from In progress to Confirmed.
hagbard added a project: VyOS 1.2 Crux.
hagbard changed the task status from Confirmed to In progress.Sep 11 2019, 5:16 PM
syncer changed the task status from In progress to Needs testing.Sat, Nov 16, 11:44 PM
syncer reassigned this task from hagbard to Dmitry.
syncer edited projects, added VyOS 1.2 Crux (VyOS 1.2.4); removed VyOS 1.2 Crux.
syncer added a subscriber: hagbard.