loopback addresses disappear after running "netplan apply" multiple times

Bug #1968287 reported by Kazuki Suda
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
netplan.io (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

In `netplan.io` package (`0.104-0ubuntu2~20.04.1`) on Ubuntu 20.04, I ran `netplan apply` command to add addresses to `lo` interface. During the second run of `netplan apply` command, two addresses `127.0.0.1/8` and `::1/128` disappeared from `lo` interface.

I have confirmed that `0.103-0ubuntu5~20.04.6` does not have this issue.

Below are the steps to reproduce this issue.

$ wget https://cloud-images.ubuntu.com/focal/20220404/focal-server-cloudimg-amd64.img
$ sudo qemu-system-x86_64 -vga std -nographic -drive file=focal-server-cloudimg-amd64.img,if=virtio,cache=writeback,discard=ignore,format=qcow2 -m 4096M -smp cpus=4,sockets=4 -serial mon:stdio -boot c -machine type=pc,accel=kvm -fda cloud.img
...
ubuntu@ubuntu:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
ubuntu@ubuntu:~$ uname -a
Linux ubuntu 5.4.0-107-generic #121-Ubuntu SMP Thu Mar 24 16:04:27 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
ubuntu@ubuntu:~$ dpkg -l | grep netplan.io
ii netplan.io 0.104-0ubuntu2~20.04.1 amd64 YAML network configuration abstraction for various backends
ubuntu@ubuntu:~$ ip a show lo
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
ubuntu@ubuntu:~$ cat <<EOL | sudo tee /etc/netplan/60-loopback.yaml >/dev/null
network:
    version: 2
    ethernets:
        lo:
            addresses:
            - 10.193.17.31/32
            match:
                name: lo
EOL
ubuntu@ubuntu:~$ sudo netplan apply && sudo netplan apply
ubuntu@ubuntu:~$ ip a show lo
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 10.193.17.31/32 scope global lo
       valid_lft forever preferred_lft forever

description: updated
description: updated
description: updated
vishnunaini (visred)
Changed in netplan.io (Ubuntu):
status: New → Confirmed
tags: added: focal regression-update
Revision history for this message
Lukas Märdian (slyon) wrote :

IMO it is the expected behavior. When "lo" is defined in the netplan config, netplan is supposed to apply this configuration (i.e. drop the IPs that are not part of the netplan config and apply the new ones).

If this didn't work in 0.103, it must have been a bug in 0.103. Also, I wonder why the IPs are only dropped after running `netplan apply` twice...

Revision history for this message
Kazuki Suda (superbrothers) wrote :

Since the following document states

> but a user can "add" new addresses to the standard loopback interface, lo, in order to have it considered a valid address on the machine as well as for custom routing:

https://netplan.io/examples/#configuring-a-loopback-interface

I believe that the disappearance of addresses such as `127.0.0.1/8` from the loopback address is not the expected behavior.

Revision history for this message
Lukas Märdian (slyon) wrote (last edit ):

Indeed, that documentation is misleading.
It was fixed a while ago: https://github.com/canonical-web-and-design/netplan.io/pull/225

But looks like I need to ask the web-team to actually deploy those changes to http://netplan.io

Revision history for this message
Kazuki Suda (superbrothers) wrote :

I see. If this behavior is intended, please close this issue as this is not a bug.

Lukas Märdian (slyon)
Changed in netplan.io (Ubuntu):
status: Confirmed → Invalid
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.