Page MenuHomePhabricator

Rewrite bonding interface in new style XML syntax
Closed, ResolvedPublicFEATURE REQUEST

Description

The following CLI nodes changed:

  • set interfaces ethernet eth0 bond-group 'bond0' has been migrated to set interfaces bonding bond0 member interface eth0

https://vyos.readthedocs.io/en/equuleus/interfaces/bonding.html

Details

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

Event Timeline

c-po changed the task status from Open to In progress.Aug 27 2019, 9:19 AM
c-po claimed this task.
c-po triaged this task as Low priority.
c-po created this task.
c-po changed Difficulty level from Unknown (require assessment) to Hard (possibly days).
runar added a subscriber: runar.Aug 27 2019, 1:11 PM

Improvement suggestion:
set interfaces bonding bond0 hash-policy # defaults to layer2, listing layer2 as an configureable alternative is then redundant. to revert to level2 the user should delete the config entry instead. also update description about using layer2 as a default

@runar If I could offer an alternative, why not require set interfaces bonding bond0 hash-policy to always be specified? The hash policy is not something optional like a tunnel key for GRE, so I feel that this option should be required.

In lines with the same reasoning, since it's a fundamental (and not optional) element, we should require operators to make an explicit decision. It is "more configuration work" but, from my software development days, if you're more expressive it will enhance readability (and understanding) by future maintainers.

runar added a comment.Aug 27 2019, 2:09 PM

It is true that you need a hash-policy, but specifying a hash-policy is optional, if you don't specify it reverts to the kernel default that is layer2..
also defaults should not be listed in the configuration. (because then the configuration will be crowded with all kind of strange things that is a default)

That's why i listed this as an improvement suggestion.

runar added a comment.Aug 27 2019, 2:16 PM

improvement suggestion:

  • remove the use of + in hash-policy names. layer2+3 and layer3+4. this could be replaced with the more used - character, so layer2-3 and layer3-4
  • also add support for encap2-3 and encap3-4hash-policy
c-po added a comment.Aug 27 2019, 3:56 PM

The reason for layer2, layer2+3 and layer3+4 are that those values are directly passed to the kernel, as the pernel expects:

xmit_hash_policy=value

  • 0 or layer2
  • 1 or layer3+4
  • 2 or layer2+3
c-po closed this task as Resolved.Sep 4 2019, 2:38 PM
c-po updated the task description. (Show Details)
c-po set Is it a breaking change? to Perfectly compatible.
c-po added a comment.Sep 4 2019, 2:43 PM

Rewrite was tested using:

set interfaces bonding bond0 address 192.0.2.1/24
set interfaces bonding bond0 description "VyOS bonding"
set interfaces bonding bond0 disable-link-detect
set interfaces bonding bond0 hash-policy layer2+3
set interfaces bonding bond0 ip arp-cache-timeout 86400
set interfaces bonding bond0 mac 00:91:00:00:00:01
set interfaces bonding bond0 mode active-backup
set interfaces bonding bond0 mtu 9000
set interfaces bonding bond0 member interface eth1
set interfaces bonding bond0 member interface eth2
set interfaces bonding bond0 vif-s 100 address 192.168.10.1/24
set interfaces bonding bond0 vif-s 100 description "802.1ad service VLAN 100"
set interfaces bonding bond0 vif-s 100 mtu 1500
set interfaces bonding bond0 vif-s 100 mac 00:91:00:00:00:02
set interfaces bonding bond0 vif-s 100 vif-c 110 address "192.168.110.1/24"
set interfaces bonding bond0 vif-s 100 vif-c 110 description "client VLAN 110"
set interfaces bonding bond0 vif-s 100 vif-c 120 address "192.168.120.1/24"
set interfaces bonding bond0 vif-s 100 vif-c 120 description "client VLAN 120"
set interfaces bonding bond0 vif-s 100 vif-c 130 address "192.168.130.1/24"
set interfaces bonding bond0 vif-s 100 vif-c 130 description "client VLAN 130"
set interfaces bonding bond0 vif 400 address 192.168.40.1/24
set interfaces bonding bond0 vif 400 description "802.1q VLAN 400"
set interfaces bonding bond0 vif 400 mtu 1500
set interfaces bonding bond0 vif 400 mac 00:91:00:00:00:03

or

set interfaces bonding bond0 address 192.0.2.1/24
set interfaces bonding bond0 description ddd
set interfaces bonding bond0 disable-link-detect
set interfaces bonding bond0 hash-policy layer3+4
set interfaces bonding bond0 ip arp-cache-timeout 400
set interfaces bonding bond0 mac 00:0c:29:be:ee:ee
set interfaces bonding bond0 member interface eth1
set interfaces bonding bond0 member interface eth2
set interfaces bonding bond0 mode 802.3ad
set interfaces bonding bond0 mtu 9000
c-po moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.Oct 13 2019, 3:06 PM