Re: dhclient-${IFNAME}.conf stopped working after upgrade FC32 -> FC34



Hi,


First of all, as always: enable level=TRACE logging and look at the
logs and have them ready for inspection. Read [1] for hints about
logging.

[1] 
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/bae22a45d837e76e805f0f411b2d71748e76625e/contrib/fedora/rpm/NetworkManager.conf#L27
 


1) you already found the [main].dhcp setting. See `man
NetworkManager.conf`. So, this probably does not apply to you. Still:

If you configure [main].dhcp=dhclient, then NetworkManager uses
dhclient DHCP plugin. That involves reading files from /etc/dhcp and
merging them. This was, the user can hack the behavior of dhclient.

This did not change between Fedora 32 and Fedora 34.

What might have changed, is the default setting for [main].dhcp. Since
NetworkManager 1.18, the default changed from [main].dhcp=dhclient to
[main].dhcp=internal. But that did not happen in Fedora 32. So it's not
clear why this would behave different. Also, you might have had another
application that dropped a configuration snippet to
/{usr/lib,run,etc}/NetworkManager/conf.d, which is now gone? Anyway,
check that the desired right DHCP plugin is used.


2) what might have changed is how certain options get merged from
/etc/dhcp. Enable `level=TRACE` logging. See how dhclient gets spawned.
Note the configuration file that NetworkManager generated. Check what
differs or what is missing (if anything).


3)

  $ nmcli c m $UUID 'DHCP4.OPTION+=supersede domain-name-servers=(127.0.0.1)' 

this does not work. The upper case optoins are not settings of the
profile. Instead these are run-time information of the device (display
only). The way to configure NetworkManager is by configuring settings
of the connection profile, that is the lower case options in nmcli
Except, bypassing that API by instructing dhclient in /etc/dhcp
directly as you did earlier.



4) I did try :
   'set ipv4.dns 127.0.0.1
    save persistant
  '

I think you would still the the DNS settings form DHCP. Disable that
with

  nmcli connection modify "$PROFILE" 
    ipv4.ignore-auto-dns yes ipv6.ignore-auto-dns yes


Of course, if all you want is 127.0.0.1 and this is a very static
configuration, then there is no problem with telling NetworkManager not
to configure /etc/resolv.conf. The best way is to make /etc/resolv.conf
as symlink to /etc/my-resolv.conf. That automatically tells
NetworkManager to stay away. Otherwise, configure [main].dns=unmanaged.
See the [main].dns, [main].rc-manager and [main].systemd-resolved
options in `man NetworkManager.conf`.



best,
Thomas


On Mon, 2021-05-31 at 16:17 +0100, Jason Vas Dias via networkmanager-
list wrote:
I did try :
   'set ipv4.dns 127.0.0.1
    save persistant
  '
in  'nmcli c e $uuid', but this did not work either after an up / down
-
/etc/resolv.conf was not updated to contain only '127.0.0.1' - it did
ALSO contain '127.0.0.1', but as a suffix, not a prefix - this is not
what I want .
This did used to work with my old setup on FC32, but not on FC34 .
Is there any custom dhclient.conf file that is included in the current
implementation anymore ?
Thanks, Jason

On 31/05/2021, Jason Vas Dias <jason vas dias gmail com> wrote:

Good day -

  On an FC32 x86_64 box, which I just successfully upgraded to FC34 ,
  now running NM 1.30.4-1.fc34.x86_64 :
  I had some custom dhclient configuration files, which used to be
honored
  by NM - ie. they took effect before upgrade, but not after:

    /etc/dhcp/{dhclient-ens1u2u4.conf,dhclient-wlp59s0.conf}

  which contain:

dhclient.ens1u2u4.conf :

interface "ens1u2u4" {
 send dhcp-client-identifier 34:48:ed:a8:7c:be;
 send host-name "jvdspc.jvds.net";
 supersede domain-name-servers 127.0.0.1;
}


dhclient.wlp59s0.conf :
interface "wlp59s0" {
 send dhcp-client-identifier 5c:80:b6:72:cb:7b;
 send host-name "jvdspc.jvds.net";
 supersede domain-name-servers 127.0.0.1;
}


  There are links to these files in /etc/dhclient-
{ens1u2u4,wlp59s0}.conf ,
and
  /etc/dhclient.{ens1u2u4,wlp59s0}.conf .

  These files used to be merged in to the effective DHCP client
  configuration , on FC32, and all prior FC & RHEL releases I've
used, in:
  /var/lib/NetworkManager/dhclient-{ens1u2u4,wlp59s0}.conf
  , in use for each interface, which is written for each 'up'
transition,
  but no longer.

  I have in /etc/NetworkManager/NetworkManager.conf:

[main]
#plugins=ifcfg-rh
dhcp=dhclient


  I want to run my own ISC BIND caching nameserver,
  which serves some authoritative zones and some RPZ (response
policy) zones
,
  and also tell any Dynamic DNS configured DHCP servers what I
consider
  my domain name to be.

  I already had to disable systemd-resolved service after the
upgrade, which
also
  broke using my own nameserver.

  Please can anyone suggest how I can get this custom DHCP option
content
  included in the effective ISC dhclient (v4) options , without
  hacking the source and building my own NetworkManager to write
  its dhclient.conf differently,  which would be my logical next step
?

  The command:

  $ nmcli c m $UUID 'DHCP4.OPTION+=supersede
domain-name-servers=(127.0.0.1)'

  does not let me add a 'DHCP4.OPTION[32]', though DHCP4.OPTION[0 ...
31]
  is listed in

  $ nmcli c s $UUID

  output - none of them are my custom dhclient-${ifname}.conf options
  above.

  It would be nice if there was some way to run a script to output
  the superseded domain-name-servers list to a file like:
  /etc/named-dns-forwarders.conf, which contains a named.conf
  'forwarders {  $domain_name_server ; }; ' statement, for
  my caching-only-nameserver, which has 'recursion' enabled,
  which I could include in my /etc/named.conf, but since my
  forwarders list does not change often, I can live with this.


Thanks in Advance for any helpful replies, Best Regards,
Jason









_______________________________________________
networkmanager-list mailing list
networkmanager-list gnome org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


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]