support for ipv4 link-local addressing

Bug #1771704 reported by Steve Langasek
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Netplan
Fix Released
Medium
Unassigned
netplan.io (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
Ubuntu users who make use of IPv4 link-local addresses.

[Test case]
1) Add 'link-local: [ ipv4 ]' to the netplan configuration.
2) Run 'sudo netplan apply'

[Regression Potential]
Enabling link local means additional addresses are available on the system, usually in the form "169.254.XXX.XXX". This is, in effect, a potential security issue if it is enabled on untrusted networks (it gives systems a fairly well known, discoverable IP address as attack surface). This is not considered a regression from previous releases of Ubuntu given that avahi has been available on desktop, with the same potential issue. The availability of extra addresses might however mean that the system is considered online or reachable via the additonal addresses earlier than previously possible, which may lead to confusion for the user.

---

Per https://bugs.launchpad.net/ubuntu/+source/avahi/+bug/1717983, link-local address support was previously handled via integration between avahi-autoipd and dhclient. systemd-networkd does not invoke dhclient. It also has direct support for configuring link-local ipv4 addresses. But this support is not enabled by default.

It should be possible for a system configured via netplan to make use of link-local ipv4 addresses, without needing to configure systemd-networkd directly.

Historically we do not turn on link-local ipv4 support automatically on servers (avahi-autoipd not installed by default), and we use link-local addresses only as a fallback when dhcp gives no response. So this should likely not be enabled by default, but instead be exposed as an additional configuration option in netplan yaml.

Revision history for this message
Steve Langasek (vorlon) wrote :
tags: added: id-5afcc87c960c0f29bc4856ad
Steve Langasek (vorlon)
Changed in netplan:
status: New → In Progress
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netplan.io - 0.39

---------------
netplan.io (0.39) cosmic; urgency=medium

  * New upstream release:
    - Allow link-local addresses to be configured. (LP: #1771704)
    - Forces bridges with no addresses to be brought online. (LP: #1736975)

 -- Mathieu Trudel-Lapierre <email address hidden> Mon, 16 Jul 2018 08:15:05 -0400

Changed in netplan.io (Ubuntu):
status: New → Fix Released
description: updated
Changed in netplan:
status: In Progress → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Steve, or anyone else affected,

Accepted netplan.io into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/netplan.io/0.40~18.04.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-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. 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 Bionic):
status: New → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Steve, or anyone else affected,

Accepted netplan.io into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/netplan.io/0.40.1~18.04.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-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. 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
Mathieu Trudel-Lapierre (cyphermox) wrote :

root@harmless-perch:~# dpkg -l netplan.io | grep ii
ii netplan.io 0.40.1~18.04.1 amd64 YAML network configuration abstraction for various backends

Marking verfication-done:

I have checked that the excerpt:

link-local: [ ipv4 ]

(or ipv6)

Is accepted in netplan.io configuration files, and leads to the addition of a link-local address of the right type by systemd-networkd:

root@harmless-perch:~# ip addr show eth0
4: eth0@if5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:16:3e:28:64:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 169.254.230.104/16 brd 169.254.255.255 scope link eth0
       valid_lft forever preferred_lft forever
    inet 10.249.129.212/24 brd 10.249.129.255 scope global dynamic eth0
       valid_lft 3514sec preferred_lft 3514sec
    inet6 fd42:e082:20ba:6e5d:216:3eff:fe28:6402/64 scope global dynamic mngtmpaddr noprefixroute
       valid_lft 3178sec preferred_lft 3178sec
    inet6 fe80::216:3eff:fe28:6402/64 scope link
       valid_lft forever preferred_lft forever

tags: added: verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Daniel Axtens (daxtens) wrote :

Hi,

I added this to my netplan-config-tester and it's turned up a couple of issues with NetworkManager.

1) If a static IPv4 address is specified and link-local: [ipv4] is specified, there is no link-local address added. The documentation doesn't make this clear; it only refers to DHCP conflicting with link-local.

network:
  ethernets:
    ens7:
      addresses: [16.16.250.1/22]
      link-local: [ipv4]
      renderer: NetworkManager
  version: 2

ubuntu@netplan2:~$ sudo ip a flush dev ens7
ubuntu@netplan2:~$ sudo ip l set dev ens7 down
ubuntu@netplan2:~$ sudo netplan apply
ubuntu@netplan2:~$ sleep 15 # give LL addresses time to be set up
ubuntu@netplan2:~$ ip a show dev ens7
9: ens7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 52:54:00:b4:02:6e brd ff:ff:ff:ff:ff:ff
    inet 16.16.250.1/22 brd 16.16.251.255 scope global noprefixroute ens7
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:feb4:26e/64 scope link
       valid_lft forever preferred_lft forever

This is doubly wrong: there's not IPv4 LL address and there is an IPv6 LL address. Which leads me to bug 2...

2) With NM, link-local: [ipv4] and link-local: [] don't disable a IPv6 LL address.

If you modify the config file above to have link-local: [] and repeat the test, you still get an IPv6 link-local address.

I don't know if you want to gate the backport on this working/being documented correctly or if you'd prefer this to go through for now while we get it fixed upstream. Let me know.

Regards,
Daniel

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

I think we should not block the SRU of the netplan that allows users to declare their intended network config. There will be some work to get the backends to catch up, and that's ok.

Revision history for this message
Daniel Axtens (daxtens) wrote : Re: [Bug 1771704] Re: support for ipv4 link-local addressing

Hi Steve,

No worries, that sounds fair enough. I will file the bugs as separate
issues in the next few days then.

Regards,
Daniel

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Steve, or anyone else affected,

Accepted netplan.io into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/netplan.io/0.40.1~18.04.2 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-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. 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.

tags: added: verification-needed verification-needed-bionic
removed: verification-done-bionic
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Verification done on bionic with netplan.io 0.40.1~18.04.2:

I have checked that with ipv4 link-local enabled as per the use-case, an ipv4 link-local address is correctly set up by systemd-networkd as requested by the netplan config.

ubuntu@nice-baboon:~$ sudo vi /etc/netplan/50-cloud-init.yaml
ubuntu@nice-baboon:~$ sudo netplan --debug apply
cat /** (generate:1270): DEBUG: 18:23:59.386: Processing input file /etc/netplan/50-cloud-init.yaml..
** (generate:1270): DEBUG: 18:23:59.386: starting new processing pass
** (generate:1270): DEBUG: 18:23:59.387: ens3: setting default backend to 1
** (generate:1270): DEBUG: 18:23:59.387: Generating output files..
** (generate:1270): DEBUG: 18:23:59.387: NetworkManager: definition ens3 is not for us (backend 1)
DEBUG:netplan generated networkd configuration exists, restarting networkd
DEBUG:no netplan generated NM configuration exists
eDEBUG:ens3 not found in {}
DEBUG:Merged config:
network:
  bonds: {}
  bridges: {}
  ethernets:
    ens3:
      addresses:
      - 10.3.21.29/20
      gateway4: 10.3.16.1
      link-local:
      - ipv4
      match:
        macaddress: 52:54:00:4d:3e:84
      mtu: 1500
      nameservers:
        addresses:
        - 10.3.21.25
        search:
        - cloud.cyphermox.net
  vlans: {}
  wifis: {}

DEBUG:device lo operstate is unknown, not changing
DEBUG:device ens3 operstate is up, not changing
DEBUG:{}
DEBUG:netplan triggering .link rules for lo
DEBUG:netplan triggering .link rules for ens3
tubuntu@nice-baboon:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 52:54:00:4d:3e:84 brd ff:ff:ff:ff:ff:ff
    inet 169.254.4.84/16 brd 169.254.255.255 scope link ens3
       valid_lft forever preferred_lft forever
    inet 10.3.21.29/20 brd 10.3.31.255 scope global ens3
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fe4d:3e84/64 scope link
       valid_lft forever preferred_lft forever

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

This bug was fixed in the package netplan.io - 0.40.1~18.04.2

---------------
netplan.io (0.40.1~18.04.2) bionic; urgency=medium

  * Fix typo breaking rename on 'netplan apply'. (LP: #1770082)

netplan.io (0.40.1~18.04.1) bionic; urgency=medium

  * Backport netplan 0.40.1 to 18.04. (LP: #1793309)

netplan.io (0.40.1) cosmic; urgency=medium

  * tests/generate.py: use random.sample() instead of random.choices() to
    better support older pythons.
  * Deal gracefully with empty files on 'netplan apply' (LP: #1795343)

netplan.io (0.40) cosmic; urgency=medium

  * New upstream release:
    - networkd: route source is PreferredSource= not From=
    - Improve NetworkManager error reporting on unrenderable routes.
    - Don't render ipv4 dns-search unless we have an ipv4 address.
      (LP: #1786726)
    - Set permissive umask on networkd .network, .link and .netdev files
      (LP: #1736965, LP: #1768560)
    - Fix support for link-scope routes. (LP: #1747455)
    - Update man pages for deletion of replug code.
    - Spell Gratuitous ARP correctly and make it work. (LP: #1756701)
    - Many typo fixes for documentation. (LP: #1783940)
    - Various build system fixes.
    - Fix integration tests:
      - iproute2 output changes for link-scope routes
      - fix stability of networkd igmp-resend test
      - fix manual_addresses test now that networkd lists ~. domain
    - Deduplicate code for parsing interface options
    - Add support for optional-addresses.

netplan.io (0.39) cosmic; urgency=medium

  * New upstream release:
    - Allow link-local addresses to be configured. (LP: #1771704)
    - Forces bridges with no addresses to be brought online. (LP: #1736975)

netplan.io (0.38) cosmic; urgency=medium

  * New upstream release:
    - Write udev .rules files to /run/udev/rules.d to enforce interface
      renaming. (LP: #1770082)
    - Don't traceback for 'netplan ip leases' when iface is not managed or
      doesn't DHCP (LP: #1768823)
    - Fix duplicate "/" path separator in error messages (LP: #1771440)
    - Fix incorrect terminal reset in 'netplan try' on Ctrl-C. (LP: #1768798)
    - Updated doc entries: mtu, fix fwmark->mark, cleanup optional.
      (LP: #1768783)
    - Added documentation validation at build.
    - Added configuration example for multi-ip interfaces.
  * tests/integration.py: fix test_eth_and_bridge autopkg test harder.
  * debian/control:
    - Add iproute2 to Depends.
    - Add python3-netifaces to Depends, Build-Depends.

 -- Mathieu Trudel-Lapierre <email address hidden> Mon, 22 Oct 2018 15:02:30 -0400

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

Steve Langasek (vorlon)
Changed in netplan.io (Ubuntu Bionic):
status: Fix Released → Fix Committed
Revision history for this message
Adam Conrad (adconrad) wrote : Please test proposed package

Hello Steve, or anyone else affected,

Accepted netplan.io into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/netplan.io/0.40.1~18.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 and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. 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.

tags: added: verification-needed verification-needed-bionic
removed: verification-done-bionic
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Resetting the tags to verification-done as per the discussion in https://bugs.launchpad.net/netplan/+bug/1770082/comments/95.

The SRU had been rolled back due to a regression that needed to be fixed, but we still consider the previous verification to be valid.

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

This bug was fixed in the package netplan.io - 0.40.1~18.04.3

---------------
netplan.io (0.40.1~18.04.3) bionic; urgency=medium

  * Fix idempotency in renaming: bond members should be exempt from rename, as
    they may all share a single MAC for the bond device. (LP: #1802322)
  * tests/integration.py: add test designed to catch the above regression.

netplan.io (0.40.1~18.04.2) bionic; urgency=medium

  * Fix typo breaking rename on 'netplan apply'. (LP: #1770082)

netplan.io (0.40.1~18.04.1) bionic; urgency=medium

  * Backport netplan 0.40.1 to 18.04. (LP: #1793309)

netplan.io (0.40.1) cosmic; urgency=medium

  * tests/generate.py: use random.sample() instead of random.choices() to
    better support older pythons.
  * Deal gracefully with empty files on 'netplan apply' (LP: #1795343)

netplan.io (0.40) cosmic; urgency=medium

  * New upstream release:
    - networkd: route source is PreferredSource= not From=
    - Improve NetworkManager error reporting on unrenderable routes.
    - Don't render ipv4 dns-search unless we have an ipv4 address.
      (LP: #1786726)
    - Set permissive umask on networkd .network, .link and .netdev files
      (LP: #1736965, LP: #1768560)
    - Fix support for link-scope routes. (LP: #1747455)
    - Update man pages for deletion of replug code.
    - Spell Gratuitous ARP correctly and make it work. (LP: #1756701)
    - Many typo fixes for documentation. (LP: #1783940)
    - Various build system fixes.
    - Fix integration tests:
      - iproute2 output changes for link-scope routes
      - fix stability of networkd igmp-resend test
      - fix manual_addresses test now that networkd lists ~. domain
    - Deduplicate code for parsing interface options
    - Add support for optional-addresses.

netplan.io (0.39) cosmic; urgency=medium

  * New upstream release:
    - Allow link-local addresses to be configured. (LP: #1771704)
    - Forces bridges with no addresses to be brought online. (LP: #1736975)

netplan.io (0.38) cosmic; urgency=medium

  * New upstream release:
    - Write udev .rules files to /run/udev/rules.d to enforce interface
      renaming. (LP: #1770082)
    - Don't traceback for 'netplan ip leases' when iface is not managed or
      doesn't DHCP (LP: #1768823)
    - Fix duplicate "/" path separator in error messages (LP: #1771440)
    - Fix incorrect terminal reset in 'netplan try' on Ctrl-C. (LP: #1768798)
    - Updated doc entries: mtu, fix fwmark->mark, cleanup optional.
      (LP: #1768783)
    - Added documentation validation at build.
    - Added configuration example for multi-ip interfaces.
  * tests/integration.py: fix test_eth_and_bridge autopkg test harder.
  * debian/control:
    - Add iproute2 to Depends.
    - Add python3-netifaces to Depends, Build-Depends.

 -- Mathieu Trudel-Lapierre <email address hidden> Wed, 21 Nov 2018 14:42:59 -0500

Changed in netplan.io (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Sakthi Nathiarasan (sakthi66) wrote :

HI, There is a problem here. If we are not setting any IPv4 address, by default it is setting IPV4 link-local. Which shouldn't be the case.

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 1771704] Re: support for ipv4 link-local addressing

On Wed, Jan 20, 2021 at 08:41:34AM -0000, Sakthi Nathiarasan wrote:
> HI, There is a problem here. If we are not setting any IPv4 address, by
> default it is setting IPV4 link-local. Which shouldn't be the case.

Do you have the avahi-autoipd package installed? This may not be coming
from netplan.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer https://www.debian.org/
<email address hidden> <email address hidden>

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.