Can't connect among instances in different hosts

Please show lxc network show lxdfan0

lxc network show lxdfan0
config:
  ipv4.address: 10.168.96.1/24
  ipv4.nat: "true"
  ipv6.address: fd42:84ed:5a07:5662::1/64
  ipv6.nat: "true"
description: ""
name: lxdfan0
type: bridge
used_by:
- /1.0/instances/c3
- /1.0/instances/c5
managed: true
status: Created
locations:
- pc3
- pc5

OK so this is a normal managed bridge private now, not a fan.

So it will only provide connectivity between containers on the same host, and outbound traffic to the external network NATted to the host’s IP.

Do you want your containers to be on the external network?

It was a FAN before, but it wouldn’t work (See first messages). Basically setting the mode=FAN is having the same effect as having a normal managed bridge…

I’d like each container across nodes to talk to one another using their internal IPs. Since I was told (see above) in this Kernel the fan network may not work, I guess I will need to expose them to the external network, correct?

What can I do to check if the kernel has the appropriate patches to support fan?

But yes, I’d like containers to be on the external network.

OK see Public IP in the CT - #26 by tomp

hmm… and will LXD continue manage the DHCP server?

Also, what can I do to check why FAN isn’t working?

You cant have LXD managed two DHCP servers on the same network. That would cause great chaos on your external network :slight_smile:

You need to be running an ubuntu kernel as @stgraber mentioned.

I don’t have a DHCP on my network, that’s why I asked. But what exactly is needed in the Kernel to have it work? I’ve installed the ubuntu-fan package (with no effect), but I am not sure this is what is needed. I also have VXLAN kernel CONFIG set to “y”.

Its a kernel patch rather than a module, I believe there are also patches to some userland tools as well.

Could you please elaborate on how to determine wether an “official” Ubuntu kernel contains the required patches (preferably at runtime)? Can the required information derived from looking at the contents of /boot/config-$(uname -r)? What about, e.g., linux-oem-20.04d, linux-generic-hwe-20.04-edge?

It would be very helpful if there was some kind of “diagnostic toolkit” that could automatically test whether a specified fan network (e.g., lxdfan0) allows connecting among instances on different lxd cluster nodes and point out potential problems w.r.t. kernels, network setup.

Unfortunately I don’t believe this patch comes with a kernel config key, so short of hitting the specific code path through netlink, I’m not aware of a way to detect it.

Would you know what the exact patches one should apply into a standard kernel to get FAN working?

1 Like

I’d also like to have a corresponding, prominent note as part of the LXD cluster setup documentation (apologies if it’s there already, I have been unable to locate it before actually running into this problem and finding this discussion a couple of days ago).
Especially given that the LXD snap is available for/marketed towards Debian users as well (see “Install lxd on Debian”) who at one point might want to set up a cluster and expect instances on different nodes to be able to interconnect with each other.

The option to setup a fan bridge shouldn’t show up on a non-Ubuntu kernel.

lxd init has pretty simple logic that will look for the kernel to have an Ubuntu string in its version (/proc/sys/kernel/version) and will skip that option in LXD init if the kernel doesn’t appear to be an Ubuntu one.

~ubuntu-kernel/ubuntu/+source/linux/+git/jammy - [no description] gets me a few kernel patches for the fan. I don’t know if it’s a complete set though.

Is there a Ubuntu forum or a Canonical developer where we could ask how to set and compile FAN?

1 Like

https://discourse.ubuntu.com/ possibly or maybe the kernel mailing-list at kernel-team Info Page

They’re also in #ubuntu-kernel on libera.chat