I was able to identify from where the port range list is initialize, and the decision is taken by binary package "libdns162" (source package "bind9")[1] which dhclient relies on.
Basically, it randomly takes any port available between 1024 and 65535[2]
So there is a port randomization mechanism made by the library that take the decision instead of, for instance in some other cases, where the decision is leave it to the kernel[3].
In this particular case both sysctl options :
net.ipv4.ip_local_port_range
net.ipv4.ip_local_reserved_ports
I was able to identify from where the port range list is initialize, and the decision is taken by binary package "libdns162" (source package "bind9")[1] which dhclient relies on.
Basically, it randomly takes any port available between 1024 and 65535[2]
So there is a port randomization mechanism made by the library that take the decision instead of, for instance in some other cases, where the decision is leave it to the kernel[3].
In this particular case both sysctl options : ip_local_ port_range ip_local_ reserved_ ports
net.ipv4.
net.ipv4.
have no effect on port assignation decision.
[1] - https:/ /github. com/wklaebe/ bind9/blob/ ac1dcdd124a5abd ec4969e2c33836d 863bf73aa7/ lib/dns/ dispatch. c#L1921 /tools. ietf.org/ html/rfc6335 ip_local_ port_range = 32768 60999
[2] - https:/
[3] - Example : net.ipv4.
Regards,