Page MenuHomePhabricator

Primary interface for bond not getting configured on VyOS 1.2.0 / 1.2.1
Closed, ResolvedPublic

Description

getting error when trying to set primary interface for existing bond :-
vyos@vyos:~$ show configuration commands | grep bond
set interfaces bonding bond2 hash-policy 'layer2'
set interfaces bonding bond2 mode '802.3ad'
set interfaces bonding bond3 hash-policy 'layer2+3'
set interfaces bonding bond3 mode '802.3ad'
set interfaces ethernet eth1 bond-group 'bond2'
set interfaces ethernet eth2 bond-group 'bond2'
set interfaces ethernet eth3 bond-group 'bond3'

vyos@vyos# set interfaces bonding bond2 primary 'eth1'
[
[ interfaces bonding bond2 primary eth1 ]
eth1 eth2

[ interfaces bonding bond2 primary eth1 ]
sh: line 0: echo: write error: Permission denied

[[interfaces bonding bond2 primary]] failed
Commit failed
[edit]

vyos@vyos:~$ show version
Version: VyOS 1.2.0-rolling+201905140337
Built by: autobuild@vyos.net
Built on: Tue 14 May 2019 03:37 UTC
Build ID:

Architecture: x86_64

Details

Commits
Restricted Diffusion Commit
Restricted Diffusion Commit
Difficulty level
Unknown (require assessment)
Version
1.2.0
Why the issue appeared?
Will be filled on close

Event Timeline

rohitthakur2590 triaged this task as High priority.Jun 27 2019, 5:35 AM
rohitthakur2590 created this task.
rohitthakur2590 created this object in space S1 VyOS Public.
pasik added a subscriber: pasik.Jul 2 2019, 3:25 PM
jjakob added a subscriber: jjakob.Jul 4 2019, 11:34 AM

mode 802.3ad doesn't support setting a primary interface.

root@vyos:~# cat /sys/class/net/bond0/bonding/mode 
802.3ad 4
root@vyos:~# cat /sys/class/net/bond0/bonding/slaves 
eth3 eth4 eth2 eth1
root@vyos:~# echo "eth1"> /sys/class/net/bond0/bonding/primary
-bash: echo: write error: Permission denied

The failing line is in https://github.com/vyos/vyatta-cfg-system/blob/cb83db1758822dbd16fa712aa6aab7005d51b154/templates/interfaces/bonding/node.tag/primary/node.def#L6

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/networking/bonding.txt?h=v4.19.57#n729

primary

	A string (eth0, eth2, etc) specifying which slave is the
	primary device.  The specified device will always be the
	active slave while it is available.  Only when the primary is
	off-line will alternate devices be used.  This is useful when
	one slave is preferred over another, e.g., when one slave has
	higher throughput than another.

	The primary option is only valid for active-backup(1),
	balance-tlb (5) and balance-alb (6) mode.

A check should be added to only allow setting primary on active-backup, balance-tlb and balance-alb but I'm not sure how.

GitHub <noreply@github.com> closed this task as Resolved by committing Restricted Diffusion Commit.Jul 18 2019, 11:08 PM
GitHub <noreply@github.com> added a commit: Restricted Diffusion Commit.
GitHub <noreply@github.com> added a commit: Restricted Diffusion Commit.