LXC cluster: Error: Failed to create network 'lxdfan0': Not an IPv4 network address: 10.10.0.1/16

networking
cluster

(Mirto Busico) #1

UPDATE changing title to be more clear

Hi all,
I’m trying to setup a three node lxd cluster assigning a class B IP v4 network address.

When I try lxd init (I have version 3.13 installed with snap) i got the error

Error: Failed to create network ‘lxdfan0’: Not an IPv4 network address: 10.10.0.1/16

When asked by lxd init I replied:

What subnet should be used as the Fan underlay? [default=auto]: 10.10.0.1/16

What is the correct method to assign more than 256 addresses to lxdfan0?

UPDATE:

Found this in doc ( https://lxd.readthedocs.io/en/latest/networks/ )

fan.overlay_subnet string fan mode 240.0.0.0/8 Subnet to use as the overlay for the FAN (CIDR notation)

But this address is not accepted by lxd init:

Would you like to create a new Fan overlay network? (yes/no) [default=yes]:
What subnet should be used as the Fan underlay? [default=auto]: 240.0.0.0/8
Invalid input: The underlay subnet must be a /16 or a /24

What subnet should be used as the Fan underlay? [default=auto]: 172.16.0.0/16
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]
Would you like a YAML “lxd init” preseed to be printed? (yes/no) [default=no]:
Error: Failed to create network ‘lxdfan0’: No address found in subnet

What can I do?

UPDATE 2

Strangely this address was refused

sysop@kvmnode1:~$ lxc network create fanbr0 bridge.mode=fan fan.underlay_subnet=172.30.0.0/16
Error: No address found in subnet

but this one is accepted

sysop@kvmnode1:~$ lxc network create fanbr0 bridge.mode=fan fan.underlay_subnet=192.168.0.0/16
Network fanbr0 created
sysop@kvmnode1:~$ lxc network show fanbr0
config:
bridge.mode: fan
fan.underlay_subnet: 192.168.0.0/16
description: “”
name: fanbr0
type: bridge
used_by: []
managed: true
status: Created
locations: - none

I fear that this settings conflicts with the three network cards of the node:

ens3 192.168.202.11
ens4 192.168.200.11
ens5 192.168.201.11

Is it correct or it is a bug?


(Yosu Cadilla) #2

Lets say you have 3 nodes and you want to create a cluster with a FAN network:
Make sure the hosts have IPs in the same /16 range, for example

33.2.37.221
33.2.38.125
33.2.29.20

The underlay for the FAN is 33.2.0.0/16
And you will get a /24 network available for internal use on each of your nodes with a maximum of 254 nodes. The maximum theoretical limit I think is 65K IPs on a single node, but lxd init seems to only admit /16 as the underlay…

FAN networking is one thing and the implementation of FAN networking on LXD is a subset, which is best catered to standard LXD uses.


(Mirto Busico) #3

Thanks.

I’ll try asap