Ethernet devices have higher metric than wlan or wwan ones

Bug #1639754 reported by Alfonso Sanchez-Beato
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snappy-hwe-snaps
Invalid
Undecided
Unassigned
nplan (Ubuntu)
Fix Released
Undecided
Martin Pitt
Xenial
Fix Released
Undecided
Unassigned
Yakkety
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
In Ubuntu Core, in all supported devices ethernet devices have higher metric than wlan or wwan devices, so packets get routed to the latter always. The metric is 1024, while for instance network-manager assigns these numbers:

ethernet -> 100
wlan -> 600
wwan -> 700

This happens because ethernet devices are managed by default by networkd in ubuntu-core, while wlan and wwan are managed by network-manager if installed. It would make sense to either assign a metric of 100 in networkd configuration file or change network-manager snap so it handles ethernet in all cases when installed.

[Test Case]
 * Set up an ethernet and wifi connection using netplan, and check metrics in "ip route". With the current version they have "1024", with the proposed update the ethernet one will have 100, the wifi one 600.

[Regression Potential]
It could in principle happen that someone relies on the current high metric and this interferes with some custom routing. However, netplan has only been used in snappy on xenial since recently, and there is no other official way to configure routing on snappy than netplan. So in practice this should be very low.

description: updated
description: updated
Revision history for this message
Martin Pitt (pitti) wrote :

Agreed. I'll change the networkd backend to add [DHCP]\nRouteMetric=100 for ethernet and 600 for wlan interfaces, for NM compatibility.

affects: netplan → nplan (Ubuntu)
Changed in nplan (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
status: New → In Progress
Changed in nplan (Ubuntu Xenial):
status: New → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

> change network-manager snap so it handles ethernet in all cases when installed.

FTR, I think this makes sense (independently of aligning the metrics in networkd). It's still confusing to have to use two different sets of tools/APIs to manage your network.

Revision history for this message
Martin Pitt (pitti) wrote :
Changed in nplan (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

SRU uploaded to xenial.

Changed in nplan (Ubuntu Xenial):
status: Triaged → Confirmed
status: Confirmed → In Progress
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nplan - 0.15

---------------
nplan (0.15) zesty; urgency=medium

  * tests/generate.py: Fix PEP-8 error (newly detected by -proposed
    pycodestyle).

 -- Martin Pitt <email address hidden> Wed, 09 Nov 2016 17:12:54 +0100

Changed in nplan (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Alfonso, or anyone else affected,

Accepted nplan into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/nplan/0.14~16.04 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in nplan (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

@brian-murray, verified on xenial/kvm machine with configuration:

$ cat /etc/netplan/00-snapd-config.yaml
network:
  ethernets:
    eth0:
      dhcp4: true
  version: 2

With nplan 0.13~16.04:
$ ip route
default via 10.0.3.1 dev eth0
default via 10.0.3.1 dev eth0 proto dhcp src 10.0.3.223 metric 1024
10.0.3.0/24 dev eth0 proto kernel scope link src 10.0.3.223
10.0.3.1 dev eth0 proto dhcp scope link src 10.0.3.223 metric 1024

With nplan 0.14~16.04:
$ ip route
default via 10.0.3.1 dev eth0
default via 10.0.3.1 dev eth0 proto dhcp src 10.0.3.223 metric 100
10.0.3.0/24 dev eth0 proto kernel scope link src 10.0.3.223
10.0.3.1 dev eth0 proto dhcp scope link src 10.0.3.223 metric 100

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nplan - 0.14~16.04

---------------
nplan (0.14~16.04) xenial; urgency=medium

  * Update to 0.14 for xenial.
  * tests/integration.py: Re-enable search domain check, that fix landed in
    xenial.

nplan (0.14) zesty; urgency=medium

  * tests/generate.py: Introduce macros for commonly expected networkd output
  * networkd: Use NetworkManager compatible DHCP route metrics (LP: #1639754)
  * doc/netplan.md: Fix wrong wifi reference in "br0" example
  * doc/netplan.md: Clarify introduction
  * tests/integration.py: Fix race condition with waiting for networkd

 -- Martin Pitt <email address hidden> Wed, 09 Nov 2016 17:00:31 +0100

Changed in nplan (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote : Update Released

The verification of the Stable Release Update for nplan has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Tony Espy (awe) wrote :

As this has been fixed in netplan, I'm changing the status of the HWE task to Invalid. If this is incorrect, or there's something else we need to do in the NM snap, then feel free to re-open.

Changed in snappy-hwe-snaps:
status: New → Invalid
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Alfonso, or anyone else affected,

Accepted nplan into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/nplan/0.23~16.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in nplan (Ubuntu Yakkety):
status: New → Fix Committed
tags: removed: verification-done
tags: added: verification-needed
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Verification done on yakkety:

ubuntu@loved-bunny:~$ ip route
default via 192.168.253.1 dev ens3 proto dhcp src 192.168.253.9 metric 100
10.10.10.0/24 dev bond0 proto kernel scope link src 10.10.10.1 linkdown
192.168.253.0/24 dev ens3 proto kernel scope link src 192.168.253.9
192.168.253.1 dev ens3 proto dhcp scope link src 192.168.253.9 metric 100

Using nplan 0.23~16.10; the routes have the proper metric.

tags: added: verification-done-yakkety
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nplan - 0.23~16.10.1

---------------
nplan (0.23~16.10.1) yakkety; urgency=medium

  * Backport netplan 0.23 to 16.10. (LP: #1688632)

nplan (0.23) artful; urgency=medium

  * Do not unbind brcmfmac, interface will be gone. (LP: #1696162)

nplan (0.22) artful; urgency=medium

  * Add support for setting a custom MAC address on all device types.
    (LP: #1690388)
  * Improved MAC/vlan integration tests; thanks for Dimitri John Ledkov for the
    changes.

nplan (0.21) artful; urgency=medium

  [ Ryan Harper ]
  * Add support for setting MTU on a device. (LP: #1668693)

  [ Mathieu Trudel-Lapierre ]
  * Don't rebind Atheros AR9271; it would confuse the driver. (LP: #1672740)
  * debian/control: Add Conflicts: against netplan; the network 'plan' daemon.
    Both ship the same /usr/sbin/netplan. (LP: #1665842)

nplan (0.20) zesty; urgency=medium

  * tests/integration.py: increase timeout for integration tests (networkd and
    NetworkManager "wait-online" checks) to account for longer bring-up times
    when dealing with stacked virtual devices.

nplan (0.19) zesty; urgency=medium

  * Add support for unordered definition of network devices: you can now
    specify a virtual devices before their member devices. (LP: #1670495)
  * Allow setting up the STP state for a bridge. (LP: #1665088)
  * Document bond/bridge parameters support. (LP: #1664702)

nplan (0.18) zesty; urgency=medium

  * debian/tests/integration.py: in some cases 'iw reg get' may qualify the
    reg domain results with 'global'; we must not let that trip up tests when
    they are run on Ubuntu infrastructure vs. local tests.

nplan (0.17) zesty; urgency=medium

  * New release:
    - Add support for configuring bonds.
    - Add support for configuring bridges.

nplan (0.16) zesty; urgency=medium

  [ Martin Pitt ]
  * doc/example-config: Adjust "routes:" example.
    It does not make sense to make "routes:" a global thing, they should be
    tied to an interface so that the route is only set when the corresponding
    interface exists and is up, and the config is not split in two parts.
  * doc/netplan.md: Point out that NM does not support globbing (LP: #1631018)

  [ Mathieu Trudel-Lapierre ]
  * Fix coverage for src/netplan to be 100%, and fail if coverage falls below
    that mark again.
  * Add support for specifying routes.

nplan (0.15) zesty; urgency=medium

  * tests/generate.py: Fix PEP-8 error (newly detected by -proposed
    pycodestyle).

nplan (0.14) zesty; urgency=medium

  * tests/generate.py: Introduce macros for commonly expected networkd output
  * networkd: Use NetworkManager compatible DHCP route metrics (LP: #1639754)
  * doc/netplan.md: Fix wrong wifi reference in "br0" example
  * doc/netplan.md: Clarify introduction
  * tests/integration.py: Fix race condition with waiting for networkd

nplan (0.13) zesty; urgency=medium

  [ Jonathan Cave ]
  * Blacklist mwifiex_pcie from rebinds (work around LP: #1630285)

  [ Martin Pitt ]
  * Add support for nameservers (LP: #1626617)

 -- Mathieu Trudel-Lapierre <email address hidden> Tue, 06 Jun 2017 17:25:57 -0700

Changed in nplan (Ubuntu Yakkety):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.