11

I'm trying to reinstall an Ubuntu server to 18.04.

I discovered that 18.04 uses Netplan, and I'm having trouble creating a bond interface using this.

Updated configuration:

############# BOND - VLAN ##################
network:
    version: 2
    renderer: networkd
    ethernets:
        switchports:
            match: {name: "ens*"}
    bonds:
        bond0:
            interfaces: [switchports]
            parameters:
                mode: balance-alb
    vlans:
        inet:
            id: 50
            link: bond0
            addresses: [X.X.X.X/24]
            gateway4: X.X.X.252
            dhcp4: no
            nameservers:
                addresses: [X.X.X.33]

It seems that I shouldn't have 2 match statements and ens* in a single statement did it - I'll clean this up when I get it to work..

I have installed ifenslave & bridge-utils as someone suggested this, still nothing.

Also I've enabled the bonding module in /etc/modules.

My original issue was that the interface was in UP state, but I could only ping the interface itself, not anything else.

I couldn't get this to work, so I ended up renaming the /etc/netplan/<name>.yaml file and installing ifupdown.

If anyone has a clue as to why this didn't work, I'll be happy to know :)

  • Your second example looks right. Could you give more details on why it's not working for you? You kind of left off what was wrong with it. And to back up a little, if you don't mind just editing your whole question to remove what you tried earlier, and just give the problem, current configuration, that would help others out when reading. :) – dpb May 11 '18 at 3:40
  • Its still the same issue, I can see the bond interface with up address in ip addr, but I can't ping anything other than itself.. I'll clean up my post when I'm at a pc 😊 – moxom May 12 '18 at 4:02
4

I installed Ubuntu Server and surprising enough it asked me if I wanted to to setup bonding.

This is the yaml file that was setup:

Location: /etc/netplan/ 

File Name: 50-cloud-init.yaml

File Structure:

# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disablecloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
   bonds:
       bond0:
           addresses: []
           interfaces:
           - enp5s4
           - enp5s9
           - enp64s0
           parameters:
               lacp-rate: fast
               mode: 802.3ad
               transmit-hash-policy: layer2
       ethernets:
           enp5s4:
               addresses: []
               dhcp4: false
               dhcp6: false
           enp5s9:
               addresses: []
               dhcp4: false
               dhcp6: false
           enp64s0:
               addresses: []
               dhcp4: false
               dhcp6: false
version: 2

I will update this as I learn more about the newer style of networking configuration in Ubuntu.

UPDATE

To change this to be static address do the following:

 sudo mv /etc/netplan/50-cloud-init.yaml /etc/netplan/50-cloud-init.old

!Note! Your default *.yaml file name may be different.

 sudo touch /etc/netplan/my-network-file.yaml

!Note! You can name your config file whatever you want just make sure it ends with .yaml

sudo nano /etc/netplan/my-network-file.yaml

In this file (my-network-file.yaml) copy from above and append the following changes:

network:
   bonds:
       bond0:
           addresses: [192.168.0.8/24]
           gateway4: 192.168.0.1
           nameservers:
              addresses: [8.8.8.8,8.8.4.4]
           interfaces:
           - enp5s4
           - enp5s9
           - enp64s0

Make sure you change the ip addresses to reflect your network. After this, I just rebooted the machine and my new network config was loaded and working.

You can alternatively use:

sudo netplan apply

This should apply the new config without a need for a reboot.

Side Note You may want to observe spacing and not use tabs as this may cause issues with your config file.

If you're unsure of your network interfaces you can do one of the following

lshw -class network 

or

ip link show

Hope this helps!

| improve this answer | |
  • Interesting! It seems everyone that post solutions for netplan problems has a different approach. I've just posted this question, and I'd like to give your approach a try, but your answer seems a bit ambiguous in one respect: In this file copy from above and append the following changes: Do you mind showing a complete file listing, and the file name? – Seamus Mar 31 at 8:45
  • I updated my answer. the file I am referencing is the new network yaml file that you create. i.e (my-network-file.yaml) – Kyle Coots Mar 31 at 23:10
  • That's very helpful - thanks, and +1. Just so I'm clear on this one point: Does netplan aggregate/combine .yaml files? In other words, if I put the bonds section in one yaml file, and the ethernets section in another yaml file (both in /etc/netplan) - would the system combine these files to get a "total" configuration? – Seamus Mar 31 at 23:27
  • I am not sure on that. I would venture to say no but I could be wrong. – Kyle Coots Apr 1 at 0:05
  • 1
    I've gotten an answer to my question. I wanted to share that with you as the questions are related, and there's info that you may wish to incorporate in your answer. Specifically, two items: 1. You should never have to run cloud-init again on an Ubuntu Server system installed with the new server installer and 2. the messages in /etc/netplan pointing you to /etc/cloud/cloud.cfg.d are an error that we're working on correcting. This Netplan business has promise, but there's much conflicting information "out there". – Seamus Apr 1 at 21:25

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.