.. _example_service_dhcp-server_class:
#####
Class
#####
These scenarios show how to configure
different class options in DHCP.
These options are useful to provide different
addresses, depending on who the clients are.
*************************
Test DHCP-Server Class-ID
*************************
Description
===========
This scenario shows two ways to define
classes on the server: inside a subnet
or outside it, within the shared
network. Classes defined outside a
subnet apply to every subnet in the
shared network, while classes defined
inside a subnet apply only to that
subnet. The server defines two classes:
one inside the subnet with a
hexadecimal identifier, and another
outside the subnet with an ASCII
identifier. The ASCII option is useful
for OSDx clients that send information
through the vendor-class-identifier
option. The test verifies that clients
receive addresses from the class
matching their identifier.
Scenario
========
.. include:: class/testdhcp-serverclass-id
.. raw:: html
*****************************
Test DHCP-Server Class-ID VRF
*****************************
Description
===========
This scenario verifies that class
matching works correctly when the
server is bound to a VRF instead of
regular interfaces. It configures two
classes, one inside the shared network
and another inside the subnet, and
checks that each client receives a
lease from the class matching its
identifier.
Scenario
========
.. include:: class/testdhcp-serverclass-idvrf
.. raw:: html
*****************************
Test DHCP-Server Class RegExp
*****************************
Description
===========
This scenario tests classes defined
with regular expressions. The first
class matches identifiers containing
"valid" followed by a digit, so a
client identified as "valid" (without
a digit) does not match. The second
class matches identifiers containing
"test" followed by any characters.
Scenario
========
.. include:: class/testdhcp-serverclassregexp
.. raw:: html
*********************************
Test DHCP-Server Invalid Class-ID
*********************************
Description
===========
This scenario verifies that a client
whose identifier does not match any
class identifier configured on the
server fails to obtain a lease.
Scenario
========
.. include:: class/testdhcp-serverinvalidclass-id
.. raw:: html
**************************************
Test DHCP-Server Invalid Configuration
**************************************
Description
===========
This scenario verifies that the
server rejects a configuration where
a subnet references a class that does
not exist.
Scenario
========
.. include:: class/testdhcp-serverinvalidconfiguration
.. raw:: html
*************************
Test DHCP-Server Base-Mac
*************************
Description
===========
This scenario configures a class that
matches the client's base-mac value
and verifies that the client receives
the corresponding lease.
Scenario
========
.. include:: class/testdhcp-serverbase-mac
.. raw:: html