Re: How to configure NM using dhclient-script file

On Fri, 2020-11-27 at 09:48 +0800, Mars via networkmanager-list wrote:
NM uses nm-dhcp-helper as network configuration script for dhclient
as follows , how to confiure dhclient-script file within NM ?

/sbin/dhclient -d -q -sf /usr/libexec/nm-dhcp-helper -pf
/var/run/ -lf /var/lib/NetworkManager/dhclient- -cf
/var/lib/NetworkManager/dhclient-eth0.conf eth0
Thank you very much for any help you can provide.


You cannot (*). When NetworkManager runs dhclient, then this is mostly
an implementation detail for doing DHCP. Sure, it honors dhclient's
config files in /etc/dhcp and it also dispatches the dhclient hooks.
That is very powerful (since it's just arbitrary scripts that get
executed), but it's also undesirable because the funcitonality is not
available with dhcp=internal plugin and not available via
NetworkManager API and NetworkManager mostly doens't know what is
happening there. But in general, this is not supposed to give the user
direct access to dhclient.

(*) well, of course you can do all kind of hacky solutions, like
replacing /usr/libexec/nm-dhcp-helper with a wrapper script.

It might be better to explain what you ultimately want to do. Instead
of asking how to do something that you think might be a solution for
you (without explainging what your actual problem is).


Attachment: signature.asc
Description: This is a digitally signed message part

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]