Rocky Linux 10 container not getting DHCP IP address on macvlan interface

Hopefully I’m not providing unnecessary information here.

I have a profile with a networking device

# incus profile show lxd_containers
config: {}
description: “”
devices:
eth0:
nictype: macvlan
parent: eno1
type: nic
root:
path: /
pool: my_storage
type: disk
name: lxd_containers
used_by:
project: default

When I create a rocky linux 9 container - that container gets an IP address by DHCP

# incus launch images:rockylinux/9 rockylinux9-test  -p lxd_containers
# lxc info rockylinux9-test --show-log
Name: rockylinux9-test
Status: RUNNING
Type: container
Architecture: x86_64
PID: 424924
Created: 2025/08/29 10:44 UTC
Last Used: 2025/08/29 10:44 UTC
Started: 2025/08/29 10:44 UTC

Resources:
  Processes: 16
  Disk usage:
    root: 5.10MiB
  CPU usage:
    CPU usage (in seconds): 2
  Memory usage:
    Memory (current): 51.77MiB
    Memory (peak): 72.18MiB
  Network usage:
    eth0:
      Type: broadcast
      State: UP
      Host interface: eno1
      MAC address: 00:16:3e:21:16:19
      MTU: 1500
      Bytes received: 146.65kB
      Bytes sent: 2.15kB
      Packets received: 1749
      Packets sent: 21
      IP addresses:
        inet:  192.168.8.176/20 (global)
        inet6: fe80::216:3eff:fe21:1619/64 (link)
    lo:
      Type: loopback
      State: UP
      MTU: 65536
      Bytes received: 0B
      Bytes sent: 0B
      Packets received: 0
      Packets sent: 0
      IP addresses:
        inet:  127.0.0.1/8 (local)
        inet6: ::1/128 (local)

Inside the container - it has an IP address

# ip a  
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2625: eth0@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:16:3e:21:16:19 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 192.168.8.176/24 brd 192.168.255.255 scope global dynamic eth0
       valid_lft 7174sec preferred_lft 7174sec
    inet6 fe80::216:3eff:fe21:1619/64 scope link 
       valid_lft forever preferred_lft forever

When I create a Rocky Linux 10 container, the container is not getting an IP address

# lxc launch images:rockylinux/10 rockylinux10-test  -p lxd_containers
# lxc info rockylinux10-test --show-log
Name: rockylinux10-test
Status: RUNNING
Type: container
Architecture: x86_64
PID: 2041193
Created: 2025/08/29 10:53 UTC
Last Used: 2025/08/29 10:53 UTC
Started: 2025/08/29 10:54 UTC

Resources:
  Processes: 20
  Disk usage:
    root: 5.05MiB
  CPU usage:
    CPU usage (in seconds): 2
  Memory usage:
    Memory (current): 55.57MiB
    Memory (peak): 75.25MiB
  Network usage:
    eth0:
      Type: broadcast
      State: DOWN
      Host interface: eno1
      MAC address: 00:16:3e:ef:06:ca
      MTU: 1500
      Bytes received: 832B
      Bytes sent: 426B
      Packets received: 10
      Packets sent: 5
      IP addresses:
    lo:
      Type: loopback
      State: UP
      MTU: 65536
      Bytes received: 0B
      Bytes sent: 0B
      Packets received: 0
      Packets sent: 0
      IP addresses:
        inet:  127.0.0.1/8 (local)
        inet6: ::1/128 (local)

inside the container

# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2628: eth0@if2: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 00:16:3e:ef:06:ca brd ff:ff:ff:ff:ff:ff link-netnsid 0

How do I investigate this further?

If I grep /var/log/messages for NetworkManager - there is no mention of eth0

Inside the rocky linux 10 container

# nmcli con show
NAME  UUID                                  TYPE      DEVICE 
lo    9b72c758-6d85-48d5-a253-2987a441b6dd  loopback  lo     
# nmcli dev show
GENERAL.DEVICE:                         lo
GENERAL.TYPE:                           loopback
GENERAL.HWADDR:                         00:00:00:00:00:00
GENERAL.MTU:                            65536
GENERAL.STATE:                          100 (connected (externally))
GENERAL.CONNECTION:                     lo
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/1
IP4.ADDRESS[1]:                         127.0.0.1/8
IP4.GATEWAY:                            --
IP6.ADDRESS[1]:                         ::1/128
IP6.GATEWAY:                            --

GENERAL.DEVICE:                         eth0
GENERAL.TYPE:                           macvlan
GENERAL.HWADDR:                         00:16:3E:EF:06:CA
GENERAL.MTU:                            1500
GENERAL.STATE:                          10 (unmanaged)
GENERAL.CONNECTION:                     --
GENERAL.CON-PATH:                       --
IP4.GATEWAY:                            --
IP6.GATEWAY:                            --

The NetworkManager that comes with RHEL 10 has an integrated dhcp client, so running dhclient on it’s own is not an option.

Your Rocky Linux 10 container’s eth0 is down, it will not connect to any network. You can try to start eth0: ip link set eth0 up

But it downs for a reason, you need to find it.

Yea, bringing up the interface with ip link set eth0 up results in the interface showing as up

# lxc info rockylinux10-test --show-log
Name: rockylinux10-test
Status: RUNNING
Type: container
Architecture: x86_64
PID: 276229
Created: 2025/08/29 15:06 UTC
Last Used: 2025/08/29 15:07 UTC
Started: 2025/08/29 15:07 UTC

Resources:
  Processes: 19
  Disk usage:
    root: 5.05MiB
  CPU usage:
    CPU usage (in seconds): 3
  Memory usage:
    Memory (current): 57.90MiB
    Memory (peak): 74.67MiB
  Network usage:
    eth0:
      Type: broadcast
      State: UP
      Host interface: eno1
      MAC address: 00:16:3e:98:af:74
      MTU: 1500
      Bytes received: 734.27kB
      Bytes sent: 1.59kB
      Packets received: 8972
      Packets sent: 20
      IP addresses:
        inet6: fe80::216:3eff:fe98:af74/64 (link)
    lo:
      Type: loopback
      State: UP
      MTU: 65536
      Bytes received: 0B
      Bytes sent: 0B
      Packets received: 0
      Packets sent: 0
      IP addresses:
        inet:  127.0.0.1/8 (local)
        inet6: ::1/128 (local)

However, it still isn’t getting an IP address.

I can’t work out if the issue is something with the way that incus interacts with the container’s networking.

Can you try to manually config container to use DHCP or assign static ip?

Implementing the Network - Documentation

I’m working on trying to understand the networking changes between RHEL 9 and 10.

As far as I am aware that documentation that you linked is not applicable, as RHEL 10 doesn’t use ifcfg files.

As far as I can only nmcli should used.

I’m not clear whether the change in networking in RHEL 10 are causing the issues that I am having.

well, I don’t know how RHEL 10 or Rocky Linux 10 control network, I just googled Rocky Linux network and gave the link. Anyway, you are using it, you know where the document is.

Your NIC is up, all you need to do is config it to connect to network.

Got this working.

The Rocky Linux 10 Network Manager doesn’t seem to like macvlan interfaces - I switched over to a bridged interface.

I spotted that my host was using cgroup v1 - I switched over to cgroup v2 - I did this before the macvlan → bridged change, so I’m not sure if that was a required change or not.

I ran into something similar with Rocky 10 on an OVN network in Incus. It seems that with RHEL 10 NetworkManager now does IPv4 duplicate address detection, even on DHCP issued addresses: Changes/Enable IPv4 Address Conflict Detection - Fedora Project Wiki

I was seeing behavior like this:

$ incus launch images:rockylinux/10/cloud homecluster:test-rocky
Launching test-rocky
$ incus list homecluster:test-rocky
+------------+---------+------+------+-----------+-----------+----------+
|    NAME    |  STATE  | IPV4 | IPV6 |   TYPE    | SNAPSHOTS | LOCATION |
+------------+---------+------+------+-----------+-----------+----------+
| test-rocky | RUNNING |      |      | CONTAINER | 0         | incus2   |
+------------+---------+------+------+-----------+-----------+----------+
$ incus shell homecluster:test-rocky
[root@test-rocky ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host proto kernel_lo 
       valid_lft forever preferred_lft forever
122: eth0@if123: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 10:66:6a:19:4e:0a brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::1266:6aff:fe19:4e0a/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
[root@test-rocky ~]# journalctl -u NetworkManager | tail -5
Oct 23 04:24:41 test-rocky NetworkManager[216]: <info>  [1761193481.4783] device (lo): state change: ip-check -> secondaries (reason 'none', managed-type: 'external')
Oct 23 04:24:41 test-rocky NetworkManager[216]: <info>  [1761193481.4785] device (lo): state change: secondaries -> activated (reason 'none', managed-type: 'external')
Oct 23 04:24:41 test-rocky NetworkManager[216]: <info>  [1761193481.4789] device (lo): Activation: successful, device activated.
Oct 23 04:24:41 test-rocky NetworkManager[216]: <warn>  [1761193481.4812] device (eth0): IP address 192.168.18.15 cannot be configured because it is already in use in the network by host 10:66:6A:36:83:BE
Oct 23 04:24:41 test-rocky NetworkManager[216]: <info>  [1761193481.4971] dhcp4 (eth0): state changed new lease, address=192.168.18.15, acd conflict
[root@test-rocky ~]# arping -D -I eth0 192.168.18.15
ARPING 192.168.18.15 from 0.0.0.0 eth0
Unicast reply from 192.168.18.15 [10:66:6A:36:83:BE]  1.156ms
Sent 1 probes (1 broadcast(s))
Received 1 response(s)

The MAC address it’s complaining about in the logs seem to be the MAC of the network itself:

$ incus network info homecluster:default 
Name: default
MAC address: 10:66:6a:36:83:be
MTU: 1500
State: up
Type: broadcast

IP addresses:
  inet  192.168.18.1/23 (link)

OVN:
  Chassis: incus1.<omitted>
  Logical router: incus-net83-lr
  Logical switch: incus-net83-ls-int
  IPv4 uplink address: 192.168.15.100

Not sure if this is intentional behavior or if it’s a bug, but regardless I was able to work around it by adding the following cloud-init userdata when launching a RHEL 10 based container/vm:

config:
  cloud-init.user-data: |
    bootcmd:
      - echo -e "# Disable duplicate address detection for incus.\n[connection-dad-default]\nipv4.dad-timeout=0" > /etc/NetworkManager/conf.d/20-ipv4-dad.conf
      - systemctl restart NetworkManager