← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1973724] [NEW] Systemd-networkd generated configuration is wrong when both ipv4 and ipv6 addresses are used

 

Public bug reported:

Hello,

I'm using cloud-init in a proxmox environment, which exposes the
configuration as a /dev/sr0.

The generated network-config looks like this:

```

[root@newgate:~]# more /mnt/*|cat
::::::::::::::
/mnt/meta-data
::::::::::::::
instance-id: 550761acf2ff3ad63bf33cab486c12131f73f405
::::::::::::::
/mnt/network-config
::::::::::::::
version: 1
config:
    - type: physical
      name: eth0
      mac_address: 'ae:98:25:fa:36:9e'
      subnets:
      - type: static
        address: '10.0.0.2'
        netmask: '255.255.255.255'
        gateway: '10.0.0.1'
      - type: static6
        address: '2a01:4f8:10a:19d2::4/64'
        gateway: '2a01:4f8:10a:19d2::2'
    - type: nameserver
      address:
      - '100.100.100.100'
      search:
      - 'rgrunbla.github.beta.tailscale.net'
::::::::::::::
/mnt/user-data
::::::::::::::
#cloud-config
hostname: newgate
manage_etc_hosts: true
ssh_authorized_keys:
  - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDwZm6kUsK/FrgJPzFi5AgvqIIYfy5S/Se4/rZgB4Edx remy@typhoon
chpasswd:
  expire: False
users:
  - default
package_upgrade: true
::::::::::::::
/mnt/vendor-data
::::::::::::::

```

The problem is that the generated systemd-networkd configuration is
wrong. It looks like this:

```

[root@newgate:~]# cat /etc/systemd/network/10-cloud-init-eth0.network
[Match]
MACAddress=ae:98:25:fa:36:9e
Name=eth0

[Network]
DHCP=no
DNS=100.100.100.100
Domains=rgrunbla.github.beta.tailscale.net

[Address]
Address=10.0.0.2/32
Address=2a01:4f8:10a:19d2::4/64

[Route]
Gateway=10.0.0.1
Gateway=2a01:4f8:10a:19d2::2

```

In particular, the systemd-networkd manual says: "As in the [Network]
section. This setting is mandatory. Each [Address] section can contain
one Address= setting".

This results in errors in systemd:

```

[root@newgate:~]# systemctl status systemd-networkd --no-pager --all
● systemd-networkd.service - Network Configuration
     Loaded: loaded (/etc/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
    Drop-In: /nix/store/5bj0s92f35hwc06mgjp9dzc0inncva6d-system-units/systemd-networkd.service.d
             └─overrides.conf
     Active: active (running) since Tue 2022-05-17 07:46:48 UTC; 5min ago
TriggeredBy: ● systemd-networkd.socket
       Docs: man:systemd-networkd.service(8)
   Main PID: 643 (systemd-network)
     Status: "Processing requests..."
         IP: 0B in, 392B out
         IO: 1.6M read, 0B written
      Tasks: 1 (limit: 2354)
     Memory: 2.9M
        CPU: 25ms
     CGroup: /system.slice/systemd-networkd.service
             └─643 /nix/store/9c90b5pmgj1pbdvgnalhldhfcj98p400-systemd-250.4/li…

May 17 07:46:48 newgate systemd[1]: Starting Network Configuration...
May 17 07:46:48 newgate systemd-networkd[643]: /etc/systemd/network/10-cloud-init-eth0.network:12: Address is incompatible, ignoring assignment: 2a01:4f8:10a:19d2::4/64
May 17 07:46:48 newgate systemd-networkd[643]: /etc/systemd/network/10-cloud-init-eth0.network: Gateway= without static address configured. Enabling GatewayOnLink= option.
May 17 07:46:48 newgate systemd-networkd[643]: lo: Link UP
May 17 07:46:48 newgate systemd-networkd[643]: lo: Gained carrier
May 17 07:46:48 newgate systemd-networkd[643]: Enumeration completed
May 17 07:46:48 newgate systemd[1]: Started Network Configuration.
May 17 07:46:48 newgate systemd-networkd[643]: eth0: Link UP
May 17 07:46:48 newgate systemd-networkd[643]: eth0: Gained carrier
May 17 07:46:49 newgate systemd-networkd[643]: eth0: Gained IPv6LL

```

** Affects: cloud-init
     Importance: Undecided
         Status: New

** Attachment added: "cloud-init.tar.gz"
   https://bugs.launchpad.net/bugs/1973724/+attachment/5590258/+files/cloud-init.tar.gz

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1973724

Title:
  Systemd-networkd generated configuration is wrong when both ipv4 and
  ipv6 addresses are used

Status in cloud-init:
  New

Bug description:
  Hello,

  I'm using cloud-init in a proxmox environment, which exposes the
  configuration as a /dev/sr0.

  The generated network-config looks like this:

  ```

  [root@newgate:~]# more /mnt/*|cat
  ::::::::::::::
  /mnt/meta-data
  ::::::::::::::
  instance-id: 550761acf2ff3ad63bf33cab486c12131f73f405
  ::::::::::::::
  /mnt/network-config
  ::::::::::::::
  version: 1
  config:
      - type: physical
        name: eth0
        mac_address: 'ae:98:25:fa:36:9e'
        subnets:
        - type: static
          address: '10.0.0.2'
          netmask: '255.255.255.255'
          gateway: '10.0.0.1'
        - type: static6
          address: '2a01:4f8:10a:19d2::4/64'
          gateway: '2a01:4f8:10a:19d2::2'
      - type: nameserver
        address:
        - '100.100.100.100'
        search:
        - 'rgrunbla.github.beta.tailscale.net'
  ::::::::::::::
  /mnt/user-data
  ::::::::::::::
  #cloud-config
  hostname: newgate
  manage_etc_hosts: true
  ssh_authorized_keys:
    - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDwZm6kUsK/FrgJPzFi5AgvqIIYfy5S/Se4/rZgB4Edx remy@typhoon
  chpasswd:
    expire: False
  users:
    - default
  package_upgrade: true
  ::::::::::::::
  /mnt/vendor-data
  ::::::::::::::

  ```

  The problem is that the generated systemd-networkd configuration is
  wrong. It looks like this:

  ```

  [root@newgate:~]# cat /etc/systemd/network/10-cloud-init-eth0.network
  [Match]
  MACAddress=ae:98:25:fa:36:9e
  Name=eth0

  [Network]
  DHCP=no
  DNS=100.100.100.100
  Domains=rgrunbla.github.beta.tailscale.net

  [Address]
  Address=10.0.0.2/32
  Address=2a01:4f8:10a:19d2::4/64

  [Route]
  Gateway=10.0.0.1
  Gateway=2a01:4f8:10a:19d2::2

  ```

  In particular, the systemd-networkd manual says: "As in the [Network]
  section. This setting is mandatory. Each [Address] section can contain
  one Address= setting".

  This results in errors in systemd:

  ```

  [root@newgate:~]# systemctl status systemd-networkd --no-pager --all
  ● systemd-networkd.service - Network Configuration
       Loaded: loaded (/etc/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
      Drop-In: /nix/store/5bj0s92f35hwc06mgjp9dzc0inncva6d-system-units/systemd-networkd.service.d
               └─overrides.conf
       Active: active (running) since Tue 2022-05-17 07:46:48 UTC; 5min ago
  TriggeredBy: ● systemd-networkd.socket
         Docs: man:systemd-networkd.service(8)
     Main PID: 643 (systemd-network)
       Status: "Processing requests..."
           IP: 0B in, 392B out
           IO: 1.6M read, 0B written
        Tasks: 1 (limit: 2354)
       Memory: 2.9M
          CPU: 25ms
       CGroup: /system.slice/systemd-networkd.service
               └─643 /nix/store/9c90b5pmgj1pbdvgnalhldhfcj98p400-systemd-250.4/li…

  May 17 07:46:48 newgate systemd[1]: Starting Network Configuration...
  May 17 07:46:48 newgate systemd-networkd[643]: /etc/systemd/network/10-cloud-init-eth0.network:12: Address is incompatible, ignoring assignment: 2a01:4f8:10a:19d2::4/64
  May 17 07:46:48 newgate systemd-networkd[643]: /etc/systemd/network/10-cloud-init-eth0.network: Gateway= without static address configured. Enabling GatewayOnLink= option.
  May 17 07:46:48 newgate systemd-networkd[643]: lo: Link UP
  May 17 07:46:48 newgate systemd-networkd[643]: lo: Gained carrier
  May 17 07:46:48 newgate systemd-networkd[643]: Enumeration completed
  May 17 07:46:48 newgate systemd[1]: Started Network Configuration.
  May 17 07:46:48 newgate systemd-networkd[643]: eth0: Link UP
  May 17 07:46:48 newgate systemd-networkd[643]: eth0: Gained carrier
  May 17 07:46:49 newgate systemd-networkd[643]: eth0: Gained IPv6LL

  ```

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1973724/+subscriptions



Follow ups