LXD on Fedora 36: Containers don't get IPv4

In a default configuration of LXD in a Fedora 36 VM:

$ lsb_release -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch
Distributor ID:	Fedora
Description:	Fedora release 36 (Thirty Six)
Release:	36
Codename:	ThirtySix

LXD installed via snapd:

$ lxc --version
5.1

Network and profile look as follows:

$ lxc network show lxdbr0
config:
  ipv4.address: 10.166.172.1/24
  ipv4.nat: "true"
  ipv6.address: fd42:f886:eed8:2e2f::1/64
  ipv6.nat: "true"
description: ""
name: lxdbr0
type: bridge
used_by:
- /1.0/instances/c01
- /1.0/profiles/default
managed: true
status: Created
locations:
- none
$ lxc profile show default
config: {}
description: Default LXD profile
devices:
  eth0:
    name: eth0
    network: lxdbr0
    type: nic
  root:
    path: /
    pool: pool01
    type: disk
name: default
used_by:
- /1.0/instances/c01

Launching container c01:

$ lxc launch ubuntu:22.04 c01

The container doesn’t get an IPV4, but gets an IPV6:


$ lxc ls
+------+---------+------+-----------------------------------------------+-----------+-----------+
| NAME |  STATE  | IPV4 |                     IPV6                      |   TYPE    | SNAPSHOTS |
+------+---------+------+-----------------------------------------------+-----------+-----------+
| c01  | RUNNING |      | fd42:f886:eed8:2e2f:216:3eff:fe8a:6dcc (eth0) | CONTAINER | 0         |
+------+---------+------+-----------------------------------------------+-----------+-----------+

Any hint?

Most likely a firewall issue on the host blocking dhcp requests to lxdbr0 interface.

Thanks @tomp for the hint.
If I put the network interface into zone trusted instead of zone FedoraWorkstation, that is default, it works fine.

1 Like

hi @pmarini_nc
Please can you tell me which file do I need to change the zone in?
Thank you

Edit
I managed to change it using a GUI tool. Selected the lxdbr0 and changed it to trusted. Thank you.
Still if I wanted to change it from the CLI I see there are two places mentioning zones

  • /etc/firewalld/zones/
  • /usr/lib/firewalld/zones/
    which file should I change and in which path?
    thank you