Unable to set bridge_portpriority with networkd
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Fix Released
|
Medium
|
Dimitri John Ledkov | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Zesty |
Fix Released
|
Medium
|
Dimitri John Ledkov |
Bug Description
[Impact]
* Netplan uses systemd-netword provider to configure all sorts of networking settings
* However, unlike ifupdown, released versions of systemd do not support setting bridgeport priority, aka
`brctl setportprio <bridge> <port> <priority>`
* This prevents full migration from ifupdown to netplan/
* This is proposal to cherrypick this functionality which essentially accepts one more key in the .network units; and send those values via netlink.
[Test Case]
* networkd-test.py is executed as part of autopkgtests that configures a bridge, and sets various valid bridge port priorities and verifies from sysfs that those were correctly set by systemd.
* Alternativey create a bridge .link unit, and specify .network unit for a bridge port and use Priority=4 setting in the [Bridge] section in the said unit to modify bridge port priority.
[Regression Potential]
* This is an upstream cherrypick of functionality that will be included in 234 release. However, since MAAS and netplan target stable releases, I would like to cherrypick this functionality all the way back to xenial. This almost a feature, rather than a bugfix, but it is so small and accompanied by regression testsuite that it is almost a tiny bugfix.
[Other Info]
* Original request to support this feature.
1. root@ubuntu:
Description: Ubuntu Zesty Zapus (development branch)
Release: 17.04
2. root@ubuntu:
systemd:
Installed: 232-18ubuntu1
Candidate: 232-18ubuntu1
Version table:
*** 232-18ubuntu1 500
500 http://
100 /var/lib/
3. Using a networkd config like this:
# cat 10-netplan-
[Match]
MACAddress=
Name=eth1
[Network]
Bridge=br0
LinkLocalAddres
IPv6AcceptRA=no
[Bridge]
Cost=50
Priority=28
% cat /sys/class/
28
4. % cat /sys/class/
32
When using ifupdown and /etc/network/
users are able to specify a bridge port priority:
auto br0
iface br0 inet static
address 192.168.1.1
bridge_ports eth1 eth2
bridge_portprio eth1 28
bridge_portprio eth2 14
Which results in the bridge hook scripts running:
brctl setportprio br0 eth1 28
which is visible via:
/sys/class/
Note, networkd does not mention PortPriority under netdev Bridge section,
however, PathCost is mentioned. It appears networkd is missing an implementation.
ProblemType: Bug
DistroRelease: Ubuntu 17.04
Package: systemd 232-18ubuntu1
ProcVersionSign
Uname: Linux 4.10.0-8-generic x86_64
ApportVersion: 2.20.4-0ubuntu2
Architecture: amd64
Date: Mon Feb 27 17:11:32 2017
Lsusb: Error: command ['lsusb'] failed with exit code 1:
MachineType: QEMU Standard PC (i440FX + PIIX, 1996)
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 04/01/2014
dmi.bios.vendor: SeaBIOS
dmi.bios.version: 1.10.1-1ubuntu1
dmi.chassis.type: 1
dmi.chassis.vendor: QEMU
dmi.chassis.
dmi.modalias: dmi:bvnSeaBIOS:
dmi.product.name: Standard PC (i440FX + PIIX, 1996)
dmi.product.
dmi.sys.vendor: QEMU
CVE References
Changed in systemd (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → Medium |
assignee: | nobody → Dimitri John Ledkov (xnox) |
milestone: | none → ubuntu-17.03 |
Changed in systemd (Ubuntu): | |
status: | Confirmed → In Progress |
description: | updated |
Changed in systemd (Ubuntu Xenial): | |
milestone: | none → ubuntu-16.04.3 |
Changed in systemd (Ubuntu Yakkety): | |
status: | New → In Progress |
no longer affects: | systemd (Ubuntu Yakkety) |
Upstream pull request: /github. com/systemd/ systemd/ pull/5545
https:/
Sample packages with patch applied for zesty: /launchpad. net/~ci- train-ppa- service/ +archive/ ubuntu/ 2541
https:/
How to use:
Similar to bridge port cost, one can set [Bridge] Priority= setting in the .network file for a given ether device, e.g.:
/etc/systemd/ network/ 10-ens3. network
[Match]
Name=ens3
[Bridge]
Priority=33