<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - systemd-networkd: VLAN on bond fails due to incorrect order of enslavement"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=76077">76077</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>systemd-networkd: VLAN on bond fails due to incorrect order of enslavement
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>malte@malte.homeip.net
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Trying to setup VLAN on top of a bond, systemd-networkd attempts to create the
VLAN links before the bond has any slaves.  This is rejected by the kernel:

Mar 12 13:45:57 jmbvirt04 systemd[1]: Starting Network Service...
Mar 12 13:45:57 jmbvirt04 systemd-udevd[4529]: Could not apply link config to
lan
Mar 12 13:45:57 jmbvirt04 systemd-networkd[4552]: lan: could not enslave:
Operation not supported
Mar 12 13:45:57 jmbvirt04 systemd[1]: Started Network Service.
Mar 12 13:45:57 jmbvirt04 systemd-networkd[4552]: lan: failed
Mar 12 13:45:57 jmbvirt04 kernel: 8021q: VLANs not supported on lan


If the bond is taken out of the picture (VLAN directly on one of the
interfaces), the VLAN is setup properly.
If systemd-networkd is started with the VLAN=... line in 00-lan.network
commented out, the bond is brought up fine.  If systemd-networkd is then
restarted with the VLAN=... line commented in again, the VLAN is setup fine as
well.
But when both bonding and VLAN are to be set up from scratch in one go, the
ordering is broken.

Happens on Gentoo with both 210 and 211.

Configuration:

===== 00-lan.netdev
[NetDev]
Name=lan
Kind=bond

===== 00-lan.network
[Match]
Name=lan

[Network]
VLAN=mgmt.hosts

===== 01-mgmt.hosts.netdev
[NetDev]
Name=mgmt.hosts
Kind=vlan

[VLAN]
Id=20

===== 01-mgmt.hosts.network
[Match]
Name=mgmt.hosts

[Network]
Address=10.0.20.4/24
Gateway=10.0.20.254

===== 99-bond-slaves.network
[Match]
Name=en*

[Network]
Bond=lan</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>