Requesting a ipv6 prefix delegation via a conf file

Glenn Satchell glenn.satchell at uniq.com.au
Wed Dec 22 06:13:08 UTC 2021


Hi Vin,

Have you tried 'send dhcp6.ia-prefix 60'.I'm not sure it will do what 
you want - dhcpd.ia-pd looks like what you want but as you say it 
doesn't work as expected. Can you use snoop or tcpdump to see what is 
being sent to the upstream dhcp server?

Otherwise I'd suggest looking at the source to see what internal options 
gets set by the command line and see if there is a dhclient.conf option 
to match.

option dhcp6.ia-pd string;

The ia-pd option is manufactured by clients and servers to create a 
Prefix Delegation binding - to delegate an IPv6 prefix to the client.
It is not directly edited in dhcpd.conf(5) or dhclient.conf(5), but 
rather is manufactured and consumed by the software.

option dhcp6.ia-prefix string;

The ia-prefix option is placed inside ia-pd options in order to identify 
the prefix(es) allocated to the client. It is not directly
edited in dhcpd.conf(5) or dhclient.conf(5), but rather is manufactured 
and consumed by the software.

The ultimate hack is to rename /sbin/dhclient to say dhclient.exe and 
create a script with the original name that contains the extra command 
line options, eg something like this - I haven't tested it, but hope it 
gives you a hint.

#! /bin/sh

exec $0 $@ --prefix-len-hint 60

regards,

Glenn

On 2021-12-21 23:27, VTwin Farriers wrote:

> My ISP requires that I send a prefix length hint when negotiating a 
> lease in order to get anything other than /64
> 
> I am using a Centos 8 machine as a router. Centos uses NetworkManager 
> by default to manage its network connections. I have changed 
> NetworkManager's default dhcp client from its internal client to 
> dhclient because the internal client does not handle prefix delegation. 
> Unfortunately, NetworkManager does not allow one to pass parameters to 
> the command-line to control the exact dhclient command-line syntax. 
> Thus, it is not possible for me to tell NetworkManager to include 
> "--prefix-len-hint 60" on the command line when it involkes dhclient.
> 
> Without the --prefix-len-hint syntax on the command line, I get 
> assigned a /64 by default.
> 
> NetworkManager *will* create a dhclient.conf file containing various 
> options dhclient will use to create its request and interpret 
> responses.
> 
> Is there a dhclient.conf option which has the same effect as 
> --prefix-len-hint ?
> 
> i tried
> 
> send dhcp6.ia_pd 60
> 
> and that did not work. There does not seem to be any other parameter 
> within the dhclient.conf syntax which will allow the user to control a 
> prefix-length-hint without manually specifying it on the command line.
> 
> Without --prefix-len-hint 60, this is the default dhclient command sent 
> by NetworkManager
> 
> /sbin/dhclient -d -q -6 -N -P -sf /usr/libexec/nm-dhcp-helper -pf 
> /run/NetworkManager/dhclient6-enp0s25.pid -lf 
> /var/lib/NetworkManager/dhclient6-9f97bb2a-0d9b-30fc-944a-480f62373eb7-enp0s25.lease 
> -cf /var/lib/NetworkManager/dhclient6-enp0s25.conf enp0s25
> 
> which yields from my ISP:
> 
> PRC: Soliciting for leases (INIT).
> XMT: Forming Solicit, 0 ms elapsed.
> XMT: X-- IA_NA xx:xx:xx:xx
> XMT: | X-- Request renew in +3600
> XMT: | X-- Request rebind in +5400
> XMT: X-- IA_PD xx:xx:xx:xx
> XMT: | X-- Request renew in +3600
> XMT: | X-- Request rebind in +5400
> XMT: Solicit on enp0s25, interval 1020ms.
> XMT: Forming Solicit, 1020 ms elapsed.
> XMT: X-- IA_NA xx:xx:xx:xx
> XMT: | X-- Request renew in +3600
> XMT: | X-- Request rebind in +5400
> XMT: X-- IA_PD xx:xx:xx:xx
> XMT: | X-- Request renew in +3600
> XMT: | X-- Request rebind in +5400
> XMT: Solicit on enp0s25, interval 2130ms.
> XMT: Forming Solicit, 3150 ms elapsed.
> XMT: X-- IA_NA xx:xx:xx:xx
> XMT: | X-- Request renew in +3600
> XMT: | X-- Request rebind in +5400
> XMT: X-- IA_PD xx:xx:xx:xx
> XMT: | X-- Request renew in +3600
> XMT: | X-- Request rebind in +5400
> XMT: Solicit on enp0s25, interval 4080ms.
> RCV: Advertise message on enp0s25 from fe80::xxxx:xxxx:xxxx:xxxx.
> RCV: X-- IA_NA xx:xx:xx:xx
> RCV: | X-- starts 1640085184
> RCV: | X-- t1 - renew +1800
> RCV: | X-- t2 - rebind +2880
> RCV: | X-- [Options]
> RCV: | | X-- IAADDR 2001:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
> RCV: | | | X-- Preferred lifetime 3600.
> RCV: | | | X-- Max lifetime 3600.
> RCV: X-- IA_PD xx:xx:xx:xx
> RCV: | X-- starts 1640085184
> RCV: | X-- t1 - renew +1800
> RCV: | X-- t2 - rebind +2880
> RCV: | X-- [Options]
> RCV: | | X-- IAPREFIX 2601:xxxx:xxxx:xxxx::/64
> RCV: | | | X-- Preferred lifetime 3600.
> RCV: | | | X-- Max lifetime 3600.
> RCV: X-- Server ID: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
> RCV: Advertisement immediately selected.
> 
> As you can see, I get a /64. However, if I manually execute the same 
> command with a --prefix-len-hint 60, I will get a /60:
> 
> [root at router NetworkManager]# /sbin/dhclient -d -v -6 -N -P 
> --prefix-len-hint 60 -sf /usr/libexec/nm-dhcp-helper -pf 
> /run/NetworkManager/dhclient6-enp0s25.pid -lf 
> /var/lib/NetworkManager/dhclient6-9f97bb2a-0d9b-30fc-944a-480f62373eb7-enp0s25.lease 
> -cf /var/lib/NetworkManager/dhclient6-enp0s25.conf enp0s25
> Internet Systems Consortium DHCP Client 4.4.2-P1
> [...snip...]
> PRC: Soliciting for leases (INIT).
> XMT: Forming Solicit, 0 ms elapsed.
> XMT: X-- IA_NA xx:xx:xx:xx
> XMT: | X-- Request renew in +3600
> XMT: | X-- Request rebind in +5400
> XMT: X-- IA_PD xx:xx:xx:xx
> XMT: | X-- Request renew in +3600
> XMT: | X-- Request rebind in +5400
> XMT: | | X-- Request prefix ::/60.
> XMT: Solicit on enp0s25, interval 1070ms.
> XMT: Forming Solicit, 1070 ms elapsed.
> XMT: X-- IA_NA xx:xx:xx:xx
> XMT: | X-- Request renew in +3600
> XMT: | X-- Request rebind in +5400
> XMT: X-- IA_PD xx:xx:xx:xx
> XMT: | X-- Request renew in +3600
> XMT: | X-- Request rebind in +5400
> XMT: | | X-- Request prefix ::/60.
> XMT: Solicit on enp0s25, interval 2200ms.
> XMT: Forming Solicit, 3270 ms elapsed.
> XMT: X-- IA_NA xx:xx:xx:xx
> XMT: | X-- Request renew in +3600
> XMT: | X-- Request rebind in +5400
> XMT: X-- IA_PD xx:xx:xx:xx
> XMT: | X-- Request renew in +3600
> XMT: | X-- Request rebind in +5400
> XMT: | | X-- Request prefix ::/60.
> XMT: Solicit on enp0s25, interval 4320ms.
> RCV: Advertise message on enp0s25 from fe80::xxxx:xxxx:xxxx:xxxx.
> RCV: X-- IA_NA xx:xx:xx:xx
> RCV: | X-- starts 1640085505
> RCV: | X-- t1 - renew +1800
> RCV: | X-- t2 - rebind +2880
> RCV: | X-- [Options]
> RCV: | | X-- IAADDR 2001:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
> RCV: | | | X-- Preferred lifetime 3600.
> RCV: | | | X-- Max lifetime 3600.
> RCV: X-- IA_PD xx:xx:xx:xx
> RCV: | X-- starts 1640085505
> RCV: | X-- t1 - renew +1800
> RCV: | X-- t2 - rebind +2880
> RCV: | X-- [Options]
> RCV: | | X-- IAPREFIX 2601:xxxx:xxxx:xxxx::/60
> RCV: | | | X-- Preferred lifetime 3600.
> RCV: | | | X-- Max lifetime 3600.
> RCV: X-- Server ID: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
> RCV: Advertisement immediately selected.
> 
> Is there a dhclient.conf option I am missing somewhere in the 
> documentation which will accomplish this?
> 
> If not, would it be possible to add a conf file option, such as "send 
> dhcp6.prefix-length-hint 60" to allow the user to control this behavior 
> via the configuration file rather than the command line?
> 
> thanks,
> 
> vin
> 
> _______________________________________________
> ISC funds the development of this software with paid support 
> subscriptions. Contact us at https://www.isc.org/contact/ for more 
> information.
> 
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20211222/bf54442c/attachment-0001.htm>


More information about the dhcp-users mailing list