Use dhcpcd from NetworkManager?

Asked by ts

Is it possible to use dhcpcd as DHCP client from NetworkManager? With this content in /etc/NetworkManager/conf.d/dhcp-client.conf:

[main]
dhcp=dhcpcd

it should be possible from what i read (for example here discussed for Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=607956), but i get

dhcp-init: DHCP client 'dhcpcd' not available

in syslog and dhclient is used.

Is this possible in Ubuntu 18.04, and how?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu network-manager Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

What is the output of the commands

uname -a
lsb_release -crid
dpkg -l | grep dhcpcd

Revision history for this message
ts (tsdz) said :
#2

This is a fresh install of Ubuntu 18.04 server.

uname -a:
Linux xxx 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -crid:
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic

dpkg -l | grep dhcpcd:
ii dhcpcd5 6.11.5-0ubuntu1 amd64 DHCPv4, IPv6RA and DHCPv6 client with IPv4LL support

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Just a guess, based on the Debian bug:

The text snippet shown there is
...
  AC_MSG_CHECKING(for dhcpcd)
  # We fully work with upstream dhcpcd-4
  for path in /sbin /usr/sbin /usr/pkg/sbin /usr/local/sbin; do
   test -x "${path}/dhcpcd" || continue
   case `"$path/dhcpcd" --version 2>/dev/null` in

The file name of the binary in dhcpcd5, however, is /sbin/dhcpcd5

Maybe it works if you create a link with the name dhcpcd pointing to dhcpcd5 in one of the directories searched.

Revision history for this message
ts (tsdz) said :
#4

Good idea, but there already is /sbin/dhcpcd.

ll /sbin/dhcpcd:
lrwxrwxrwx 1 root root 24 Mai 10 17:09 /sbin/dhcpcd -> /etc/alternatives/dhcpcd*

There seems to be a version check, maybe this version is too new? The next source lines would be interesting, i don't know where to find those..

Revision history for this message
ts (tsdz) said :
#5

Hm, versions >= 4 seem to be supported there (https://git.launchpad.net/network-manager/tree/configure.ac?h=bionic):

 else
  if ! $with_dhcpcd --version 2>&1 | grep -q "^dhcpcd [[456789]]\."; then
   AC_MSG_WARN([Seems version of dhcpcd $with_dhcpcd is too old, version 4.x or newer is required])
  fi
 fi

dhcpcd --version:
dhcpcd 6.11.5
..

Should be ok. But do i have to rebuild network-manager myself with some option enabled to be able to use dhcpcd?

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

The build log of network-manager in Ubuntu 18.04 for amd64 https://launchpadlibrarian.net/362138335/buildlog_ubuntu-bionic-amd64.network-manager_1.10.6-2ubuntu1_BUILDING.txt.gz shows the following:

...
checking for dhcpcd... no
...

I conclude from that output that the binaries provided in the standard Ubuntu repositories have been prepared without dhcpcd support, and I assume that you have to build your own version (unless one of the PPAs already provides such version which I doubt).

Revision history for this message
ts (tsdz) said :
#7

Thank you very much for the information!

I have no experience in building and modifying packages, is there a tutorial how to get started with that? Maybe a workflow that sets up a dev environment (vm or container) to start development on a specific package?

If it were just an option to enable on build, maybe a feature request with a provided patch would not be that hard?

Revision history for this message
Manfred Hampl (m-hampl) said :
#8

There are some instructions available how to install an isolated development environment with chroot and debotstrap, but they seem very much outdated (they are using Ubuntu 8.04 and 10.04 as reference).
https://help.ubuntu.com/community/BasicChroot
https://help.ubuntu.com/community/DebootstrapChroot

Can you help with this problem?

Provide an answer of your own, or ask ts for more information if necessary.

To post a message you must log in.