0

I have made this yaml for a 4 nic bond and a static IP but I need to add four VLANs to the bond. The VLANs are 77, 88, 99, 333 could someone help me with this config? I also use the configuration for a KVM bridge with br0 and need that to still work.

This current yaml works but just need to add the VLANs.

https://gist.githubusercontent.com/R...nager-all.yaml

network:
    bridges:
        br0:
            addresses:
            - 10.0.77.2/24
            dhcp4: false
            gateway4: 10.0.77.1
            nameservers:
                addresses:
                - 10.0.77.1
                - 8.8.8.8
            interfaces:
                - bond0
    bonds:
        bond0:
            interfaces:
            - eno1
            - eno2
            - eno3
            - eno4
            parameters:
                mode: balance-xor
    ethernets:
        eno1:
            addresses: []
            dhcp4: false
            dhcp6: false
        eno2:
            addresses: []
            dhcp4: false
            dhcp6: false
        eno3:
            addresses: []
            dhcp4: false
            dhcp6: false
        eno4:
            addresses: []
            dhcp4: false
            dhcp6: false
  • Your link is not valid. – heynnema Jun 1 at 14:47
0

This is the netplan file I would start out with. I am assuming vlan77 (from 10.0.77.0/24) is the native and the bond is a trunk. I also assume you want the VMs to be located in different vlans:

#/etc/netplan/01-networkd-vlan-bond.yml
network:
  version: 2
  renderer: networkd
  ethernets:
       eno1:
            addresses: []
            dhcp4: false
            dhcp6: false
        eno2:
            addresses: []
            dhcp4: false
            dhcp6: false
        eno3:
            addresses: []
            dhcp4: false
            dhcp6: false
        eno4:
            addresses: []
            dhcp4: false
            dhcp6: false
  bonds:
      bond0:
          interfaces: [eno1, eno2, eno3, eno4]
          addresses: [10.0.77.2/24]
          gateway4: 10.0.77.1
          nameservers:
              addresses: [10.0.77.1,8.8.8.8]
              search: [domain.tld]
          dhcp4: false
          dhcp6: false
          parameters:
              mode: balance-xor

  bridges:
      br0:
          interfaces: [ bond0 ]
          dhcp4: false
          dhcp6: false
          parameters:
              forward-delay: 0
              stp: true
      br88:
          interfaces: [ vlan.88 ]
          dhcp4: false
          dhcp6: false
          addresses: []
          parameters:
              forward-delay: 0
              stp: true
      br99:
          interfaces: [ vlan.99 ]
          dhcp4: false
          dhcp6: false
          addresses: []
          parameters:
              forward-delay: 0
              stp: false
      br333:
          interfaces: [ vlan.333 ]
          dhcp4: false
          dhcp6: false
          addresses: []
          parameters:
              forward-delay: 0
              stp: true

  vlans:
      vlan.88:
          id: 88
          link: bond0
          dhcp4: false
          dhcp6: false
      vlan.99:
          id: 99
          link: bond0
          dhcp4: false
          dhcp6: false
      vlan.333:
          id: 333
          link: bond0
          dhcp4: false
          dhcp6: false

This is all assuming vlan77 is the native vlan so if that isn't the case, some modifications would need to be made. Since vlan77 is native you don't need a separate entry for vlan77.

I assign all IP addresses via my dhcp servers so my setup is slightly different and I've noticed on some networks I've had to have both the bond and the native vlan set to receive dhcp addressing so you may need to put the same IP address info in both the bond and the native bridge, which, in your case, would look like:

  br0:
      interfaces: [ bond0 ]
      dhcp4: false
      dhcp6: false
      addresses: [10.0.77.2/24]
      gateway4: 10.0.77.1
      nameservers:
          addresses: [10.0.77.1,8.8.8.8]
          search: [domain.tld]
      parameters:
          forward-delay: 0
          stp: true

But you shouldn't need this as it is not documented and really doesn't make much sense.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.