Score:0

Ubuntu 20.04 - networking down after reboot - netplan config issue?

in flag
k10

I have a server with a bonded interface. Here is the netplan file:

# cat /etc/netplan/01-netcfg.yaml
# BEGIN ANSIBLE MANAGED BLOCK
network:
  version: 2
  renderer: networkd
  ethernets:
   enp1s0f0:
      dhcp4: false
      dhcp6: false
      addresses: []
      optional: true
   enp1s0f1:
      dhcp4: false
      dhcp6: false
      addresses: []
      optional: true
  bonds:
    bond0:
      interfaces: [enp1s0f0, enp1s0f1]
      optional: true
      addresses:
      - 10.10.10.150/29
      gateway4: 10.10.10.145
      nameservers:
          addresses: [1.1.1.1, 8.8.8.8]
      parameters:
          lacp-rate: fast
          mii-monitor-interval: 100
          mode: 802.3ad
          transmit-hash-policy: layer2+3
# END ANSIBLE MANAGED BLOCK

Everything works fine and my server gets the address listed (10.10.10.150).

I need to add additional addresses, so I have created the following file:

# cat /etc/netplan/60.yaml
network:
  version: 2
  renderer: networkd
  bonds:
    bond0:
      addresses:
        - 10.10.11.0/24
        - 10.10.11.1/24

If I run netplan apply everything works without issue. If I reboot, I am unable to access the server. If I KVM into it and run netplan apply everything magically works again.

Quick look at journalctl and I see the following:

# journalctl --no-pager -lu systemd-networkd
-- Logs begin at Sun 2021-10-31 02:26:37 UTC, end at Sun 2021-10-31 02:28:05 UTC. --
Oct 31 02:26:38 res-d035 systemd[1]: Starting Network Service...
Oct 31 02:26:38 res-d035 systemd-networkd[461]: bond0: netdev ready
Oct 31 02:26:38 res-d035 systemd-networkd[461]: Enumeration completed
Oct 31 02:26:38 res-d035 systemd[1]: Started Network Service.
Oct 31 02:26:38 res-d035 systemd-networkd[461]: enp1s0f1: Link UP
Oct 31 02:26:38 res-d035 systemd-networkd[461]: enp1s0f0: Link UP
Oct 31 02:26:38 res-d035 systemd-networkd[461]: bond0: IPv6 successfully enabled
Oct 31 02:26:38 res-d035 systemd-networkd[461]: bond0: Link UP
Oct 31 02:26:41 res-d035 systemd-networkd[461]: enp1s0f1: Gained carrier
Oct 31 02:26:41 res-d035 systemd-networkd[461]: bond0: Gained carrier
Oct 31 02:26:41 res-d035 systemd-networkd[461]: enp1s0f0: Gained carrier
Oct 31 02:26:42 res-d035 systemd-networkd[461]: bond0: Gained IPv6LL
Oct 31 02:27:03 res-d035 systemd-networkd[461]: bond0: Could not set address: Connection timed out
Oct 31 02:27:03 res-d035 systemd-networkd[461]: bond0: Failed

The last two lines are my error, and do NOT exist when I reboot without the 60.yaml file.

What am I doing wrong here? I assume something is not setup correctly in the 60.yaml file, I just can't figure out where I am messing it up.

Thanks in advance.

in flag
k10
Did NOT find a solution. Reverted to just running through rc.local with `ip addr add` commands for now. Thanks to everyone that attempted to assist.
Something Something avatar
eg flag
Is this a solarflare card? Try to do a `onload_tool reload` to see if it helps.
Score:0
cn flag

Although i don't have any experience with netplan; But the problem seems to me in 10.10.11.0/24, Don't assign NETWORK ID 10.10.11.0/24 change the 0 to something else.

in flag
k10
Thanks for the response! I tried removing that entry (10.10.11.0/24) from the 60.yaml file and I experience the same issue; no network on boot. Again, I appreciate the response.
zabiullah avatar
cn flag
Ok, As reviewed once again, you are assigning bond0 IP twice once in 01-netcfg.yaml file and second time in 60.yaml, To use second IP addresses also you need to create VLANs for that and then attach it to bond0.
in flag
k10
Is there another way to assign the second ip address? I was under the impression the way I was assigning it in these files would append the addresses - and it works, it just doesn't work on a reboot. The only reason I'm doing it in this second file is because the first file is managed by the hosting provider and can be overwritten at any time.
zabiullah avatar
cn flag
It wont be a problem, just create VLANs in different file and attached to bond0. As you doing in 60.yml
us flag
You do not have to create vlans to assign multiple addresses to an interface. You should only assign addresses to vlans if your network is configured with vlans.
us flag
I don't know an answer to the original problem being reported, but vlans are not it. I would suggest checking if the problem is reproducible if you put all the configuration for the network interface into a single file instead of splitting it.
zabiullah avatar
cn flag
that is correct that we can assign different IP addresses to one interface no doubt about it as i saw seperated files then suggested vlans for it. @10 I think he is right once put the addresses in same file that might solved the issue
in flag
k10
@slangasek - Thanks for the response! I moved the address all to the same file (01-netcfg.yaml) and it does produce the same error. No solution there.
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.