V
V
Vitaly Gusev2021-03-17 12:29:52
linux
Vitaly Gusev, 2021-03-17 12:29:52

How to force the DHCP server to issue IP addresses from the end of the range?

Good afternoon!

The DHCP server is up on CentOS. Everything works, everything is great.
Here is the content of dhcpd.conf:

subnet 192.168.200.0 netmask 255.255.252.0 {

# --- default gateway
        option routers                  192.168.203.254;
        option subnet-mask              255.255.252.0;

        option nis-domain               "saturnspb.int";
        option domain-name              "saturnspb.int";
        option domain-name-servers      192.168.7.2,192.168.7.5;

        option ntp-servers              192.168.7.2,192.168.7.5;

        range dynamic-bootp 192.168.200.11 192.168.203.250;
        default-lease-time 28800;
        max-lease-time 86400;
#       default-lease-time 200;
#       max-lease-time 400;


But it is necessary that it issue IP addresses to clients from the end of the range.
Tyndex with Google does not give an answer, or I'm not very smart building queries.
How to do it?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
P
pfg21, 2021-03-17
@pfg21

patch raws and recompile.

D
Dmitry Shitskov, 2021-03-17
@Zarom

It is not configured in most dhcp servers, since there is absolutely no difference from which end it is issued.

V
vreitech, 2021-03-17
@fzfx

the dhcp protocol does not prescribe which of the free addresses to provide to the client requesting it for the first time, leaving this at the mercy of specific implementations.
isc-dhcp-server version 3 in such cases, to put it simply, allocates the first free address from the pool (i.e. the first free address from the list of pool addresses, sorted in ascending order).
isc-dhcp-server version 4 allocates an address "randomly": the list of available addresses is based on a hash table.
so apparently you either need to rewrite your dhcp server code, or look for such an implementation of a dhcp server that allows you to set the search order for free ip addresses in the pool when you first assign an ip address to a client. it is possible that such an implementation exists, although personally I have always cared about the order in which clients receive addresses from the pool. and apparently everyone else too.

V
Valentine, 2021-03-18
@ProFfeSsoRr

DHCPD does not know how. I would very much like to know why you need it, because. looks like trying to use DHCP somehow wrong.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question