.. _example_service_dhcp-server_options_server-control:
##############
Server-Control
##############
These scenarios check DHCP server control options that affect server behavior.
This includes: authoritative, one-lease-per-client, lease time, and max-lease time.
*************************
Test One Lease Per Client
*************************
Description
===========
This scenario checks the ``one-lease-per-client`` option.
The test simulates a client that moves between networks by using different
dhcp-client-identifiers. Without one-lease-per-client, the server keeps
both leases active. With the option enabled, when the client requests a
new lease, the server automatically frees any other leases the client holds.
This is useful for mobile clients that change networks frequently.
Scenario
========
.. include:: server-control/testoneleaseperclient
.. raw:: html
*****************************
Test One Lease Per Client VRF
*****************************
Description
===========
This scenario checks the ``one-lease-per-client`` option when the server
is configured with VRF. Same behavior as the non-VRF test: when enabled,
the server frees old leases when a client requests a new one.
Scenario
========
.. include:: server-control/testoneleaseperclientvrf
.. raw:: html
******************
Test Authoritative
******************
Description
===========
This scenario checks the ``authoritative`` option. First, you need to configure a DHCP server without enabling the option and give a lease to the client.
Then, change the configuration of the server for another subnet. The client will refresh his lease and see a problem: the new server is not in the same subnet and is not authorized to give a lease.
Finally, if you enable the option and refresh the interface, you will see the server is authorized and can provide the lease to the client.
Scenario
========
.. include:: server-control/testauthoritative
.. raw:: html
**********************
Test Authoritative VRF
**********************
Description
===========
This scenario checks the ``authoritative`` option when the server is configured with VRF instead of regular interfaces. First, configure the server and give a lease to the client.
Then, change the configuration of the server and put it on a different subnet. Refresh the interfaces and you will see the server cannot do it. Change the configuration again and add the ``authoritative`` option.
With this change, the server will be able to give a lease to the client.
Scenario
========
.. include:: server-control/testauthoritativevrf
.. raw:: html
***************
Test Lease Time
***************
Description
===========
This scenario checks the ``lease`` and ``max-lease`` options.
The DHCP server configures custom lease times (default and maximum).
The client should receive a lease with the configured lease time.
The lease time determines how long the client can use the IP address before renewal.
Scenario
========
.. include:: server-control/testleasetime
.. raw:: html
**********************
Test Server-Identifier
**********************
Description
===========
This scenario checks the ``server-identifier`` option.
The DHCP server configures a specific server identifier IP address.
The client receives this identifier in the DHCP lease, which identifies the DHCP server.
This is useful in environments with multiple DHCP servers.
Scenario
========
.. include:: server-control/testserver-identifier
.. raw:: html