Problem configuring a Static Network Configuration

Hi everyone,

I’m experiencing issues configuring the DNS using nmcli within the container. The problem arises when attempting to modify the ipv4.DNS parameter. I can successfully change the ipv4.addresses, gateway, and method settings without any problems. However, the error I encounter is as follows:

root@IB-1:~# nmcli con mod network0 ipv4.dns 8.8.8.8
Error: Failed to modify connection 'network0': ipv4.dns-data: unknown property

As I mentioned, this issue only occurs when running inside the container. When I perform the configuration in TorizonOS, there are no problems.

I’m sharing part of my Dockerfile and the output from tdx-info. If you need anything else, please let me know.

Software summary

Bootloader: U-Boot
Kernel version: 5.15.148-6.6.1-devel+git.23a8e831749d #1-TorizonCore SMP PREEMPT Thu Jun 6 16:07:46 UTC 2024
Kernel command line: root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.0/torizon/97aecdfa8d25bbbbbbe111188a87cad2b0d7a58c8d96a231b0e53e1626d96c23/0
Distro name: NAME=“TorizonCore”
Distro version: VERSION_ID=6.6.1-devel-20240822192531-build.0
Distro variant: VARIANT=“Docker”
Hostname: IB-1

Hardware info

HW model: Toradex Verdin iMX8M Mini on Verdin Development Board
Toradex version: 0057 V1.1B
Serial number: 14684691
Processor arch: aarch64

Dockerfile (1.8 KB)

Best regards!

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


The issue you’re encountering with modifying the ipv4.DNS parameter using nmcli inside a Docker container is likely due to the limitations of running NetworkManager within a containerized environment. NetworkManager is designed to manage network configurations on the host system, and its functionality can be restricted or behave differently when executed inside a container.

Here are a few suggestions to address this issue:

  1. NetworkManager in Containers: Ensure that NetworkManager is properly installed and configured within the container. However, note that running NetworkManager inside a container is not a common practice, as containers typically rely on the host’s network configuration.

  2. Use Host Network: If possible, configure the DNS settings on the host system running TorizonCore instead of within the container. This way, the container can inherit the DNS settings from the host.

  3. Alternative DNS Configuration: Consider using other methods to configure DNS within the container, such as modifying the /etc/resolv.conf file directly. This file is used by the system to determine DNS servers.

  4. Docker Network Options: When starting the container, you can specify DNS servers using Docker’s --dns option. This will configure the container to use the specified DNS servers.

  5. Check Permissions: Ensure that the container has the necessary permissions to modify network settings. You might need to run the container with elevated privileges or adjust its capabilities.

If these suggestions do not resolve the issue, it may be necessary to review the specific configuration of your Docker environment and the container’s setup.

Please, also check if these links can help you solve your problem:

Headless VNC on Verdin iMX8M Plus in TorizonCore container.

Greetings @Isaga,

I have a couple of questions.

First of all, you said you’re doing this in a container. Is it a requirement that you need to change the host network from within a container? is there a reason you can’t just do this outside of the container?

Second, this container you’re using how exactly did you start it? With what arguments and such. I imagine your container does not have access to the host network, nor does it have permission to change attributes of the host network.

You probably need to run your container with network set to host and probably with NET_ADMIN added to the capabilities of that container. If higher permissions are required maybe even running as privileged would be needed.

Best Regards,
Jeremias

Hello @Isaga,

I’ve done some tests and the problem is related to a mismatch version between the NetworkManager installed in the OS and the one available on the container.

On the OS we are running the NetworkManager 1.36.2, while the container uses version 1.42. In this version, the communication with DBus has changed. The main reason you are facing this issue is that the property dns was replaced by dns-data, as you can see here.

If you need to configure the network from within the container, one alternative is fixing the version in your container to 1.36.2 too, since this version will remain stable in Torizon OS 6. To do this, you have to compile this version inside your Dockerfile, can you please try this and let us know the results?

If you face any issues, please let me know.

Best regards,