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

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set service dhcp-server shared-network one-lease subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.10
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address dhcp
set interfaces ethernet eth0 dhcp client send dhcp-client-identifier string client-A
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 4: Run command show monitor-db system dhcp interface eth0 ip-address at DUT1 and expect this output:

Show output
10.0.0.5

Step 5: Run command service dhcp-server show leases main at DUT0 and expect this output:

Show output
Instance main:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
 10.0.0.5   de:ad:be:ef:6c:10  2026/03/20 12:18:56  2026/03/21 00:18:56  2026/03/20 12:18:56

Step 6: Modify the following configuration lines in DUT1 :

delete interfaces ethernet eth0 address

Step 7: Modify the following configuration lines in DUT1 :

delete interfaces

Step 8: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address dhcp
set interfaces ethernet eth0 dhcp client send dhcp-client-identifier string client-B
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 9: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.6/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 10: Run command show monitor-db system dhcp interface eth0 ip-address at DUT1 and expect this output:

Show output
10.0.0.6

Step 11: Run command service dhcp-server show leases main at DUT0 and expect this output:

Show output
Instance main:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
 10.0.0.6   de:ad:be:ef:6c:10  2026/03/20 12:19:00  2026/03/21 00:19:00  2026/03/20 12:19:00

Step 12: Modify the following configuration lines in DUT0 :

set service dhcp-server shared-network one-lease subnet 10.0.0.0/24 options one-lease-per-client

Step 13: Run command service dhcp-client renew interface eth0 at DUT1 and expect this output:

Show output
Renewing DHCP lease on interface eth0...

Step 14: Run command service dhcp-server show leases main at DUT0 and expect this output:

Show output
Instance main:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
 10.0.0.6   de:ad:be:ef:6c:10  2026/03/20 12:19:00  2026/03/21 00:19:00  2026/03/20 12:19:00

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

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set interfaces ethernet eth0 vrf VRF0
set service dhcp-server shared-network one-lease local-vrf VRF0
set service dhcp-server shared-network one-lease subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.10
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system vrf VRF0

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address dhcp
set interfaces ethernet eth0 dhcp client send dhcp-client-identifier string client-A
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 4: Run command show monitor-db system dhcp interface eth0 ip-address at DUT1 and expect this output:

Show output
10.0.0.5

Step 5: Run command service dhcp-server show leases VRF0 at DUT0 and expect this output:

Show output
Instance VRF0:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
 10.0.0.5   de:ad:be:ef:6c:10  2026/03/20 12:19:13  2026/03/21 00:19:13  2026/03/20 12:19:13

Step 6: Modify the following configuration lines in DUT1 :

delete interfaces ethernet eth0 address

Step 7: Modify the following configuration lines in DUT1 :

delete interfaces

Step 8: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address dhcp
set interfaces ethernet eth0 dhcp client send dhcp-client-identifier string client-B
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 9: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.6/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 10: Run command show monitor-db system dhcp interface eth0 ip-address at DUT1 and expect this output:

Show output
10.0.0.6

Step 11: Modify the following configuration lines in DUT0 :

set service dhcp-server shared-network one-lease subnet 10.0.0.0/24 options one-lease-per-client

Step 12: Run command service dhcp-client renew interface eth0 at DUT1 and expect this output:

Show output
Renewing DHCP lease on interface eth0...

Step 13: Run command service dhcp-server show leases VRF0 at DUT0 and expect this output:

Show output
Instance VRF0:

--------------------------------------------------------------------------------------------
IP Address     MAC Address         Start Time         Expiration Time     Last Transaction
--------------------------------------------------------------------------------------------
 10.0.0.6   de:ad:be:ef:6c:10  2026/03/20 12:19:18  2026/03/21 00:19:18  2026/03/20 12:19:18

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

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set service dhcp-server shared-network authoritative subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 mac '10:00:00:00:00:01'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Modify the following configuration lines in DUT1 :

set interfaces ethernet eth0 address dhcp

Warning

If you do not see changes after enabling the options, refresh all your interfaces

Step 4: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 5: Modify the following configuration lines in DUT0 :

delete interfaces
delete service

Step 6: Modify the following configuration lines in DUT0 :

set interfaces ethernet eth0 address 11.0.0.1/24
set service dhcp-server shared-network authoritative subnet 11.0.0.0/24 start 11.0.0.5 stop 11.0.0.5

Step 7: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 8: Run command system journal show | tail at DUT0 and check if output contains the following tokens:

DHCPREQUEST for 10.0.0.5 from 10:00:00:00:00:01 via eth0: ignored (not authoritative)
Show output
Mar 20 12:19:34.276593 osdx modulelauncher[522553]: Command '/sbin/ethtool -A eth0 autoneg on' returned non-zero exit status 76.
Mar 20 12:19:34.278042 osdx modulelauncher[522553]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --
Mar 20 12:19:34.278057 osdx modulelauncher[522553]: Command '/sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --' returned non-zero exit status 75.
Mar 20 12:19:34.366515 osdx systemd[1]: Started dhcpd@main.service - "DHCP Server Service instance main".
Mar 20 12:19:34.369178 osdx dhcpd[522579]: Wrote 0 leases to leases file.
Mar 20 12:19:34.369309 osdx cfgd[1833]: [521224]Completed change to active configuration
Mar 20 12:19:34.382504 osdx OSDxCLI[521224]: User 'admin' committed the configuration.
Mar 20 12:19:34.401110 osdx OSDxCLI[521224]: User 'admin' left the configuration menu.
Mar 20 12:19:34.406232 osdx dhcpd[522579]: Server starting service.
Mar 20 12:19:34.741196 osdx dhcpd[522579]: DHCPREQUEST for 10.0.0.5 from 10:00:00:00:00:01 via eth0: ignored (not authoritative).

Step 9: Modify the following configuration lines in DUT0 :

set service dhcp-server options authoritative

Step 10: Run command system journal show | tail at DUT0 and check if output contains the following tokens:

DHCPNAK on 10.0.0.5 to 10:00:00:00:00:01 via eth0
Show output
Mar 20 12:19:35.402287 osdx systemd[1]: dhcpd@main.service: Deactivated successfully.
Mar 20 12:19:35.402460 osdx systemd[1]: Stopped dhcpd@main.service - "DHCP Server Service instance main".
Mar 20 12:19:35.426408 osdx systemd[1]: Started dhcpd@main.service - "DHCP Server Service instance main".
Mar 20 12:19:35.428593 osdx cfgd[1833]: [521224]Completed change to active configuration
Mar 20 12:19:35.429159 osdx dhcpd[522630]: Wrote 0 leases to leases file.
Mar 20 12:19:35.430606 osdx OSDxCLI[521224]: User 'admin' committed the configuration.
Mar 20 12:19:35.446088 osdx OSDxCLI[521224]: User 'admin' left the configuration menu.
Mar 20 12:19:35.462213 osdx dhcpd[522630]: Server starting service.
Mar 20 12:19:35.801159 osdx dhcpd[522630]: DHCPREQUEST for 10.0.0.5 from 10:00:00:00:00:01 via eth0: wrong network.
Mar 20 12:19:35.801181 osdx dhcpd[522630]: DHCPNAK on 10.0.0.5 to 10:00:00:00:00:01 via eth0

Step 11: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

11.0.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  11.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

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

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set interfaces ethernet eth0 vrf VRF0
set service dhcp-server shared-network authoritative local-vrf VRF0
set service dhcp-server shared-network authoritative subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system vrf VRF0

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 mac '10:00:00:00:00:01'
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Modify the following configuration lines in DUT1 :

set interfaces ethernet eth0 address dhcp

Warning

If you do not see changes after enabling the options, refresh all your interfaces

Step 4: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 5: Modify the following configuration lines in DUT0 :

delete interfaces
delete service

Step 6: Modify the following configuration lines in DUT0 :

set interfaces ethernet eth0 address 11.0.0.1/24
set interfaces ethernet eth0 vrf VRF0
set service dhcp-server shared-network authoritative local-vrf VRF0
set service dhcp-server shared-network authoritative subnet 11.0.0.0/24 start 11.0.0.5 stop 11.0.0.5

Step 7: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 8: Run command system journal show | tail at DUT0 and check if output contains the following tokens:

DHCPREQUEST for 10.0.0.5 from 10:00:00:00:00:01 via eth0: ignored (not authoritative)
Show output
Mar 20 12:19:48.508782 osdx modulelauncher[523225]: osdx.utils.xos cmd error: /sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --
Mar 20 12:19:48.508793 osdx modulelauncher[523225]: Command '/sbin/ethtool -s eth0 autoneg on advertise Asym_Pause off Pause off --' returned non-zero exit status 75.
Mar 20 12:19:48.522902 osdx kernel: 8021q: adding VLAN 0 to HW filter on device eth0
Mar 20 12:19:48.703202 osdx systemd[1]: Started dhcpd@VRF0.service - "DHCP Server Service instance VRF0".
Mar 20 12:19:48.704643 osdx cfgd[1833]: [521224]Completed change to active configuration
Mar 20 12:19:48.705619 osdx dhcpd[523286]: Wrote 0 leases to leases file.
Mar 20 12:19:48.720116 osdx OSDxCLI[521224]: User 'admin' committed the configuration.
Mar 20 12:19:48.731108 osdx dhcpd[523286]: Server starting service.
Mar 20 12:19:48.751577 osdx OSDxCLI[521224]: User 'admin' left the configuration menu.
Mar 20 12:19:49.090115 osdx dhcpd[523286]: DHCPREQUEST for 10.0.0.5 from 10:00:00:00:00:01 via eth0: ignored (not authoritative).

Step 9: Modify the following configuration lines in DUT0 :

set service dhcp-server options authoritative

Step 10: Run command system journal show | tail at DUT0 and check if output contains the following tokens:

DHCPNAK on 10.0.0.5 to 10:00:00:00:00:01 via eth0
Show output
Mar 20 12:19:49.795183 osdx systemd[1]: dhcpd@VRF0.service: Deactivated successfully.
Mar 20 12:19:49.795285 osdx systemd[1]: Stopped dhcpd@VRF0.service - "DHCP Server Service instance VRF0".
Mar 20 12:19:49.815228 osdx systemd[1]: Started dhcpd@VRF0.service - "DHCP Server Service instance VRF0".
Mar 20 12:19:49.817534 osdx cfgd[1833]: [521224]Completed change to active configuration
Mar 20 12:19:49.817690 osdx dhcpd[523337]: Wrote 0 leases to leases file.
Mar 20 12:19:49.819764 osdx OSDxCLI[521224]: User 'admin' committed the configuration.
Mar 20 12:19:49.835479 osdx OSDxCLI[521224]: User 'admin' left the configuration menu.
Mar 20 12:19:49.854999 osdx dhcpd[523337]: Server starting service.
Mar 20 12:19:50.210136 osdx dhcpd[523337]: DHCPREQUEST for 10.0.0.5 from 10:00:00:00:00:01 via eth0: wrong network.
Mar 20 12:19:50.210158 osdx dhcpd[523337]: DHCPNAK on 10.0.0.5 to 10:00:00:00:00:01 via eth0

Step 11: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

11.0.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  11.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

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

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set service dhcp-server shared-network lease-time subnet 10.0.0.0/24 options lease 120
set service dhcp-server shared-network lease-time subnet 10.0.0.0/24 options max-lease 240
set service dhcp-server shared-network lease-time subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address dhcp
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 4: Run command show monitor-db system dhcp interface eth0 lease-time at DUT1 and expect this output:

Show output
240

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

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.0.0.1/24
set service dhcp-server shared-network server-id subnet 10.0.0.0/24 options server-identifier 10.0.0.1
set service dhcp-server shared-network server-id subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address dhcp
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0.5
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 4: Run command show monitor-db system dhcp interface eth0 dhcp-server-identifier at DUT1 and expect this output:

Show output
10.0.0.1