NM backend does not accept "scope: link" routes

Bug #1949761 reported by Lukas Märdian
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
netplan.io (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned
Hirsute
Fix Released
Undecided
Unassigned
Impish
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
The NetworkManager snap (using the libnetplan YAML backend) makes use of the
"link" routing scope in certain situations, which is represented by an empty or
unspecified gateway/next_hop field in the keyfile definition (e.g.
"route3=2.2.2.2/7", "route4=3.3.3.3/6,0.0.0.0,4", "route3=4:5:6:7:8:9:0:1/63,,5)
We need to make sure netplan is able to read and write such routing information.

[Test Plan]
In addition to runing & passing the full set of unit- and integration-tests
(that contains new tests to check for this regression), as described in
https://wiki.ubuntu.com/NetplanUpdates we want to run the following commands
to make sure the 'netplan try' command is working properly:

$ mkdir -p tmp/etc/netplan
$ cat tmp/etc/netplan/test.yaml
network:
  renderer: NetworkManager
  ethernets:
    eth0:
      addresses: [1.2.3.4/24, fe20::3/16]
      routes:
      - to: 2.2.2.2/7
        scope: link
      - to: 3.3.3.3/6
        scope: link
        metric: 4
      - to: 4:5:6:7:8:9:0:1/63
        scope: link
        metric: 5
$ /usr/lib/netplan/generate -r tmp/
$ cat tmp/run/NetworkManager/system-connections/netplan-eth0.nmconnection | grep "route.="

=> Make sure it generated the "scope: link" routes with empty/missing gateway.

autopkgtest logs:
* Impish:
https://git.launchpad.net/~slyon/+git/files/tree/LP1949104/impish_amd64.log
https://git.launchpad.net/~slyon/+git/files/tree/LP1949104/impish_arm64.log
https://git.launchpad.net/~slyon/+git/files/tree/LP1949104/impish_armhf.log
https://git.launchpad.net/~slyon/+git/files/tree/LP1949104/impish_ppc64el.log
https://git.launchpad.net/~slyon/+git/files/tree/LP1949104/impish_s390x.log
* Hirsute:
https://git.launchpad.net/~slyon/+git/files/tree/LP1949104/hirsute_amd64.log
https://git.launchpad.net/~slyon/+git/files/tree/LP1949104/hirsute_arm64.log
https://git.launchpad.net/~slyon/+git/files/tree/LP1949104/hirsute_armhf.log
https://git.launchpad.net/~slyon/+git/files/tree/LP1949104/hirsute_ppc64el.log
https://git.launchpad.net/~slyon/+git/files/tree/LP1949104/hirsute_s390x.log
* Focal:
https://git.launchpad.net/~slyon/+git/files/tree/LP1949104/focal_amd64.log
https://git.launchpad.net/~slyon/+git/files/tree/LP1949104/focal_arm64.log
https://git.launchpad.net/~slyon/+git/files/tree/LP1949104/focal_armhf.log
https://git.launchpad.net/~slyon/+git/files/tree/LP1949104/focal_ppc64el.log
https://git.launchpad.net/~slyon/+git/files/tree/LP1949104/focal_s390x.log

[Where problems could occur]
This upload touches netplan's keyfile parser and keyfile generator, if anything
goes wrong it could impact the NetworkManager snap (using the libnetplan YAML
backend & keyfile parser) and the netplan generator itself in cases where the
NetworkManager backend/renderer is used.

[Other Info]
The full set of autopkgtest logs will be attached after the upload is accepted
into -proposed and the tests have been run on the official autopkgtest.u.c
infrastructure.

=== Original Description ===

NetworkManager keyfiles allows to specify "scope: link" routes, by leaving the gateway/next_hop field unspecified, e.g.:

route3=2.2.2.2/7
route4=3.3.3.3/6,0.0.0.0,4

route3=4:5:6:7:8:9:0:1/63,::,5

To keep compatibility, netplan needs to be able to accept "scope: link" routes for the NM backend and render the keyfile accordingly.

Lukas Märdian (slyon)
description: updated
Steve Langasek (vorlon)
Changed in netplan.io (Ubuntu Jammy):
status: New → Fix Committed
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Lukas, or anyone else affected,

Accepted netplan.io into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/netplan.io/0.103-0ubuntu5~20.04.3 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, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in netplan.io (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed verification-needed-focal
Changed in netplan.io (Ubuntu Impish):
status: New → Fix Committed
tags: added: verification-needed-impish
Revision history for this message
Steve Langasek (vorlon) wrote :

Hello Lukas, or anyone else affected,

Accepted netplan.io into impish-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/netplan.io/0.103-0ubuntu7.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, what testing has been performed on the package and change the tag from verification-needed-impish to verification-done-impish. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-impish. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Steve Langasek (vorlon) wrote :

Hello Lukas, or anyone else affected,

Accepted netplan.io into hirsute-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/netplan.io/0.103-0ubuntu5~21.04.3 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, what testing has been performed on the package and change the tag from verification-needed-hirsute to verification-done-hirsute. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-hirsute. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in netplan.io (Ubuntu Hirsute):
status: New → Fix Committed
tags: added: verification-needed-hirsute
Lukas Märdian (slyon)
description: updated
Revision history for this message
Lukas Märdian (slyon) wrote (last edit ):

I've tested netplan.io 0.103-0ubuntu7.1 from impish-proposed and attached the autopkgtest logs to the bug description, according to https://wiki.ubuntu.com/NetplanUpdates.

The netplan generator command was run successfully, producing correct "scope: link" routes with empty gateway/next_hop:

root@sru-ii:~# dpkg -l | grep netplan
ii libnetplan0:amd64 0.103-0ubuntu7.1 amd64 YAML network configuration abstraction runtime library
ii netplan.io 0.103-0ubuntu7.1 amd64 YAML network configuration abstraction for various backends

root@sru-ii:~# mkdir -p tmp/etc/netplan
root@sru-ii:~# cat tmp/etc/netplan/test.yaml
network:
  renderer: NetworkManager
  ethernets:
    eth0:
      addresses: [1.2.3.4/24, fe20::3/16]
      routes:
      - to: 2.2.2.2/7
        scope: link
      - to: 3.3.3.3/6
        scope: link
        metric: 4
      - to: 4:5:6:7:8:9:0:1/63
        scope: link
        metric: 5root@sru-ii:~# /usr/lib/netplan/generate -r tmp/
root@sru-ii:~# cat tmp/run/NetworkManager/system-connections/netplan-eth0.nmconnection | grep "route.="
route1=2.2.2.2/7
route2=3.3.3.3/6,,4
route1=4:5:6:7:8:9:0:1/63,,5

tags: added: verification-done-impish
removed: verification-needed-impish
Revision history for this message
Lukas Märdian (slyon) wrote :

I've tested netplan.io 0.103-0ubuntu5~21.04.3 from hirsute-proposed.

The netplan generator command was run successfully, producing correct "scope: link" routes with empty gateway/next_hop:

root@sru-hh:~# dpkg -l | grep netplan
ii libnetplan0:amd64 0.103-0ubuntu5~21.04.3 amd64 YAML network configuration abstraction runtime library
ii netplan.io 0.103-0ubuntu5~21.04.3 amd64 YAML network configuration abstraction for various backends

root@sru-hh:~# mkdir -p tmp/etc/netplan
root@sru-hh:~# vim tmp/etc/netplan/test.yaml
root@sru-hh:~# cat tmp/etc/netplan/test.yaml
network:
  renderer: NetworkManager
  ethernets:
    eth0:
      addresses: [1.2.3.4/24, fe20::3/16]
      routes:
      - to: 2.2.2.2/7
        scope: link
      - to: 3.3.3.3/6
        scope: link
        metric: 4
      - to: 4:5:6:7:8:9:0:1/63
        scope: link
        metric: 5
root@sru-hh:~# /usr/lib/netplan/generate -r tmp/
root@sru-hh:~# cat tmp/run/NetworkManager/system-connections/netplan-eth0.nmconnection | grep "route.="
route1=2.2.2.2/7
route2=3.3.3.3/6,,4
route1=4:5:6:7:8:9:0:1/63,,5

tags: added: verification-done-hirsute
removed: verification-needed-hirsute
Revision history for this message
Lukas Märdian (slyon) wrote :

I've tested netplan.io 0.103-0ubuntu5~20.04.3 from focal-proposed.

The netplan generator command was run successfully, producing correct "scope: link" routes with empty gateway/next_hop:

root@sru-ff:~# dpkg -l | grep netplan
ii libnetplan0:amd64 0.103-0ubuntu5~20.04.3 amd64 YAML network configuration abstraction runtime library
ii netplan.io 0.103-0ubuntu5~20.04.3 amd64 YAML network configuration abstraction for various backends

root@sru-ff:~# mkdir -p tmp/etc/netplan
root@sru-ff:~# vim tmp/etc/netplan/test.yaml
root@sru-ff:~# cat tmp/etc/netplan/test.yaml
network:
  renderer: NetworkManager
  ethernets:
    eth0:
      addresses: [1.2.3.4/24, fe20::3/16]
      routes:
      - to: 2.2.2.2/7
        scope: link
      - to: 3.3.3.3/6
        scope: link
        metric: 4
      - to: 4:5:6:7:8:9:0:1/63
        scope: link
        metric: 5
root@sru-ff:~# /usr/lib/netplan/generate -r tmp/
root@sru-ff:~# cat tmp/run/NetworkManager/system-connections/netplan-eth0.nmconnection | grep "route.="
route1=2.2.2.2/7
route2=3.3.3.3/6,,4
route1=4:5:6:7:8:9:0:1/63,,5

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

This bug was fixed in the package netplan.io - 0.103-0ubuntu7.1

---------------
netplan.io (0.103-0ubuntu7.1) impish; urgency=medium

  [ Nicolas Bock ]
  * d/p/0001-Add-support-for-additional-Link-options-225-LP-17717.patch:
    - Add offload configuration options.
      (LP: #1771740)
  * Add d/p/partial-d4884cfd40e1e33540b274371c3272df6595d22c.patch:
    - Partial application of d4884cfd40e1e33540b274371c3272df6595d22c in order
      preserve ABI compatibility for future updates.

  [ Lukas Märdian ]
  * Add d/p/0010-parse-nm-Handle-missing-gateway-in-keyfile-routes-ke.patch
    (LP: #1949761)
  * Fix regression in 'netplan try' (LP: #1949104)
    + d/p/lp1949104/cli-apply-initialize-self.state-LP-1949104-243.patch
    + d/p/lp1949104/tests-regressions-make-netplan_try-autopkgtest-more-.patch

 -- Lukas Märdian <email address hidden> Fri, 05 Nov 2021 14:44:08 +0100

Changed in netplan.io (Ubuntu Impish):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for netplan.io has completed successfully and the package is now being 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
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netplan.io - 0.103-0ubuntu5~21.04.3

---------------
netplan.io (0.103-0ubuntu5~21.04.3) hirsute; urgency=medium

  [ Nicolas Bock ]
  * d/p/0001-Add-support-for-additional-Link-options-225-LP-17717.patch:
    - Add offload configuration options.
      (LP: #1771740)
  * Add d/p/partial-d4884cfd40e1e33540b274371c3272df6595d22c.patch:
    - Partial application of d4884cfd40e1e33540b274371c3272df6595d22c in order
      preserve ABI compatibility for future updates.

  [ Lukas Märdian ]
  * Add d/p/0010-parse-nm-Handle-missing-gateway-in-keyfile-routes-ke.patch
    (LP: #1949761)
  * Fix regression in 'netplan try' (LP: #1949104)
    + d/p/lp1949104/cli-apply-initialize-self.state-LP-1949104-243.patch
    + d/p/lp1949104/tests-regressions-make-netplan_try-autopkgtest-more-.patch

 -- Lukas Märdian <email address hidden> Fri, 05 Nov 2021 15:18:41 +0100

Changed in netplan.io (Ubuntu Hirsute):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netplan.io - 0.103-0ubuntu5~20.04.3

---------------
netplan.io (0.103-0ubuntu5~20.04.3) focal; urgency=medium

  [ Nicolas Bock ]
  * d/p/0001-Add-support-for-additional-Link-options-225-LP-17717.patch:
    - Add offload configuration options.
      (LP: #1771740)
  * Add d/p/partial-d4884cfd40e1e33540b274371c3272df6595d22c.patch:
    - Partial application of d4884cfd40e1e33540b274371c3272df6595d22c in order
      preserve ABI compatibility for future updates.

  [ Lukas Märdian ]
  * Add d/p/0010-parse-nm-Handle-missing-gateway-in-keyfile-routes-ke.patch
    (LP: #1949761)
  * Fix regression in 'netplan try' (LP: #1949104)
    + d/p/lp1949104/cli-apply-initialize-self.state-LP-1949104-243.patch
    + d/p/lp1949104/tests-regressions-make-netplan_try-autopkgtest-more-.patch

 -- Lukas Märdian <email address hidden> Fri, 05 Nov 2021 15:15:57 +0100

Changed in netplan.io (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netplan.io - 0.103-0ubuntu9

---------------
netplan.io (0.103-0ubuntu9) jammy; urgency=medium

  [ Lukas Märdian ]
  * Add an upstream patch for glib 2.70 compatibility
  * Add d/p/0010-parse-nm-Handle-missing-gateway-in-keyfile-routes-ke.patch
    (LP: #1949761)
  * Fix regression in 'netplan try' (LP: #1949104)
    + d/p/lp1949104/cli-apply-initialize-self.state-LP-1949104-243.patch
    + d/p/lp1949104/tests-regressions-make-netplan_try-autopkgtest-more-.patch

  [ Andrej Shadura ]
  * Explicitly depend on glib 2.70

 -- Lukas Märdian <email address hidden> Fri, 05 Nov 2021 09:14:58 +0100

Changed in netplan.io (Ubuntu Jammy):
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.