Disabling DHCP client

During our testing, we discovered that DHCP client is always active, independent on systemd-networkd settings. Even with networkd disabled (systemctl disable systemd-networkd), the board still acquires IP address when connected to a network.

Configuring with static IP address:

$ cat /etc/systemd/netword/wired-network
[Match]
Name=eth0
[Network]
Address=192.168.111.177/24
Gateway=192.168.111.1
DNS=192.168.111.1

gets two addresses: one from DHCP, one static.

So, the simple question is: How is the DHCP client started? How to enable / disable it when needed?

Configuration: Based on Toradex’ reference image

Colibri-6: $ su -c tdx-info.sh
Password:

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           5.4.193-rt74-5.7.3-devel+git.49e4130e2197 #1 SMP PREEMPT_RT Tue Apr 11 21:14:29 UTC 2023
Kernel command line:      user_debug=30 ubi.mtd=ubi root=ubi0:rootfs rw rootfstype=ubifs ubi.fm_autoconvert=1 console=tty1 console=ttymxc0,115200n8 consoleblank=0
Distro name:              NAME="TDX Wayland with XWayland RT"
Distro version:           VERSION_ID=5.7.3-devel-20230823013514-build.0
Hostname:                 colibri-07131122
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Colibri iMX6ULL 256MB on Colibri Evaluation Board V3
Toradex version:          0036 V1.1A
Serial number:            07131122
Processor arch:           armv7l
-

  • Open connmanctl
  • Identify the service you want to configure
    services
  • Configure Static IP
    config <service_identifier> --ipv4 manual <ip_address> <netmask> <gateway>
  • Exit connmanctl
    quit

Hi Alex, thank you for the leads. It seems connman is different animal than networkd, as only disabling networkd, and setting static from connman made DHCP disappear.

Now I have to find out an API for it (or find out which files this is stored into).

the command-line utility for ConnMan (Connection Manager), stores network settings, including assigned static IP addresses, in service configuration files. These files are typically located in the /var/lib/connman/ directory. Within this directory, each network service or profile has its own folder named after the network service identifier, such as ethernet_00142d613d12_cable , and contains a settings file where configurations like static IP addresses are saved.