Score:3

How many VLAN bridges does netplan support?

hu flag

in a lab network I try to virtualize a router that routes between multiple VLANs [2]. The Hypervisor runs Ubuntu 20.04.

However, I can only setup 21 VLAN bridges on the Hypervisor. As soon as I add the 22th VLAN bridge (or more), netplan throws an error [1].

That leads me to wonder, if netplan only supports a limited number of VLAN bridges?

[Edit]: This is on netplan 0.102-0ubuntu1~20.04.2. Systemd unit output below [3]. More interesting is the journald output, which contains, among others, the line: Could not enumerate addresses: No buffer space available [4].

[1] The error when trying to apply >21 VLAN bridges:

root@test1:~# netplan apply
Job for systemd-networkd.service failed because the control process exited with error code.
See "systemctl status systemd-networkd.service" and "journalctl -xe" for details.
Traceback (most recent call last):
  File "/usr/sbin/netplan", line 23, in <module>
    netplan.main()
  File "/usr/share/netplan/netplan/cli/core.py", line 50, in main
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 264, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 55, in run
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 264, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 236, in command_apply
    utils.systemctl_networkd('start', sync=True, extra_services=netplan_wpa + netplan_ovs)
  File "/usr/share/netplan/netplan/cli/utils.py", line 131, in systemctl_networkd
    subprocess.check_call(command)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['systemctl', 'start', 'systemd-networkd.service', 'netplan-ovs-cleanup.service']' returned non-zero exit status 1.

[2] The full netplan config with 30 interfaces:

network:
  version: 2
  renderer: networkd

  ethernets:
    enp1s0:
      dhcp4: no
      dhcp6: no
      addresses:
        - 192.168.0.135/24
      gateway4: 192.168.0.254
      nameservers:
        search:
          - example.com
        addresses:
          - 192.168.0.1
          - 192.168.0.2

  vlans:
    br0.1:
      id: 1
      link: br0
    br0.2:
      id: 2
      link: br0
    br0.3:
      id: 3
      link: br0
    br0.4:
      id: 4
      link: br0
    br0.5:
      id: 5
      link: br0
    br0.6:
      id: 6
      link: br0
    br0.7:
      id: 7
      link: br0
    br0.8:
      id: 8
      link: br0
    br0.9:
      id: 9
      link: br0
    br0.10:
      id: 10
      link: br0
    br0.11:
      id: 11
      link: br0
    br0.12:
      id: 12
      link: br0
    br0.13:
      id: 13
      link: br0
    br0.14:
      id: 14
      link: br0
    br0.15:
      id: 15
      link: br0
    br0.16:
      id: 16
      link: br0
    br0.17:
      id: 17
      link: br0
    br0.18:
      id: 18
      link: br0
    br0.19:
      id: 19
      link: br0
    br0.20:
      id: 20
      link: br0
    br0.21:
      id: 21
      link: br0
    br0.22:
      id: 22
      link: br0
    br0.23:
      id: 23
      link: br0
    br0.24:
      id: 24
      link: br0
    br0.25:
      id: 25
      link: br0
    br0.26:
      id: 26
      link: br0
    br0.27:
      id: 27
      link: br0
    br0.28:
      id: 28
      link: br0
    br0.29:
      id: 29
      link: br0

  bridges:
    br0:
      interfaces:
        - enp1s0
      macaddress: 54:52:00:00:51:14
      dhcp4: no
      dhcp6: no
      addresses:
        - 192.168.0.249/24
      gateway4: 192.168.0.254
      nameservers:
        search:
          - example.com
        addresses:
          - 192.168.0.1
          - 192.168.0.2
      #parameters:
      #  forward-delay: 0
      #  stp: false
    br1:
      interfaces:
        - br0.1
      macaddress: 54:52:01:00:00:14
      dhcp4: no
      dhcp6: no
      addresses:
        - 10.1.0.14/24
      gateway4: 10.1.0.254
      nameservers:
        search:
          - example.com
        addresses:
          - 192.168.0.1
          - 192.168.0.2
    br2:
      interfaces:
        - br0.2
      dhcp4: no
      dhcp6: no
    br3:
      interfaces:
        - br0.3
      dhcp4: no
      dhcp6: no
    br4:
      interfaces:
        - br0.4
      dhcp4: no
      dhcp6: no
    br5:
      interfaces:
        - br0.5
      dhcp4: no
      dhcp6: no
    br6:
      interfaces:
        - br0.6
      dhcp4: no
      dhcp6: no
    br7:
      interfaces:
        - br0.7
      dhcp4: no
      dhcp6: no
    br8:
      interfaces:
        - br0.8
      dhcp4: no
      dhcp6: no
    br9:
      interfaces:
        - br0.9
      dhcp4: no
      dhcp6: no
    br10:
      interfaces:
        - br0.10
      macaddress: 54:52:20:00:00:01
      dhcp4: no
      dhcp6: no
      addresses:
        - 10.10.0.1/24
      gateway4: 10.10.0.254
      nameservers:
        search:
          - example.com
        addresses:
          - 192.168.0.1
          - 192.168.0.2
    br11:
      interfaces:
        - br0.11
      dhcp4: no
      dhcp6: no
    br12:
      interfaces:
        - br0.12
      dhcp4: no
      dhcp6: no
    br13:
      interfaces:
        - br0.13
      dhcp4: no
      dhcp6: no
    br14:
      interfaces:
        - br0.14
      dhcp4: no
      dhcp6: no
    br15:
      interfaces:
        - br0.15
      dhcp4: no
      dhcp6: no
    br16:
      interfaces:
        - br0.16
      dhcp4: no
      dhcp6: no
    br17:
      interfaces:
        - br0.17
      dhcp4: no
      dhcp6: no
    br18:
      interfaces:
        - br0.18
      dhcp4: no
      dhcp6: no
    br19:
      interfaces:
        - br0.19
      dhcp4: no
      dhcp6: no
    br20:
      interfaces:
        - br0.20
      dhcp4: no
      dhcp6: no
    br21:
      interfaces:
        - br0.21
      dhcp4: no
      dhcp6: no
    br22:
      interfaces:
        - br0.22
      dhcp4: no
      dhcp6: no
    br23:
      interfaces:
        - br0.23
      dhcp4: no
      dhcp6: no
    br24:
      interfaces:
        - br0.24
      dhcp4: no
      dhcp6: no
    br25:
      interfaces:
        - br0.25
      dhcp4: no
      dhcp6: no
    br26:
      interfaces:
        - br0.26
      dhcp4: no
      dhcp6: no
    br27:
      interfaces:
        - br0.27
      dhcp4: no
      dhcp6: no
    br28:
      interfaces:
        - br0.28
      dhcp4: no
      dhcp6: no
    br29:
      interfaces:
        - br0.29
      dhcp4: no
      dhcp6: no

[3] systemd output:

root@test1:~# systemctl status systemd-networkd.service
● systemd-networkd.service - Network Service
     Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled-runtime; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2021-06-07 16:17:15 CEST; 2s ago
       Docs: man:systemd-networkd.service(8)
    Process: 63803 ExecStart=/lib/systemd/systemd-networkd (code=exited, status=1/FAILURE)
   Main PID: 63803 (code=exited, status=1/FAILURE)
      Error: 105 (Kein Hauptspeicher für den Puffer verfügbar)

Jun 07 16:17:15 test1 systemd[1]: systemd-networkd.service: Main process exited, code=exited, status=1/FAILURE
Jun 07 16:17:15 test1 systemd[1]: systemd-networkd.service: Failed with result 'exit-code'.
Jun 07 16:17:15 test1 systemd[1]: Failed to start Network Service.
Jun 07 16:17:15 test1 systemd[1]: systemd-networkd.service: Scheduled restart job, restart counter is at 5.
Jun 07 16:17:15 test1 systemd[1]: Stopped Network Service.
Jun 07 16:17:15 test1 systemd[1]: systemd-networkd.service: Start request repeated too quickly.
Jun 07 16:17:15 test1 systemd[1]: systemd-networkd.service: Failed with result 'exit-code'.
Jun 07 16:17:15 test1 systemd[1]: Failed to start Network Service.

[4] Error log:

root@test1:~# journalctl -xe
Jun 07 16:17:14 test1 systemd[1]: Reloading.
Jun 07 16:17:14 test1 systemd[1]: Stopping Network Service...
-- Subject: A stop job for unit systemd-networkd.service has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A stop job for unit systemd-networkd.service has begun execution.
--
-- The job identifier is 3254.
Jun 07 16:17:14 test1 systemd[1]: Condition check resulted in OpenVSwitch configuration for cleanup being skipped.
-- Subject: A start job for unit netplan-ovs-cleanup.service has finished successfully
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit netplan-ovs-cleanup.service has finished successfully.
--
-- The job identifier is 3259.
Jun 07 16:17:14 test1 systemd[1]: Condition check resulted in OpenVSwitch configuration for cleanup being skipped.
-- Subject: A start job for unit netplan-ovs-cleanup.service has finished successfully
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit netplan-ovs-cleanup.service has finished successfully.
--
-- The job identifier is 3262.
Jun 07 16:17:14 test1 systemd[1]: systemd-networkd.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit systemd-networkd.service has successfully entered the 'dead' state.
Jun 07 16:17:14 test1 systemd[1]: Starting Network Service...
-- Subject: A start job for unit systemd-networkd.service has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit systemd-networkd.service has begun execution.
--
-- The job identifier is 3256.
Jun 07 16:17:14 test1 systemd-networkd[63781]: br9: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br8: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br7: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br6: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br5: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br4: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br3: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br29: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br28: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br27: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br26: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br25: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br24: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br23: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br22: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br21: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br20: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br2: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br19: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br18: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br17: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br16: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br15: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br14: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br13: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br12: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br11: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br10: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br1: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: br0: netdev ready
Jun 07 16:17:14 test1 systemd-networkd[63781]: Could not enumerate addresses: No buffer space available
Jun 07 16:17:14 test1 systemd[1]: systemd-networkd.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit systemd-networkd.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Jun 07 16:17:14 test1 systemd[1]: systemd-networkd.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit systemd-networkd.service has entered the 'failed' state with result 'exit-code'.
Jun 07 16:17:14 test1 systemd[1]: Failed to start Network Service.
-- Subject: A start job for unit systemd-networkd.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit systemd-networkd.service has finished with a failure.
--
-- The job identifier is 3256 and the job result is failed.
Jun 07 16:17:14 test1 systemd[1]: systemd-networkd.service: Scheduled restart job, restart counter is at 1.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit systemd-networkd.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Jun 07 16:17:14 test1 systemd[1]: Condition check resulted in OpenVSwitch configuration for cleanup being skipped.
-- Subject: A start job for unit netplan-ovs-cleanup.service has finished successfully
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit netplan-ovs-cleanup.service has finished successfully.
--
-- The job identifier is 3268.

(and a bunch of repeated outputs).

Lukas Maerdian avatar
cn flag
That's an interesting failure... When I try to reproduce it on Ubuntu Focal (20.04), using netplan.io 0.102 it works just fine, though. I can apply that netplan config [2] without any issue. Could you show the output of `systemctl status systemd-networkd.service` and `journalctl -xe` to see how it is failing? Also what version of netplan are you using (`dpkg - l | grep netplan.io`)?
apalacheno avatar
hu flag
Hi Lukas, have you tried 'apply'ing the netplan config multiple times? For me it sometimes works for the first time, but after another instance of "netplan apply", the mentioned error occurs (or after a reboot, after which the machine isn't reachable anymore). I've updated my original post with the requested information.
Score:2
hu flag

To answer my own question: I guess I've been struck by this bug from 2019: https://github.com/systemd/systemd/issues/14417.

As a workaround, enabling and starting the systemd-networkd socket seems to mitigate this issue for now:

systemctl enable systemd-networkd.socket
systemctl start systemd-networkd.socket

Initial testing suggests that this is a viable solution that also survives restarts. I'll continue testing this issue and mark this answer as solved for now.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.